Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336152 - [compiler] incompatible cast error if "Object" is hidden by an import
Summary: [compiler] incompatible cast error if "Object" is hidden by an import
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.8 M6   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 15:45 EST by Stephan Herrmann CLA
Modified: 2011-06-07 10:38 EDT (History)
0 users

See Also:


Attachments
test (1.72 KB, patch)
2011-02-02 16:02 EST, Stephan Herrmann CLA
no flags Details | Diff
test & fix (5.54 KB, patch)
2011-02-04 15:06 EST, Stephan Herrmann CLA
no flags Details | Diff

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