import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
//!!! understand and fix this case later
receiverType = ref.otherBindings[0].declaringClass;
}
-
- for (int i=0, len=ref.otherBindings.length; i < len; i++) {
+ boolean cont = true; // don't continue if we come across a problem
+ for (int i=0, len=ref.otherBindings.length; i < len && cont; i++) {
FieldBinding binding = ref.otherBindings[i];
ref.otherBindings[i] = getAccessibleField(binding, receiverType);
- receiverType = binding.type;
+ if (!(binding instanceof ProblemFieldBinding)) receiverType = binding.type;
+ else cont=false;
}
}
}
--- /dev/null
+package a;
+
+public class A {
+ public void x(){}
+}
--- /dev/null
+package a;
+public aspect B {
+ void around():call(void *(..)){
+ A a = new A();
+ a.A.a.x(); // This line raises the NPE
+ proceed();
+ }
+}
--- /dev/null
+@Aspect
+public class TestEmptyPointcutAtAspect {
+
+ @Pointcut("")
+ protected void scope () {}
+}
public void testCallInheritedGenericMethod_pr124999() { runTest("calling inherited generic method from around advice");}
public void testIncorrectlyReferencingPointcuts_pr122452() { runTest("incorrectly referencing pointcuts");}
public void testIncorrectlyReferencingPointcuts_pr122452_2() { runTest("incorrectly referencing pointcuts - 2");}
+ //public void testEmptyPointcut_pr125475() { runTest("empty pointcut in atAJ");}
+ public void testInlinevisitorNPE_pr123901() { runTest("inlinevisitor NPE");}
public void testMixingNumbersOfTypeParameters_pr125080() {
runTest("mixing numbers of type parameters");
<ajc-test dir="bugs151" title="member types in generic types">
<compile files="pr122458.aj" options="-1.5 -emacssym"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs151/pr123901" title="inlinevisitor NPE">
+ <compile files="A.java,B.java" options="-1.5">
+ <message kind="error" line="5" text="a.A cannot be resolved or is not a field"/>
+ </compile>
</ajc-test>
<ajc-test dir="bugs151" title="member types in generic types - 2">
<compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/>
</ajc-test>
+ <ajc-test dir="bugs151/pr125475" title="empty pointcut in atAJ">
+ <compile files="TestEmptyPointcutAtAspect.java" options="-1.5"/>
+ </ajc-test>
+
</suite>
\ No newline at end of file