]> source.dussan.org Git - aspectj.git/commitdiff
239649
authoraclement <aclement>
Fri, 12 Aug 2011 17:39:57 +0000 (17:39 +0000)
committeraclement <aclement>
Fri, 12 Aug 2011 17:39:57 +0000 (17:39 +0000)
15 files changed:
tests/bugs1612/pr239649/Eight.java [new file with mode: 0644]
tests/bugs1612/pr239649/Eleven.java [new file with mode: 0644]
tests/bugs1612/pr239649/Fifteen.java [new file with mode: 0644]
tests/bugs1612/pr239649/Five.java [new file with mode: 0644]
tests/bugs1612/pr239649/Four.java [new file with mode: 0644]
tests/bugs1612/pr239649/Fourteen.java [new file with mode: 0644]
tests/bugs1612/pr239649/Nine.java [new file with mode: 0644]
tests/bugs1612/pr239649/One.java [new file with mode: 0644]
tests/bugs1612/pr239649/Seven.java [new file with mode: 0644]
tests/bugs1612/pr239649/Six.java [new file with mode: 0644]
tests/bugs1612/pr239649/Ten.java [new file with mode: 0644]
tests/bugs1612/pr239649/Thirteen.java [new file with mode: 0644]
tests/bugs1612/pr239649/Three.java [new file with mode: 0644]
tests/bugs1612/pr239649/Twelve.java [new file with mode: 0644]
tests/bugs1612/pr239649/Two.java [new file with mode: 0644]

