aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs180
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2013-07-29 11:19:02 -0700
committerAndy Clement <andrew.clement@gmail.com>2013-07-29 12:05:09 -0700
commit38206a5304739c5e986c26e71186b74db0a5af5b (patch)
tree5da23736fef0e082b37eeee4e21342ebd0e590bc /tests/bugs180
parent302c14ee680d5782cba619d8cc748e60afd09561 (diff)
downloadaspectj-38206a5304739c5e986c26e71186b74db0a5af5b.tar.gz
aspectj-38206a5304739c5e986c26e71186b74db0a5af5b.zip
AspectJ 1.8
Diffstat (limited to 'tests/bugs180')
-rw-r--r--tests/bugs180/firstprogram/C.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/bugs180/firstprogram/C.java b/tests/bugs180/firstprogram/C.java
new file mode 100644
index 000000000..b300f9153
--- /dev/null
+++ b/tests/bugs180/firstprogram/C.java
@@ -0,0 +1,45 @@
+import java.util.Arrays;
+
+
+interface I {
+ // Default method
+ default void foo() {
+ System.out.println("ABC");
+ }
+}
+
+public class C implements I{
+ public static void main(String[] args) {
+ new C().foo();
+ // Lambda
+ Runnable r = () -> { System.out.println("hello world!"); };
+ r.run();
+ // Used Java8 b97
+ Arrays.asList(MyClass.doSomething()).forEach((p) -> System.out.println(p));
+ }
+}
+
+aspect X {
+before(): execution(* I.foo()) {
+ System.out.println("I.foo running");
+}
+before(): staticinitialization(!X) {
+System.out.println("Clazz "+thisJoinPointStaticPart);
+}
+}
+
+
+class Utils {
+ public static int compareByLength(String in, String out) {
+ return in.length() - out.length();
+ }
+}
+
+class MyClass {
+ public static String[] doSomething() {
+ String []args = new String[]{"4444","333","22","1"};
+ // Method reference
+ Arrays.sort(args,Utils::compareByLength);
+ return args;
+ }
+}