summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2008-10-21 15:25:26 +0000
committeraclement <aclement>2008-10-21 15:25:26 +0000
commit2395fc9e8f1b0b4a5fe9c15861d5afb5d8bd9858 (patch)
tree2f3e9266e76220b576e62709bf715dfff7021155 /weaver
parent9a159ec17b32405981587472a7965ba0fc5de581 (diff)
downloadaspectj-2395fc9e8f1b0b4a5fe9c15861d5afb5d8bd9858.tar.gz
aspectj-2395fc9e8f1b0b4a5fe9c15861d5afb5d8bd9858.zip
246125: move dependencies on bcel out of org.aspectj.weaver.ast org.aspectj.weaver.patterns
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/PoliceExtensionUse.java (renamed from weaver/src/org/aspectj/weaver/bcel/PoliceExtensionUse.java)4
-rw-r--r--weaver/src/org/aspectj/weaver/ast/Var.java24
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java7
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/Pointcut.java2
4 files changed, 22 insertions, 15 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/PoliceExtensionUse.java b/weaver/src/org/aspectj/weaver/PoliceExtensionUse.java
index 5323c77f6..e35a9b8a3 100644
--- a/weaver/src/org/aspectj/weaver/bcel/PoliceExtensionUse.java
+++ b/weaver/src/org/aspectj/weaver/PoliceExtensionUse.java
@@ -8,12 +8,10 @@
* Contributors:
* Andy Clement - initial API and implementation
*******************************************************************************/
-package org.aspectj.weaver.bcel;
+package org.aspectj.weaver;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.MessageUtil;
-import org.aspectj.weaver.Shadow;
-import org.aspectj.weaver.World;
import org.aspectj.weaver.patterns.AbstractPatternNodeVisitor;
import org.aspectj.weaver.patterns.AndPointcut;
import org.aspectj.weaver.patterns.KindedPointcut;
diff --git a/weaver/src/org/aspectj/weaver/ast/Var.java b/weaver/src/org/aspectj/weaver/ast/Var.java
index 3b2450d16..230cfeac6 100644
--- a/weaver/src/org/aspectj/weaver/ast/Var.java
+++ b/weaver/src/org/aspectj/weaver/ast/Var.java
@@ -10,7 +10,6 @@
* PARC initial implementation
* ******************************************************************/
-
package org.aspectj.weaver.ast;
import org.aspectj.weaver.ResolvedType;
@@ -20,9 +19,9 @@ public class Var extends Expr {
public Var(ResolvedType variableType) {
super();
- this.variableType = variableType;
+ this.variableType = variableType;
}
-
+
public ResolvedType getType() {
return variableType;
}
@@ -30,8 +29,19 @@ public class Var extends Expr {
public String toString() {
return "(Var " + variableType + ")";
}
-
- public void accept(IExprVisitor v) {
- v.visit(this);
- }
+
+ public void accept(IExprVisitor v) {
+ v.visit(this);
+ }
+
+ /**
+ * For an annotation this will return a variable that can access a specific field of the annotation (of the specified type) TODO
+ * what kind of behaviour happens for two annotation fields of the same type?
+ *
+ * @param formalType
+ * @return
+ */
+ public Var getAccessorForValue(ResolvedType formalType) {
+ throw new IllegalStateException("Only makes sense for annotation variables");
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java b/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
index 028fbc776..184615b6a 100644
--- a/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
@@ -23,6 +23,7 @@ import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AjcMemberMaker;
import org.aspectj.weaver.AnnotatedElement;
import org.aspectj.weaver.BCException;
+import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.IntMap;
import org.aspectj.weaver.Member;
@@ -39,8 +40,6 @@ import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
-import org.aspectj.weaver.bcel.AnnotationAccessVar;
-import org.aspectj.weaver.bcel.BcelTypeMunger;
/**
* (at)Annotation((at)Foo) or (at)Annotation(foo)<br>
@@ -139,7 +138,7 @@ public class AnnotationPointcut extends NameBindingPointcut {
// FIXME asc should include supers with getInterTypeMungersIncludingSupers ?
List mungers = rMember.getDeclaringType().resolve(shadow.getIWorld()).getInterTypeMungers();
for (Iterator iter = mungers.iterator(); iter.hasNext();) {
- BcelTypeMunger typeMunger = (BcelTypeMunger) iter.next();
+ ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) iter.next();
if (typeMunger.getMunger() instanceof NewFieldTypeMunger) {
ResolvedMember fakerm = typeMunger.getSignature();
if (fakerm.equals(member)) {
@@ -209,7 +208,7 @@ public class AnnotationPointcut extends NameBindingPointcut {
UnresolvedType annoType = btp.getAnnotationType();
// TODO 2 need to sort out appropriate creation of the AnnotationAccessFieldVar - what happens for
// reflective (ReflectionShadow) access to types?
- AnnotationAccessVar var = (AnnotationAccessVar) shadow.getKindedAnnotationVar(annoType);
+ Var var = shadow.getKindedAnnotationVar(annoType);
if (var == null) {
throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'");
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/Pointcut.java b/weaver/src/org/aspectj/weaver/patterns/Pointcut.java
index 424d623f4..784b3df17 100644
--- a/weaver/src/org/aspectj/weaver/patterns/Pointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/Pointcut.java
@@ -25,6 +25,7 @@ import org.aspectj.weaver.BCException;
import org.aspectj.weaver.Checker;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.IntMap;
+import org.aspectj.weaver.PoliceExtensionUse;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.ShadowMunger;
@@ -32,7 +33,6 @@ import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
-import org.aspectj.weaver.bcel.PoliceExtensionUse;
/**
* The lifecycle of Pointcuts is modeled by Pointcut.State. It has three things: