Bug 343838 - FUP of bug 337962: Desired warning also suppressed
Summary: FUP of bug 337962: Desired warning also suppressed
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 09:04 EDT by Ayushman Jain CLA
Modified: 2011-04-26 11:13 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.