Name: jk109818 Date: 02/15/2002
FULL PRODUCT VERSION :
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
FULL OPERATING SYSTEM VERSION : Microsoft Windows 2000
[Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
The current access control for some of the fields/methods
for the Calendar class prevent concrete derived classes
from being developed outside of the java.util package. In
particular the problem is with the stamp data member. By
using the default access, this field is unavialable to a
derived class not developed by Sun. Preventing a derived
class from setting this field makes sense. However, child
classes must have read access to this field in order to
determine which field amongst competing fields (e.g
HOUR/AM_PM vs. HOUR_OF_DAY) to use in computeTime (). One
of the following changes are required:
- Provide a new protected method [e.g. getStamp (int field)]
in Calendar for examining the value of the stamp.
- Remove the final modifier from the following Calendar
methods:
clear ()
clear (int field)
isSet (int field)
This will allow a derived class to maintain its own stamp
mechanism.
- Provide another solution.
This inconsistency exist in 1.4.0
EXPECTED VERSUS ACTUAL BEHAVIOR :
Minor changes to the Calendar class that facilitate the
development of derived classes outside the java.util
package.
This bug can be reproduced always.
(Review ID: 139740)
======================================================================