]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 209051
authoraclement <aclement>
Thu, 8 Nov 2007 08:59:04 +0000 (08:59 +0000)
committeraclement <aclement>
Thu, 8 Nov 2007 08:59:04 +0000 (08:59 +0000)
tests/bugs154/pr209051/Bug.java [new file with mode: 0644]
tests/bugs154/pr209051/Bug2.java [new file with mode: 0644]

diff --git a/tests/bugs154/pr209051/Bug.java b/tests/bugs154/pr209051/Bug.java
new file mode 100644 (file)
index 0000000..ac1bf7b
--- /dev/null
@@ -0,0 +1,21 @@
+import org.aspectj.lang.annotation.*;
+
+public @Aspect class Bug {
+       @Pointcut("args(i) && if() && within(Foo)")
+       public static boolean pc(int i) {
+               return i < 0;
+       }
+       
+       @Before("pc(*)")
+       public void advice() { System.out.println("advice running");}
+
+  public static void main(String []argv) {
+    new Foo().trigger(-1);
+    new Foo().trigger(+1);
+  }
+}
+
+class Foo {
+  public void trigger(int i) {}
+}
+
diff --git a/tests/bugs154/pr209051/Bug2.java b/tests/bugs154/pr209051/Bug2.java
new file mode 100644 (file)
index 0000000..b37a347
--- /dev/null
@@ -0,0 +1,10 @@
+import org.aspectj.lang.annotation.*;
+
+public aspect Bug2 {
+  pointcut pc(int i): args(i) && if(i<0);
+
+  before(): pc(*) {
+  }
+
+  public void trigger(int i) {}
+}