Name: skT88420 Date: 07/07/99
The fields of many of the standard classes are private rather than
protected, which inhibits the ability to easily derive new objects.
For instance, I would like to create a Logfile class that derives from
PrintWriter, but automatically rotates the log file when (for example)
a certain number of lines are written or a certain amount of time has passed.
If the fields were protected, this is a simple matter of modifying
PrintWriter.newLine() and touching PrintWriter.out as necessary. However,
now I have to duplicate the PrintWriter for no good reason.
(Review ID: 85299)
======================================================================
- duplicates
-
JDK-4121985 java.io.PrintWriter: Make out a protected field
-
- Closed
-