JDK-4171233 : java.io.PushbackInputStream should override mark and reset methods
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.5.1
  • CPU: generic
  • Submitted: 1998-09-03
  • Updated: 2017-05-16
  • Resolved: 2003-05-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Relates :  
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
14-06-2004

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

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

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
15-10-1999