From 7005a9ab425558c7ff62a893b528748274b5d3b4 Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 14 Dec 2005 11:24:16 +0000 Subject: [PATCH] fix for spacewar, and a much simplified solution for pointcut rewriting of a conjunction of disjunctions --- .../org/aspectj/weaver/bcel/AtAjAttributes.java | 2 +- .../aspectj/weaver/patterns/PointcutRewriter.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 66a21b84b..a488376a2 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -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); diff --git a/weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java b/weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java index 06e62d8a5..2d70942bf 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java +++ b/weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java @@ -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); -- 2.39.5