Summary: | "[].length" attribute has null getDeclaringClass() | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Nicolas Anquetil <anquetil.nicolas> | ||||
Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> | ||||
Status: | VERIFIED INVALID | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, srikanth_sankaran | ||||
Version: | 3.7 | ||||||
Target Milestone: | 3.7 M4 | ||||||
Hardware: | Macintosh | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Nicolas Anquetil
2010-11-16 05:13:16 EST
Created attachment 183206 [details]
An Eclipse Java Project exemplifying the bug
As explained in the bug report, this is a Java project that exemplifies the bug.
The sole class is a JDT batch parser that when run on itself (when analyzing its own code) shows that the "length" attribute used in the method "performCompilation()" results in a IVariableBinding that has no DeclaringClass
Probably not significant, but the bug was found on a MacBook Pro (a Macintosh therefore) but running Ubuntu 10.10, not MacOS The compiler usually returns a ProblemBinding in cases where there was a parsing error / invalid construct, etc. It definitely wont return null in such cases. Also, in this case, I'm not sure what else can the compiler return as a binding from getDeclaringClass(). Srikanth, whats your take? This is the expected behavior. See the javadoc on org.eclipse.jdt.core.dom.IVariableBinding.getDeclaringClass() Also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=14322#c3 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=9016#c2 I would also add that you should not use internal code inside your own code. That code can change from release to release. You can easily use DOM/AST API without referring to internal compiler code. |