Community
Participate
Working Groups
The following code reports Unnecessary @SuppressWarnings("unchecked"), what is wrong. Because when @SuppressWarnings is removed, there is this warning: Type safety: Unchecked cast from List<capture#5-of ?> to List<Object> public void test1() { List<List<List<?>>> list = new ArrayList<>(); list.forEach(x -> { x.forEach(y -> { @SuppressWarnings("unchecked") List<Object> l = (List<Object>) y; System.out.println(l); }); }); } So one get a warning in any case.
Thanks, I can reproduce. Additional observations: placing the @SW annotation on the method test1() works as expected -> no warning. Apparently, it's the location of a local variable inside a lambda body that isn't analysed correctly. At a closer look the same problem exists for other problems and @SW tokens, too.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.