JDK-6904536 : Generics support broken in Java 7-b40
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic,windows_7
  • CPU: generic,x86
  • Submitted: 2009-11-24
  • Updated: 2011-01-13
  • Resolved: 2010-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
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.

Comments
EVALUATION javac is behaving according to the JLS. See also 6558551, 6711619 and related JLS issue 6644562.
18-08-2010