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

Generics support broken in Java 7-b40

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 7
    • 7
    • tools
    • b40
    • 7
    • generic, x86
    • generic, windows_7

      OPERATING SYSTEM
      ----------------
      All

      FULL JDK VERSION
      ----------------
      Starting with 7-b40
      Reproduced with 7-b73. Problem introduced somewhere between b18 and b47. Does not occur with any Java 6 release.

      DESCRIPTION
      -----------
      The testcase given here is based on java/lang/Enum.java, which cannot be compiled with the Java 7 compiler due to the error shown below.

      I have tested with the builds available to me, and the failure does not occur with b18, but does occur with b47. I do not have any builds between these two so I can't narrow it down any further.

      REPRODUCTION INSTRUCTIONS
      -------------------------
      1. Run "javac Enum.java"
      2. Observe the compilation error:

      ==================
      Enum.java:9: ordinal has private access in Enum
                      return ordinal - o.ordinal;
                                        ^
      1 error
      ==================

      TESTCASE SOURCE
      ---------------
      ==================
      public abstract class Enum<E extends Enum<E>> {
          private final int ordinal = 10;

          public final int compareTo(E o) {
              return ordinal - o.ordinal;
          }
      }
      ==================

      Release Regression From : 6
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

            mcimadamore Maurizio Cimadamore
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: