Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336152

Summary: [compiler] incompatible cast error if "Object" is hidden by an import
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.8   
Target Milestone: 0.8 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
test
none
test & fix none

Description Stephan Herrmann CLA 2011-02-02 15:45:07 EST
In a team class that imports a type foo.bar.Object a mysterious error
 "Cannot cast Class<T> to Object"
is reported against the team class (position is the class header).


Simple workaround until this is fixed: do not import any type of name "Object"
but always use its fully qualified name.
Comment 1 Stephan Herrmann CLA 2011-02-02 16:02:55 EST
Created attachment 188192 [details]
test

Test case witnessing the issue.
Comment 2 Stephan Herrmann CLA 2011-02-04 15:06:30 EST
Created attachment 188363 [details]
test & fix

The fix is to internally use the qualified name even for java.lang.Object
inside synthetic code (here: reflection methods).
Comment 3 Stephan Herrmann CLA 2011-02-04 15:08:18 EST
Committed as r1289, r1290.
Comment 4 Stephan Herrmann CLA 2011-06-07 10:38:40 EDT
Verified using build 201106070730.