Summary: | The warning "Indirect access to static member" sometimes reports wrong hits | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Sebastian Dietrich <Sebastian.Dietrich> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED INVALID | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann | ||||
Version: | 3.7 | ||||||
Target Milestone: | 3.7 M3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Sebastian Dietrich
2010-10-06 10:01:04 EDT
Could you please provide a short test case that exhibits this issue? Thanks. Attached you'll find a newly created eclipse project with the class as defined in "steps to reproduce" Created attachment 180523 [details]
eclipse project to show the bug
In your test case: The first method resolves to: com.google.gwt.user.client.Element.as(com.google.gwt.dom.client.Node) : com.google.gwt.dom.client.Element And the second one resolves to: com.google.gwt.dom.client.Element.as(com.google.gwt.dom.client.Node) : com.google.gwt.dom.client.Element So these are two different methods. The first Element.as(null) points to the class com.google.gwt.user.client.Element. This class inherits from com.google.gwt.dom.client.Element that defines as method as(..). So it is right that the static method is not access directly. In the second case, you are directly accessing the static method and in this case you don't get a warning. Therefore I am closing as INVALID. This works as expected. Yes - sorry, you are absolutely right. Invalid - works as expected Verified for 3.7M3 |