Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4491255
Votes 0
Synopsis PrintWriter.clearError() to reset internal error state
Category java:classes_io
Reported Against merlin-beta
Release Fixed mustang(b59)
State 10-Fix Delivered, Verified, request for enhancement
Priority: 3-Medium
Related Bugs
Submit Date 13-AUG-2001
Description


java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

While class java.io.PrintWriter has a checkError() method for retrieving the
internal error flag of the output stream, it does not have any corresponding
method for clearing (resetting) the error flag.

Error conditions are cumulative, with the undesirable consequence that once the
error flag is set, it can never be reset, even if the error condition has been
fixed or ignored as appropriate.

Classes that extend PrintWriter can't clear the error flag either, because the
flag is private.

Adding the following method to java.io.PrintWriter would fill this gap:

    public void clearError();

If this is considered too major a change, the method above could still be added
as a protected method (corresponding to the existing protected setError())
method, so at least classes extending PrintWriter would have a means to clear
the error flag.

--
Related bugs: 4219383
(Review ID: 129842) 
======================================================================
Posted Date : 2005-08-05 08:03:45.0
Work Around
N/A
Evaluation
A reasonable request.  Will be considered for the next feature release.

--   xxxxx@xxxxx   2002/4/25
A protected method to clear the error status can be added with a little refinement to the Javadoc in the suggested fix.
Posted Date : 2005-10-19 06:06:15.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang