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

invalid result of Calendar.getActualMaximum(Calendar.WEEK_OF_MONTH) method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description



      Name: js151677 Date: 06/24/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux potenilla 2.6.5-1.358.8kstacks #1 Sat May 22 21:46:42 EDT 2004 i686 athlon i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      not important in this case

      A DESCRIPTION OF THE PROBLEM :
      For Calendar with week that starts with monday (i.e. locale pl_PL) the method getActualMaximum(WEEK_OF_MONTH) produces invalid result (4) for february 2004.
      This month has 29 days.
      The bug appears in following vm versions:
      1.4.2-b28, 1.4.2_04-b05, 1.5.0-beta2-b51
      in version 1.4.1-b21 the result (5) was correct.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      see the source code


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.util.*;

      public class CalendarTest
      {
          public static void main(String[] argv)
          {
           Calendar calendar = Calendar.getInstance(new Locale("pl", "PL"));
           calendar.set(Calendar.YEAR, 2004);
           calendar.set(Calendar.MONTH, 1);
           System.out.println("vm version: "+ System.getProperty("java.vm.version"));
           System.out.println("current time: "+calendar.getTime());
           System.out.println("weeks in feb 2004: "+
                  calendar.getActualMaximum(Calendar.WEEK_OF_MONTH));
          }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 281290)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                okutsu Masayoshi Okutsu
                Reporter:
                jssunw Jitender S (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: