Project: AspectJ
Bug 140357 NPE or StackOverflow when resolving reference pointcut in ReflectionWorld
Reported: 2006-05-05 09:43:03 | Status: resolved fixed

Given a type such as : private static class NamedPointcutResolution { @Pointcut("execution(* *(..))") public void a() {} @Pointcut("this(org.aspectj.weaver.tools.Java15PointcutExpressionTest.A)") public void b() {} @Pointcut("a() && b()") public void c() {} } The reflection based delegate is unable to resolve the pointcut c() failing with either (1) an NPE, or (2) a StackOverflow, depending on the order of the pointcut definitions in the type. The problem occurs because in resolving "c()" we get all the pointcuts in the type, which gets a(), b(), and c(), and tries to resolve them...

Files changed in fix:
weaver/src/org/aspectj/weaver/tools/PointcutParser.java weaver5/java5-src/org/aspectj/weaver/reflect/DeferredResolvedPointcutDefinition.java weaver5/java5-src/org/aspectj/weaver/reflect/InternalUseOnlyPointcutParser.java weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java