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

java.util.Calendar and java.text.DateFormat documentation needs more clarity.

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.6_03
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      JDK version: JDK1.1.6

      1) There is insufficient documentation stating that the
         year 0 AD is automatically converted to the year 1BC.
         And the only way one can determine this is by checking
         the ERA flag and one can learn this only by talking to a
         developer, to clarify this problem is more than a "tutorial"
         question as many may think it to be.

      2) There is not sufficient documentation describing the
         behaviour of the DateFormat class and the way it treats
         the various years, there are different rules that come
         into play based on the leniency flag which can be set,
         there is very strange behaviour whether this flag is turned
         on or not.

         This is because some "heuristic" is being used and what this
          heuristic does should be documented.
         Some examples:

         format: MM/dd/yy accepts 02/08/-1 thru 02/08/-9
                          does not accept 02/08/-10 (3 character year)
                 (Justification: -1 is a 2 character year,-10 onwards are not)

         format: MM/dd/yyy demonstrates same behaviour as above BUT
                 -10 onwards are still not accepted,
                 based on the number of characters they should be accepted,
                 this behaviour is demonstrated even when the format
      is MM/dd/yyyy (4 character years).


      3) Behaviour of the 80/20 rule used by the DateFormat class,
         especially when there are negative years being supplied,
         there has been a bug created related to this, it is in the
         "See also buglist".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aliusunw Alan Liu (Inactive)
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: