JDK-6835568 : api/java_util/EnumMap compilation failures
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2009-04-29
  • Updated: 2012-03-22
  • Resolved: 2009-06-17
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 :  
Description
The tests on java.util.EnumMap use the following code pattern:
---------------------------------------------------------
    Object [] array = {
        Suit.CLUBS, null,
        Suit.DIAMONDS, "val1",
        Suit.HEARTS, "val2",
        Suit.SPADES, new Integer(1)
    };
    ...
    EnumMap map = new EnumMap(Suit.class);
    ...
    for (int j = 0; j < i; j += 2) {
        map.put(array[j], array[j + 1]); // *
    }
---------------------------------------------------------

The line marked (*) cause compilation error since JDK7 b55 with the output:
---------------------------------------------------------
minitest.java:15: cannot find symbol
        map.put(array[0], array[1]);
           ^
  symbol:   method put(java.lang.Object,java.lang.Object)
  location: class java.util.EnumMap
---------------------------------------------------------