summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2006-03-06 16:09:23 +0000
committeraclement <aclement>2006-03-06 16:09:23 +0000
commit05a0983973f48f9cbea5720b3bb277aca437288f (patch)
tree51407247201664add9f31b15ba966bb11f4fb666 /weaver
parentd7424a46cd2dc56a52d3556b7247f07b6e9379d6 (diff)
downloadaspectj-05a0983973f48f9cbea5720b3bb277aca437288f.tar.gz
aspectj-05a0983973f48f9cbea5720b3bb277aca437288f.zip
129163: first part: changed comparison code to ignore ajc$/hasaspect/aspectof in AjState - modified type mungers (not finished) to indicate whether they are related to shadow munging or not.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/NameMangler.java5
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java3
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java3
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java16
5 files changed, 28 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/NameMangler.java b/weaver/src/org/aspectj/weaver/NameMangler.java
index 4dfd751b9..7337305bc 100644
--- a/weaver/src/org/aspectj/weaver/NameMangler.java
+++ b/weaver/src/org/aspectj/weaver/NameMangler.java
@@ -20,9 +20,12 @@ public class NameMangler {
private NameMangler() {
throw new RuntimeException("static");
}
-
+ public static final char[] AJC_DOLLAR_PREFIX = {'a', 'j', 'c','$'};
public static final String PREFIX = "ajc$";
public static final String ITD_PREFIX = PREFIX + "interType$";
+ public static final char[] METHOD_ASPECTOF = {'a', 's', 'p','e','c','t','O','f'};
+ public static final char[] METHOD_HASASPECT = {'h', 'a', 's','A','s','p','e','c','t'};
+ public static final char[] STATIC_INITIALIZER = {'<', 'c', 'l','i','n','i','t','>'};
public static final String CFLOW_STACK_TYPE = "org.aspectj.runtime.internal.CFlowStack";
public static final String CFLOW_COUNTER_TYPE="org.aspectj.runtime.internal.CFlowCounter";
diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java b/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java
index 5891b9bc8..927b174be 100644
--- a/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java
@@ -406,4 +406,6 @@ public abstract class ResolvedTypeMunger {
public boolean isLateMunger() {
return false;
}
+
+
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java b/weaver/src/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java
index 08bb03e87..671e10faa 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java
@@ -85,5 +85,8 @@ public class BcelCflowCounterFieldAdder extends BcelTypeMunger {
public boolean matches(ResolvedType onType) {
return onType.equals(cflowCounterField.getDeclaringType());
}
+ public boolean existsToSupportShadowMunging() {
+ return true;
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java b/weaver/src/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java
index 2ed447ac4..df9725ac2 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java
@@ -74,5 +74,8 @@ public class BcelCflowStackFieldAdder extends BcelTypeMunger {
public boolean matches(ResolvedType onType) {
return onType.equals(cflowStackField.getDeclaringType());
}
+ public boolean existsToSupportShadowMunging() {
+ return true;
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index e291cc3e3..156525993 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -1644,5 +1644,21 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
public List /*String*/ getTypeVariableAliases() {
return munger.getTypeVariableAliases();
}
+
+ /**
+ * Some type mungers are created purely to help with the implementation of shadow mungers.
+ * For example to support the cflow() pointcut we create a new cflow field in the aspect, and
+ * that is added via a BcelCflowCounterFieldAdder.
+ *
+ * During compilation we need to compare sets of type mungers, and if some only come into
+ * existence after the 'shadowy' type things have been processed, we need to ignore
+ * them during the comparison.
+ *
+ * Returning true from this method indicates the type munger exists to support 'shadowy' stuff -
+ * and so can be ignored in some comparison.
+ */
+ public boolean existsToSupportShadowMunging() {
+ return false; // Does this need to delegate to the ResolvedTypeMunger field held in the BcelTypeMunger?
+ }
}
\ No newline at end of file