]> source.dussan.org Git - aspectj.git/commitdiff
185447: fixed: abstract annotation style pointcut resolution
authoraclement <aclement>
Mon, 1 Dec 2008 21:00:43 +0000 (21:00 +0000)
committeraclement <aclement>
Mon, 1 Dec 2008 21:00:43 +0000 (21:00 +0000)
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java

index 7d5a7cf18220f69b08cdde819bf6dd8d462fc978..be2bc45e87c738eee44f6d1ad47599e74eeb09ee 100644 (file)
@@ -1510,7 +1510,7 @@ public class AtAjAttributes {
         * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
         */
        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);
                        }
index 6035eee39dfeebf3a6b148dab48a699b4a3f0668..2f9db1d699407520d7a9b94710f608686de771e5 100644 (file)
@@ -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();
                                }