]> source.dussan.org Git - aspectj.git/commitdiff
fix for spacewar, and a much simplified solution for pointcut rewriting of a conjunct...
authoracolyer <acolyer>
Wed, 14 Dec 2005 11:24:16 +0000 (11:24 +0000)
committeracolyer <acolyer>
Wed, 14 Dec 2005 11:24:16 +0000 (11:24 +0000)
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java

index 66a21b84bbabc2eb745276f704ff0037f8f45f51..a488376a29a7f5ca36d0d6c619a8da96ec1d4e61 100644 (file)
@@ -220,7 +220,7 @@ public class AtAjAttributes {
             if (acceptAttribute(attribute)) {
                 RuntimeAnnotations rvs = (RuntimeAnnotations) attribute;
                 // we don't need to look for several attribute occurence since it cannot happen as per JSR175
-                if (!isCodeStyleAspect) {
+                if (!isCodeStyleAspect && !javaClass.isInterface()) {
                     hasAtAspectAnnotation = handleAspectAnnotation(rvs, struct);
                     //TODO AV - if put outside the if isCodeStyleAspect then we would enable mix style
                     hasAtPrecedenceAnnotation = handlePrecedenceAnnotation(rvs, struct);
index 06e62d8a54a71ad833e9bc456cf2cbcc98e60e29..2d70942bf86a3d2f68668d44334813b3c13e3032 100644 (file)
@@ -172,15 +172,19 @@ public class PointcutRewriter {
                                                                        new AndPointcut(left,rightRight))
                                                        );
                        }  else if (isOr(right) && isOr(left)) {
-                               // (A || B) && (C || D) =>  (¬A && B && ¬C && D) || (B && C) || (A && ¬C && D) || (A && ¬B && C)
+                               // (A || B) && (C || D) => (A && C) || (A && D) || (B && C) || (B && D)
                                Pointcut A = pullUpDisjunctions(((OrPointcut)left).getLeft());
                                Pointcut B = pullUpDisjunctions(((OrPointcut)left).getRight());
                                Pointcut C = pullUpDisjunctions(((OrPointcut)right).getLeft());
                                Pointcut D = pullUpDisjunctions(((OrPointcut)right).getRight());
-                               Pointcut newLeft = new OrPointcut(createAndsFor(new Pointcut[]{not(A),B,not(C),D}),
-                                                                         createAndsFor(new Pointcut[]{B,C}));
-                               Pointcut newRight = new OrPointcut(createAndsFor(new Pointcut[]{A,not(C),not(D)}),
-                                                                          createAndsFor(new Pointcut[]{A,not(B),C}));
+                               Pointcut newLeft = new OrPointcut(
+                                                                               new AndPointcut(A,C),
+                                                                               new AndPointcut(A,D)
+                                                                       );
+                               Pointcut newRight = new OrPointcut(
+                                                              new AndPointcut(B,C),
+                                                              new AndPointcut(B,D)
+                                                          );                           
                                return pullUpDisjunctions(new OrPointcut(newLeft,newRight));
                        }       else {
                                return new AndPointcut(left,right);