aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin4042633 -> 4304369 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin4617987 -> 4926268 bytes
-rw-r--r--tests/java5/ataspectj/annotationGen/BasicAdvice.aj10
-rw-r--r--tests/java5/ataspectj/annotationGen/Deow.aj19
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjAnnotationGenTests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml6
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150-tests.xml2
-rw-r--r--weaver/src/org/aspectj/weaver/NameMangler.java2
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/Declare.java4
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java3
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareParents.java3
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java3
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java4
13 files changed, 50 insertions, 10 deletions
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index 8fd676cb9..677ca8e63 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
index 00a7d2a1c..7b6f208c3 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
Binary files differ
diff --git a/tests/java5/ataspectj/annotationGen/BasicAdvice.aj b/tests/java5/ataspectj/annotationGen/BasicAdvice.aj
index 04fb00be7..1f485f382 100644
--- a/tests/java5/ataspectj/annotationGen/BasicAdvice.aj
+++ b/tests/java5/ataspectj/annotationGen/BasicAdvice.aj
@@ -67,19 +67,19 @@ public aspect BasicAdvice {
}
private static void checkBefore(Method method) {
- assertTrue("expecting 2 annotations",method.getAnnotations().length == 2);
+ assertTrue("expecting 2 annotations on before",method.getAnnotations().length == 2);
Before beforeAnnotation = method.getAnnotation(Before.class);
assertTrue("expecting execution(* *.*(..))",beforeAnnotation.value().equals("execution(* *.*(..))"));
}
private static void checkAfter(Method method) {
- assertTrue("expecting 2 annotations",method.getAnnotations().length == 2);
+ assertTrue("expecting 2 annotations on after",method.getAnnotations().length == 2);
After afterAnnotation = method.getAnnotation(After.class);
assertTrue("expecting call(* Integer.*(..))",afterAnnotation.value().equals("call(* Integer.*(..))"));
}
private static void checkAfterReturning(Method method) {
- assertTrue("expecting 2 annotations",method.getAnnotations().length == 2);
+ assertTrue("expecting 2 annotations on after returning",method.getAnnotations().length == 2);
AfterReturning afterAnnotation = method.getAnnotation(AfterReturning.class);
if (method.getParameterTypes().length == 1) {
// form with returning arg
@@ -95,7 +95,7 @@ public aspect BasicAdvice {
}
private static void checkAfterThrowing(Method method) {
- assertTrue("expecting 2 annotations",method.getAnnotations().length == 2);
+ assertTrue("expecting 2 annotations on after throwing",method.getAnnotations().length == 2);
AfterThrowing afterAnnotation = method.getAnnotation(AfterThrowing.class);
if (method.getParameterTypes().length == 1) {
// form with returning arg
@@ -111,7 +111,7 @@ public aspect BasicAdvice {
}
private static void checkAround(Method method) {
- assertTrue("expecting 2 annotations",method.getAnnotations().length == 2);
+ assertTrue("expecting 2 annotations on around",method.getAnnotations().length == 2);
Around aroundAnnotation = method.getAnnotation(Around.class);
assertTrue("expecting set(* foo)",aroundAnnotation.value().equals("set(* foo)"));
}
diff --git a/tests/java5/ataspectj/annotationGen/Deow.aj b/tests/java5/ataspectj/annotationGen/Deow.aj
new file mode 100644
index 000000000..8a50e33e3
--- /dev/null
+++ b/tests/java5/ataspectj/annotationGen/Deow.aj
@@ -0,0 +1,19 @@
+import org.aspectj.lang.reflect.*;
+
+public aspect Deow {
+
+ declare warning : call(* System.*(..)) : "dont call system methods";
+ declare error : call(* System.*(..)) : "dont call system methods";
+
+ public static void main(String[] args) {
+ AjType myType = AjTypeSystem.getAjType(Deow.class);
+ DeclareErrorOrWarning[] deows = myType.getDeclareErrorOrWarnings();
+ if (deows.length != 2) throw new RuntimeException("Excepting 2 deows, got: " + deows.length);
+ if (deows[0].isError()) throw new RuntimeException("Expecting a warning");
+ if (!deows[1].isError()) throw new RuntimeException("Expecting an error");
+ if (!deows[0].getMessage().equals("dont call system methods")) throw new RuntimeException("Bad message");
+ if (!deows[1].getMessage().equals("dont call system methods")) throw new RuntimeException("Bad message");
+ if (!deows[0].getPointcutExpression().equals("call(* java.lang.System.*(..))")) throw new RuntimeException("Bad pc: " + deows[0].getPointcutExpression());
+ if (!deows[1].getPointcutExpression().equals("call(* java.lang.System.*(..))")) throw new RuntimeException("Bad pc: " + deows[0].getPointcutExpression());
+ }
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjAnnotationGenTests.java b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjAnnotationGenTests.java
index 9004bf9bf..005210080 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjAnnotationGenTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjAnnotationGenTests.java
@@ -122,5 +122,9 @@ public class AtAjAnnotationGenTests extends XMLBasedAjcTestCase {
public void testAdviceDeclaredInClass() {
runTest("advice in a class");
}
+
+ public void testDeows() {
+ runTest("ann gen for deows");
+ }
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml
index c975b0d5e..87ad89307 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml
@@ -137,4 +137,10 @@
</compile>
</ajc-test>
+ <ajc-test dir="java5/ataspectj/annotationGen" title="ann gen for deows">
+ <compile files="Deow.aj" options="-1.5">
+ </compile>
+ <run class="Deow"/>
+ </ajc-test>
+
</suite> \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150-tests.xml
index 87c0be982..c426dbaa6 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150-tests.xml
@@ -205,4 +205,4 @@
<message kind="error" line="6" text="Advice must be declared inside an aspect type"/>
</compile>
</ajc-test>
- \ No newline at end of file
+
diff --git a/weaver/src/org/aspectj/weaver/NameMangler.java b/weaver/src/org/aspectj/weaver/NameMangler.java
index 1888faef8..0ff633952 100644
--- a/weaver/src/org/aspectj/weaver/NameMangler.java
+++ b/weaver/src/org/aspectj/weaver/NameMangler.java
@@ -22,7 +22,7 @@ public class NameMangler {
}
public static final String PREFIX = "ajc$";
-
+ public static final String ITD_PREFIX = PREFIX + "interType$";
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/patterns/Declare.java b/weaver/src/org/aspectj/weaver/patterns/Declare.java
index 76b1dd686..a387c6fc1 100644
--- a/weaver/src/org/aspectj/weaver/patterns/Declare.java
+++ b/weaver/src/org/aspectj/weaver/patterns/Declare.java
@@ -63,7 +63,5 @@ public abstract class Declare extends PatternNode {
* this 'getNameSuffix()' method - depending on whether, at weave time, we
* want to easily differentiate between the declare methods.
*/
- public String getNameSuffix() {
- return "";
- }
+ public abstract String getNameSuffix();
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java b/weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java
index 33321dd73..a3bebe50c 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java
@@ -98,4 +98,7 @@ public class DeclareErrorOrWarning extends Declare {
return true;
}
+ public String getNameSuffix() {
+ return "eow";
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
index a6bbe0af1..3607afe7d 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
@@ -245,4 +245,7 @@ public class DeclareParents extends Declare {
return ret;
}
+ public String getNameSuffix() {
+ return "parents";
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java b/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java
index 02f59df48..0bc548c8c 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java
@@ -148,4 +148,7 @@ public class DeclarePrecedence extends Declare {
return false;
}
+ public String getNameSuffix() {
+ return "precedence";
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
index 74e27e2f1..a7bb8fade 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
@@ -109,4 +109,8 @@ public class DeclareSoft extends Declare {
public boolean isAdviceLike() {
return true;
}
+
+ public String getNameSuffix() {
+ return "soft";
+ }
}