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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1.6_03
    • core-libs

      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".

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: