From 120b47fd215b25f2c3cd7e977a93c206e8a2281a Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 1 Dec 2008 21:00:43 +0000 Subject: [PATCH] 185447: fixed: abstract annotation style pointcut resolution --- weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java | 4 ++-- .../src/org/aspectj/weaver/model/AsmRelationshipProvider.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 7d5a7cf18..be2bc45e8 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -1510,7 +1510,7 @@ public class AtAjAttributes { * @author Alexandre Vasseur */ public static class LazyResolvedPointcutDefinition extends ResolvedPointcutDefinition { - private final Pointcut m_pointcutUnresolved; + private final Pointcut m_pointcutUnresolved; // null for abstract pointcut private final IScope m_binding; private Pointcut m_lazyPointcut = null; @@ -1523,7 +1523,7 @@ public class AtAjAttributes { } public Pointcut getPointcut() { - if (m_lazyPointcut == null) { + if (m_lazyPointcut == null && m_pointcutUnresolved != null) { m_lazyPointcut = m_pointcutUnresolved.resolve(m_binding); m_lazyPointcut.copyLocationFrom(m_pointcutUnresolved); } diff --git a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java index 6035eee39..2f9db1d69 100644 --- a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java +++ b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java @@ -39,6 +39,7 @@ import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; +import org.aspectj.weaver.patterns.Pointcut; public class AsmRelationshipProvider { @@ -282,7 +283,8 @@ public class AsmRelationshipProvider { ResolvedMember pcd = children[i]; if (pcd instanceof ResolvedPointcutDefinition) { ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pcd; - ISourceLocation sLoc = rpcd.getPointcut().getSourceLocation(); + Pointcut p = rpcd.getPointcut(); + ISourceLocation sLoc = (p == null ? null : p.getSourceLocation()); if (sLoc == null) { sLoc = rpcd.getSourceLocation(); } -- 2.39.5