Bug 76359 - [1.5] Unsafe operation not reported while using member type
Summary: [1.5] Unsafe operation not reported while using member type
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 10:32 EDT by Frederic Fusier CLA
Modified: 2004-11-04 11:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2004-10-15 10:32:13 EDT
Using build I20041013.
On following test case, compiler reports only 1 unsafe type operation:
public class G<T> {
	class Member {}
}
class X {
	G<String> g = new G();
	G<String>.Member x = new G().new Member();
}
----------
1. WARNING in D:\usr\OTI\workspaces\dvpt\v31\HEAD\_Bug\G.java (at line 5)
	G<String> g = new G();
	              ^^^^^^^
Unsafe type operation: Should not convert expression of raw type G to type
G<String>. References to generic type G<T> should be parameterized
----------
1 problem (1 warning)

javac reports 2 warnings:
G.java:5: warning: [unchecked] unchecked conversion
found   : G
required: G<java.lang.String>
        G<String> g = new G();
                      ^
G.java:6: warning: [unchecked] unchecked conversion
found   : G.Member
required: G<java.lang.String>.Member
        G<String>.Member x = new G().new Member();
                                     ^
2 warnings
Comment 1 Philipe Mulet CLA 2004-10-29 07:34:03 EDT
Tuned unchecked conversion diagnosis to recurse on enclosing types.
Added regression test: GenericTypeTest#test323.

Fixed.
Comment 2 David Audel CLA 2004-11-04 11:08:44 EST
Verified for 3.1M3 with build I200411040100