Community
Participate
Working Groups
BETA_JAVA7 Test: ----- List<Integer> m() { HashMap<String, ArrayList<Integer>> field= new HashMap<>(); return (ArrayList<?>)field.get(0); } Hover on the warning on field.get(0), it shows a message : Type mismatch: cannot convert from ArrayList<capture#1-of ?> to List<Integer> It does not make sense. Should show a more meaningful message . The message comes from jdt-core, need to investigate.
This has always been the case ever since 1.5 came out. Even javac has the same error message.
It's an error, not a warning, and it's not on "field.get(0)". It's on the whole CastExpression "(ArrayList<?>)field.get(0)", and there it is fine.
Verified.