United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4171233 : java.io.PushbackInputStream should override mark and reset methods

Details
Type:
Bug
Submit Date:
1998-09-03
Status:
Resolved
Updated Date:
2003-06-06
Project Name:
JDK
Resolved Date:
2003-05-16
Component:
core-libs
OS:
solaris_2.5.1
Sub-Component:
java.io
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.0
Fixed Versions:
5.0 (tiger)

Related Reports
Relates:

Sub Tasks

Description
	The PushbackInputStream class overrides markSupported() to
return false. For consistency with other java.io.* classes it should also
override mark() to be a NOP and reset() to throw an IOException with
a reason string saying that mark/reset are not supported.

Currently, mark() and reset() are not overridden and so are inherited from
FilterInputStream which delegates them to the next InputStream which may well
actually implement mark/reset and result in inconsistent and unexpected
behavior when using the pushbackInputStream.

Although developers should really call
mark() and reset() on a stream only if markSupported() returns true
the current behavior in pushbackInputStream is inconsistent from other
java.io.* classes which override all 3 methods together and could results in odd
and confusing behavior that may be difficult to debug.

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b07


                                     
2004-06-14
SUGGESTED FIX

	PushbackInputStream should implement a NOP mark() method and
a reset() method which throws an IOException.
                                     
2004-06-11
PUBLIC COMMENTS

	PushbackInputStream should consistently override mark() and reset()
in addition to markSupported().
                                     
2004-06-10
EVALUATION

PushbackInputStream subvertly goes ahead and actually marks and resets the underlying stream (potentially incorrectly) even though it clearly professes that it does'nt support the mark/reset mechanism. The suggested fix will be put in Kestrel FCS.

naveen.sanjeeva@eng 1999-09-14

Reopened bug, since CCC decided that Kestrel FCS was too late to introduce this fix.

naveen.sanjeeva@eng 1999-10-15

Have done as the description suggests in Tiger.
###@###.### 2003-04-23
                                     
1999-10-15



Hardware and Software, Engineered to Work Together