aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs186
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2017-09-20 21:34:21 -0700
committerAndy Clement <aclement@pivotal.io>2017-09-20 21:34:21 -0700
commit03752862ba3bc6ef132195673903dcf9109e8b93 (patch)
tree949971954474b167cbcef83fa3161de4c4a4a7c8 /tests/bugs186
parentee99996fb7f727d34a5393374b5661dba1ec9f9f (diff)
parent784906d2ee0cb1b432a9aff6973c12cfd865db6e (diff)
downloadaspectj-03752862ba3bc6ef132195673903dcf9109e8b93.tar.gz
aspectj-03752862ba3bc6ef132195673903dcf9109e8b93.zip
Merged post 1.8.5 changes into Java9 branch
Diffstat (limited to 'tests/bugs186')
-rw-r--r--tests/bugs186/462821/AbstractLoggerAspect.java59
-rw-r--r--tests/bugs186/462821/FooService.java10
-rw-r--r--tests/bugs186/462821/FooServiceLoggerAspect.java23
-rw-r--r--tests/bugs186/462821/java1
-rw-r--r--tests/bugs186/lambdaBeans/Application.java16
-rw-r--r--tests/bugs186/lambdaBeans/Foo.java4
-rw-r--r--tests/bugs186/romain/Code.java3
-rw-r--r--tests/bugs186/romain/Runner1.java5
-rw-r--r--tests/bugs186/romain/Runner2.java5
-rw-r--r--tests/bugs186/romain/SubCode.java2
-rw-r--r--tests/bugs186/romain/X.java3
-rw-r--r--tests/bugs186/romain/code1.jarbin0 -> 964 bytes
-rw-r--r--tests/bugs186/romain/code2.jarbin0 -> 2556 bytes
13 files changed, 131 insertions, 0 deletions
diff --git a/tests/bugs186/462821/AbstractLoggerAspect.java b/tests/bugs186/462821/AbstractLoggerAspect.java
new file mode 100644
index 000000000..5b9e3c14b
--- /dev/null
+++ b/tests/bugs186/462821/AbstractLoggerAspect.java
@@ -0,0 +1,59 @@
+//package no.kantega;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public abstract class AbstractLoggerAspect {
+
+ @Pointcut
+ public abstract void debugJoinPoints();
+
+ @Pointcut
+ public abstract void infoJoinPoints();
+
+ @Pointcut
+ public abstract void excludedJoinPoints();
+
+
+ @Pointcut("execution(public String Object+.toString()) || call(public String Object.toString())"
+ + "|| call(public int Object.hashCode()) || call(public boolean Object.equals())"
+ + "|| execution(public static void Object+.main(String[])) ")
+ public void defaultExcludedJoinPoints() {}
+
+ @Pointcut("(infoJoinPoints() && !defaultExcludedJoinPoints() && !excludedJoinPoints())")
+ public void infoJoinPointsToLog() {}
+
+/*
+ @Pointcut("(debugJoinPoints() && !defaultExcludedJoinPoints() && !infoJoinPointsToLog() && !excludedJoinPoints())")
+ public void debugJoinPointsToLog() {}
+
+
+ @Around("debugJoinPointsToLog()")
+ public Object handleDebugJoinPointsToLog(ProceedingJoinPoint thisJoinPoint)
+ {
+ // do stuff
+ try {
+ return thisJoinPoint.proceed();
+ } catch (Throwable throwable) {
+ throw new RuntimeException("foo");
+ }
+ // then do other stuff
+ }
+*/
+
+ @Around("infoJoinPoints()")
+ public Object handleInfoJoinPointsToLog(ProceedingJoinPoint thisJoinPoint)
+ {
+ // first do stuff
+ try {
+ return thisJoinPoint.proceed();
+ } catch (Throwable throwable) {
+ throw new RuntimeException("foo");
+ }
+ // then do other stuff
+ }
+}
+
diff --git a/tests/bugs186/462821/FooService.java b/tests/bugs186/462821/FooService.java
new file mode 100644
index 000000000..5d9ab18bf
--- /dev/null
+++ b/tests/bugs186/462821/FooService.java
@@ -0,0 +1,10 @@
+//package no.kantega;
+
+public class FooService {
+
+ /** Adviced method */
+ public String doSomething() {
+ return "foo";
+ }
+
+}
diff --git a/tests/bugs186/462821/FooServiceLoggerAspect.java b/tests/bugs186/462821/FooServiceLoggerAspect.java
new file mode 100644
index 000000000..f471694e1
--- /dev/null
+++ b/tests/bugs186/462821/FooServiceLoggerAspect.java
@@ -0,0 +1,23 @@
+//package no.kantega;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public class FooServiceLoggerAspect extends AbstractLoggerAspect {
+
+ @Pointcut
+ @Override
+ public void debugJoinPoints() {
+ }
+
+ @Pointcut("execution(public * FooService.*(..)) && !debugJoinPoints()")
+ @Override
+ public void infoJoinPoints() {
+ }
+
+ @Pointcut
+ @Override
+ public void excludedJoinPoints() {
+ }
+}
diff --git a/tests/bugs186/462821/java b/tests/bugs186/462821/java
new file mode 100644
index 000000000..f1d45a49f
--- /dev/null
+++ b/tests/bugs186/462821/java
@@ -0,0 +1 @@
+[?25l[?12l[?25h[?1049h[?1h=[?12;25h[?12l[?25h[?25l~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ VIM - Vi IMprovedversion 7.3by Bram Moolenaar et al.Vim is open source and freely distributableBecome a registered Vim user!type :help register<Enter> for information type :q<Enter> to exit type :help<Enter> or <F1> for on-line helptype :help version7<Enter> for version infoRunning in Vi compatible modetype :set nocp<Enter> for Vim defaultstype :help cp-default<Enter> for info on this[?12l[?25h[?25lType :quit<Enter> to exit Vim[?12l[?25h[?25l[?12l[?25h \ No newline at end of file
diff --git a/tests/bugs186/lambdaBeans/Application.java b/tests/bugs186/lambdaBeans/Application.java
new file mode 100644
index 000000000..f98a49a5e
--- /dev/null
+++ b/tests/bugs186/lambdaBeans/Application.java
@@ -0,0 +1,16 @@
+public class Application {
+
+ @Foo
+ Runnable fromInnerClass() {
+ return new Runnable() {
+ @Override
+ public void run() {
+ }
+ };
+ }
+
+ @Foo
+ Runnable fromLambdaExpression() {
+ return () -> { };
+ }
+}
diff --git a/tests/bugs186/lambdaBeans/Foo.java b/tests/bugs186/lambdaBeans/Foo.java
new file mode 100644
index 000000000..60e42f6e2
--- /dev/null
+++ b/tests/bugs186/lambdaBeans/Foo.java
@@ -0,0 +1,4 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Foo {}
diff --git a/tests/bugs186/romain/Code.java b/tests/bugs186/romain/Code.java
new file mode 100644
index 000000000..9ae8ed102
--- /dev/null
+++ b/tests/bugs186/romain/Code.java
@@ -0,0 +1,3 @@
+public class Code {
+ public void foo() { System.out.println("foo");}
+}
diff --git a/tests/bugs186/romain/Runner1.java b/tests/bugs186/romain/Runner1.java
new file mode 100644
index 000000000..aa3b23d19
--- /dev/null
+++ b/tests/bugs186/romain/Runner1.java
@@ -0,0 +1,5 @@
+public class Runner1 {
+ public static void main(String[]argv) {
+ new SubCode().foo();
+ }
+}
diff --git a/tests/bugs186/romain/Runner2.java b/tests/bugs186/romain/Runner2.java
new file mode 100644
index 000000000..aa3b23d19
--- /dev/null
+++ b/tests/bugs186/romain/Runner2.java
@@ -0,0 +1,5 @@
+public class Runner1 {
+ public static void main(String[]argv) {
+ new SubCode().foo();
+ }
+}
diff --git a/tests/bugs186/romain/SubCode.java b/tests/bugs186/romain/SubCode.java
new file mode 100644
index 000000000..7136b3fe7
--- /dev/null
+++ b/tests/bugs186/romain/SubCode.java
@@ -0,0 +1,2 @@
+public class SubCode<T> {
+}
diff --git a/tests/bugs186/romain/X.java b/tests/bugs186/romain/X.java
new file mode 100644
index 000000000..d28c3e679
--- /dev/null
+++ b/tests/bugs186/romain/X.java
@@ -0,0 +1,3 @@
+public aspect X {
+ declare parents: SubCode extends Code;
+}
diff --git a/tests/bugs186/romain/code1.jar b/tests/bugs186/romain/code1.jar
new file mode 100644
index 000000000..a35660a3d
--- /dev/null
+++ b/tests/bugs186/romain/code1.jar
Binary files differ
diff --git a/tests/bugs186/romain/code2.jar b/tests/bugs186/romain/code2.jar
new file mode 100644
index 000000000..c4b5ce74e
--- /dev/null
+++ b/tests/bugs186/romain/code2.jar
Binary files differ