Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4638858

Access to stamp data member in Calendar class

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              okutsu Masayoshi Okutsu
              Reporter:
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: