Community
Participate
Working Groups
package p; class A{ void m(){ final int j= 0; A a= new A(){ void m(int j){ int u= j; } }; } } i have SimpleName ('j' in the int u= j declaration) in hand i call resolveBinding and get a VariableBinding on the CompilationUnit (root of all nodes) i call findDeclaringNode on that binding null is returned - i expected the SingleVariableDeclaration from the MethodDeclaration (m)
You are right. You should get the declaration of 'j' in the method declaration. I will fix it today.
I hope you mean that you want the single variable declaration of 'j' in 'void m(int j){' and not the 'final int j = 0'. I am working on it.
yes, argument j in declaration of void m(int j)
My test case is: [ package test0311; public class Test { void m(){ final int j= 0; A a= new A(){ void m(int j){ int u= j; } }; } } ] and I don't get null when I ask for the declaring node of the binding I retrieve from the name 'j'. I don't have the right node, but I don't get null. Which version are you using?
Oops, I had to change A in Test in the test case. Now I got null.
The initial problem is fixed, but I need to find out why I could resolve bindings with a compiler error.
*** Bug 11659 has been marked as a duplicate of this bug. ***
Fixed and resolved in HEAD.