-
Bug
-
Resolution: Fixed
-
P3
-
7
Please see the following mini test (JCK tests use the similar code pattern):
---------------------------------------------------------
import java.util.EnumMap;
enum Suit {
CLUBS, DIAMONDS;
}
public class minitest {
static Object [] array = {
Suit.CLUBS, "value1",
Suit.DIAMONDS, "value2"
};
public static void main(String[] args) {
EnumMap map = new EnumMap(Suit.class);
map.put(array[0], array[1]);
}
}
---------------------------------------------------------
It compiles on JDK b54, and fails on 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
---------------------------------------------------------
Could you please clarify is this behavior correct ?
---------------------------------------------------------
import java.util.EnumMap;
enum Suit {
CLUBS, DIAMONDS;
}
public class minitest {
static Object [] array = {
Suit.CLUBS, "value1",
Suit.DIAMONDS, "value2"
};
public static void main(String[] args) {
EnumMap map = new EnumMap(Suit.class);
map.put(array[0], array[1]);
}
}
---------------------------------------------------------
It compiles on JDK b54, and fails on 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
---------------------------------------------------------
Could you please clarify is this behavior correct ?
- duplicates
-
JDK-6835568 api/java_util/EnumMap compilation failures
- Closed
- relates to
-
JDK-6400189 raw types and inference
- Closed