diff --git a/tests/bugs1612/pr239649/Eight.java b/tests/bugs1612/pr239649/Eight.java
new file mode 100644 (file)
index 0000000..5103f72
--- /dev/null
@@ -0,0 +1,27 @@
+public class Eight {
+  public static void main(String[] argv) {
+    Eight a = new Eight();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+abstract aspect Y {
+  abstract pointcut p();
+  before(): execution(* m(..))  && p() {
+    System.out.println("In advice()");
+  }
+}
+
+aspect X extends Y {
+  pointcut p(): if(thisAspectInstance.doit());
+
+  boolean doit() {
+    System.out.println("in doit(): class="+this.getClass().getName());
+    return true;
+  }
+
+}
diff --git a/tests/bugs1612/pr239649/Eleven.java b/tests/bugs1612/pr239649/Eleven.java
new file mode 100644 (file)
index 0000000..fc771f4
--- /dev/null
@@ -0,0 +1,22 @@
+public class Eleven {
+  public static void main(String[] argv) {
+    Eleven a = new Eleven();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X perthis(this(Eleven)) {
+
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before():execution(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice()");
+  }
+}
diff --git a/tests/bugs1612/pr239649/Fifteen.java b/tests/bugs1612/pr239649/Fifteen.java
new file mode 100644 (file)
index 0000000..304b3a3
--- /dev/null
@@ -0,0 +1,25 @@
+public class Fifteen {
+  public static void main(String[] argv) {
+    Fifteen a = new Fifteen();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+abstract aspect Y {
+  abstract pointcut p();
+  before(): if(thisAspectInstance.doit()) && p() {
+    System.out.println("In advice()");
+  }
+  boolean doit() {
+    System.out.println("in doit(): class="+this.getClass().getName());
+    return true;
+  }
+}
+
+aspect X extends Y {
+  pointcut p(): execution(* m(..));
+}
diff --git a/tests/bugs1612/pr239649/Five.java b/tests/bugs1612/pr239649/Five.java
new file mode 100644 (file)
index 0000000..80b8d21
--- /dev/null
@@ -0,0 +1,21 @@
+public class Five {
+  public static void main(String[] argv) {
+    Five a = new Five();
+    a.m("abc");
+  }
+
+  public void m(String s) {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before():execution(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice() arg0="+thisJoinPoint.getArgs()[0]);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Four.java b/tests/bugs1612/pr239649/Four.java
new file mode 100644 (file)
index 0000000..bcf7e66
--- /dev/null
@@ -0,0 +1,21 @@
+public class Four {
+  public static void main(String[] argv) {
+    Four a = new Four();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before():execution(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice() "+thisJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Fourteen.java b/tests/bugs1612/pr239649/Fourteen.java
new file mode 100644 (file)
index 0000000..0b157bd
--- /dev/null
@@ -0,0 +1,22 @@
+public class Fourteen {
+  public static void main(String[] argv) {
+    Fourteen a = new Fourteen();
+    a.m("abc");
+  }
+
+  public void m(String s) {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+
+  static boolean printit(Object o) {
+    System.out.println("instance is "+o.getClass().getName());
+return true;
+  }
+
+  before(String s):args(s) && execution(* m(..))  && if(printit(thisAspectInstance)) && if(thisJoinPointStaticPart.toString().indexOf("Fourteen")!=-1) { 
+    System.out.println("In advice() arg="+s+" tjpsp="+thisJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Nine.java b/tests/bugs1612/pr239649/Nine.java
new file mode 100644 (file)
index 0000000..05d4c88
--- /dev/null
@@ -0,0 +1,25 @@
+public class Nine {
+  public static void main(String[] argv) {
+    Nine a = new Nine();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+abstract aspect Y {
+  abstract pointcut p();
+  before(): execution(* m(..))  && p() {
+    System.out.println("In advice()");
+  }
+  boolean doit() {
+    System.out.println("in doit(): class="+this.getClass().getName());
+    return true;
+  }
+}
+
+aspect X extends Y {
+  pointcut p(): if(thisAspectInstance.doit());
+}
diff --git a/tests/bugs1612/pr239649/One.java b/tests/bugs1612/pr239649/One.java
new file mode 100644 (file)
index 0000000..c35d5af
--- /dev/null
@@ -0,0 +1,21 @@
+public class One {
+  public static void main(String[] argv) {
+    One a = new One();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before():execution(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice()");
+  }
+}
diff --git a/tests/bugs1612/pr239649/Seven.java b/tests/bugs1612/pr239649/Seven.java
new file mode 100644 (file)
index 0000000..782a272
--- /dev/null
@@ -0,0 +1,21 @@
+public class Seven {
+  public static void main(String[] argv) {
+    Seven a = new Seven();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before(): call(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice() "+thisJoinPoint+" "+thisEnclosingJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Six.java b/tests/bugs1612/pr239649/Six.java
new file mode 100644 (file)
index 0000000..f2c46b3
--- /dev/null
@@ -0,0 +1,21 @@
+public class Six {
+  public static void main(String[] argv) {
+    Six a = new Six();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before():call(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice() "+thisEnclosingJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Ten.java b/tests/bugs1612/pr239649/Ten.java
new file mode 100644 (file)
index 0000000..bd7f4fd
--- /dev/null
@@ -0,0 +1,23 @@
+package com.foo.bar;
+
+public class Ten {
+  public static void main(String[] argv) {
+    Ten a = new Ten();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  boolean doit() {
+    System.out.println("In instance check method doit() class="+this.getClass().getName());
+    return true;
+  }
+
+  before():execution(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice()");
+  }
+}
diff --git a/tests/bugs1612/pr239649/Thirteen.java b/tests/bugs1612/pr239649/Thirteen.java
new file mode 100644 (file)
index 0000000..aa18dc0
--- /dev/null
@@ -0,0 +1,22 @@
+public class Thirteen {
+  public static void main(String[] argv) {
+    Thirteen a = new Thirteen();
+    a.m("abc");
+  }
+
+  public void m(String s) {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+
+  static boolean printit(Object o) {
+    System.out.println("instance is "+o.getClass().getName());
+return true;
+  }
+
+  before(String s):args(s) && execution(* m(..))  && if(printit(thisAspectInstance)){ 
+    System.out.println("In advice() arg="+s+" tjpsp="+thisJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Three.java b/tests/bugs1612/pr239649/Three.java
new file mode 100644 (file)
index 0000000..144902e
--- /dev/null
@@ -0,0 +1,27 @@
+public class Three {
+  public static void main(String[] argv) {
+    Three a = new Three();
+    a.m();
+    a.m();
+    a.m();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  int count = 0;
+
+  boolean doit() {
+    count++;
+    System.out.println("In instance check method, count="+count+" so doit returns "+((count%2)==0));
+    return (count%2)==0;
+  }
+
+  after():call(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice()");
+  }
+}
diff --git a/tests/bugs1612/pr239649/Twelve.java b/tests/bugs1612/pr239649/Twelve.java
new file mode 100644 (file)
index 0000000..8e3989b
--- /dev/null
@@ -0,0 +1,22 @@
+public class Twelve {
+  public static void main(String[] argv) {
+    Twelve a = new Twelve();
+    a.m("abc");
+  }
+
+  public void m(String s) {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+
+  boolean doit() {
+    System.out.println("In instance check method doit()");
+    return true;
+  }
+
+  before(String s):execution(* m(..))  && if(thisAspectInstance.doit()) && args(s) { 
+    System.out.println("In advice() arg="+s+" tjpsp="+thisJoinPointStaticPart);
+  }
+}
diff --git a/tests/bugs1612/pr239649/Two.java b/tests/bugs1612/pr239649/Two.java
new file mode 100644 (file)
index 0000000..5d4414e
--- /dev/null
@@ -0,0 +1,27 @@
+public class Two {
+  public static void main(String[] argv) {
+    Two a = new Two();
+    a.m();
+    a.m();
+    a.m();
+    a.m();
+  }
+
+  public void m() {
+    System.out.println("Method m() running");
+  }
+}
+
+aspect X {
+  int count = 0;
+
+  boolean doit() {
+    count++;
+    System.out.println("In instance check method, count="+count+" so doit returns "+((count%2)==0));
+    return (count%2)==0;
+  }
+
+  before():call(* m(..))  && if(thisAspectInstance.doit()){ 
+    System.out.println("In advice()");
+  }
+}