Community
Participate
Working Groups
I20110425-1800. The original case reported in bug 337962, when split in 2 separate CU's (one for Super and one for Subclass), and the JavaCore.COMPILER_PB_UNAVOIDABLE_GENERIC_TYPE_PROBLEMS turned on, suppresses the second valid warning on fSubList. This should not be suppressed. Having both classes in same CU gives the correct behaviour package problems; import java.util.List; public class Super { protected List fList; } package problems; import java.util.List; public class Subclass extends Super { protected List fSubList; void foo(String s) { fList.add(s); // type safety warning hidden(good) fSubList.add(s); // type safety warning hidden(bad, should not be hidden) } }
I can't reproduce the problem. I do get a type safety warning on "fSubList.add(s)", no matter whether Super is in its own file or in the Subclass's CU.
(In reply to comment #1) > I can't reproduce the problem. I do get a type safety warning on > "fSubList.add(s)", no matter whether Super is in its own file or in the > Subclass's CU. I get it too. Ayush, can you please double check ? Thanks.
Sorry, i just noticed I that the declaration of fSubList had changed to protected List<String> fSubList; Ofcourse, thats why there isn't any warning. I guess I must've exercised the infer generic type quick fix somehow. False alarm. Closing as INVALID.
Verified for 3.7M7 using build I20110425-1800.