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

(cal) Infinite recursive loop in sun.util.calendar.ImmutableGregorianDate.getSeconds()

XMLWordPrintable

    • b53
    • sparc
    • solaris_9

      FULL PRODUCT VERSION :
      > java -version
      java version "1.6.0-ea"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b34)
      Java HotSpot(TM) Server VM (build 1.6.0-ea-b34, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      SunOS ceti.umiacs.umd.edu 5.9 gspot:s9u2_beta:07/09/2003 sun4u sparc SUNW,Sun-Fire

      A DESCRIPTION OF THE PROBLEM :
      Build 34 introduced a class sun.util.calendar.ImmutableGregorianDate.

      The getSeconds() method of this class calls itself, resulting in an infinite recursive loop, rather than delegating to the internal Date object.

      I don't have source code, but here is the output of javap for the getSeconds method:

      public int getSeconds();
        Code:
         0: aload_0
         1: invokevirtual #142; //Method getSeconds:()I
         4: ireturn


      This error was found with FindBugs, a static analysis tool for finding errors in Java programs., Sun should use it.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Invoke the method

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It returns a number of seconds
      ACTUAL -
      It throws a StackOverflowError.

      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 2005-05-05 06:53:30 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: