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

Generics support broken in Java 7-b40

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Build:
      b40
    • Introduced In Version:
      7
    • CPU:
      generic, x86
    • OS:
      generic, windows_7

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: