Community
Participate
Working Groups
package p; class A{ native void m(int i); } i get an NPE when i call resolveBinding on the declaration of 'i' (the CompilationUnit node was created with resolveBindings == true, if that makes a difference) java.lang.NullPointerException at org.eclipse.jdt.core.dom.DefaultBindingResolver.resolveVariable (DefaultBindingResolver.java:297) at org.eclipse.jdt.core.dom.VariableDeclaration.resolveBinding (VariableDeclaration.java:92)
In this case, I guess you expect null to be returned.
when creating regression tests for it - please include also this one: abstract class A{ abstract void m(int i); }
this one is meybe related (resolveBinding on the SimpleName 'k' inside the qualified name 'j.k'): class A{ int k; static class j{ static int k; } void m(){ int y= 0; j.k= 0; } } stack trace is different: at org.eclipse.jdt.core.dom.DefaultBindingResolver.resolveNameForNameReference (DefaultBindingResolver.java:222) at org.eclipse.jdt.core.dom.DefaultBindingResolver.resolveName (DefaultBindingResolver.java:97) at org.eclipse.jdt.core.dom.Name.resolveBinding(Name.java:75)
another test case for your collection :) (resolveBinding on the declaration of 'i') interface A{ void m(int i, int j); }
I forgot to connect the name inside a SingleVariableDeclaration. So it was impossible to retrieve the compiler node corresponding to a method parameter. Fixed and released in HEAD.
Fixed.