Bug 343838

Summary: FUP of bug 337962: Desired warning also suppressed
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Ayushman Jain CLA 2011-04-26 09:04:42 EDT
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)
    }
}
Comment 1 Markus Keller CLA 2011-04-26 09:49:03 EDT
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.
Comment 2 Srikanth Sankaran CLA 2011-04-26 10:51:42 EDT
(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.
Comment 3 Ayushman Jain CLA 2011-04-26 11:12:38 EDT
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.
Comment 4 Ayushman Jain CLA 2011-04-26 11:13:02 EDT
Verified for 3.7M7 using build I20110425-1800.