aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/testsrc_j8
diff options
context:
space:
mode:
authorAndy Clement <andrew.clement@gmail.com>2013-05-24 16:49:50 -0700
committerAndy Clement <andrew.clement@gmail.com>2013-05-24 16:49:50 -0700
commit6f4140ac7028b9074e694e4c0b9de8b05e4b048a (patch)
treebc9a38baa25ace5b87042b70a0f310fcf6d0a09f /bcel-builder/testsrc_j8
parent0a01bd478349676a87a6afaa71a77a04de3f27a4 (diff)
downloadaspectj-6f4140ac7028b9074e694e4c0b9de8b05e4b048a.tar.gz
aspectj-6f4140ac7028b9074e694e4c0b9de8b05e4b048a.zip
More java8 support files
Diffstat (limited to 'bcel-builder/testsrc_j8')
-rw-r--r--bcel-builder/testsrc_j8/Anno.java7
-rw-r--r--bcel-builder/testsrc_j8/Intface.java1
-rw-r--r--bcel-builder/testsrc_j8/Intface2.java1
-rw-r--r--bcel-builder/testsrc_j8/Parameters.java13
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameter.java1
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameterBound.java1
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnExceptionParameter.java11
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnField.java9
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnInstanceOf.java11
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnLocalVariable.java7
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnMethodFormalParameter.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnMethodReceiver.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnMethodReturn.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameter.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameterBound.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnNew.java7
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnResourceVariable.java10
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnSuperinterface1.java2
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnSupertypes.java3
-rw-r--r--bcel-builder/testsrc_j8/TypeAnnoOnThrows.java3
-rw-r--r--bcel-builder/testsrc_j8/buildjar.sh1
-rw-r--r--bcel-builder/testsrc_j8/readme.txt2
22 files changed, 105 insertions, 0 deletions
diff --git a/bcel-builder/testsrc_j8/Anno.java b/bcel-builder/testsrc_j8/Anno.java
new file mode 100644
index 000000000..8540df7f6
--- /dev/null
+++ b/bcel-builder/testsrc_j8/Anno.java
@@ -0,0 +1,7 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE_USE)
+@interface Anno {
+ int value() default 0;
+}
diff --git a/bcel-builder/testsrc_j8/Intface.java b/bcel-builder/testsrc_j8/Intface.java
new file mode 100644
index 000000000..25c8c3276
--- /dev/null
+++ b/bcel-builder/testsrc_j8/Intface.java
@@ -0,0 +1 @@
+interface Intface {}
diff --git a/bcel-builder/testsrc_j8/Intface2.java b/bcel-builder/testsrc_j8/Intface2.java
new file mode 100644
index 000000000..d087c08b2
--- /dev/null
+++ b/bcel-builder/testsrc_j8/Intface2.java
@@ -0,0 +1 @@
+interface Intface2 {}
diff --git a/bcel-builder/testsrc_j8/Parameters.java b/bcel-builder/testsrc_j8/Parameters.java
new file mode 100644
index 000000000..660e5abf1
--- /dev/null
+++ b/bcel-builder/testsrc_j8/Parameters.java
@@ -0,0 +1,13 @@
+public class Parameters {
+ public void foo(String abc,int def, String... ghi) {
+ }
+
+ public void bar(Parameters this, String abc) {
+ }
+
+ class Inner {
+ public Inner(String x) {
+ }
+ }
+ enum Color { RED, GREEN, BLUE; }
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameter.java b/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameter.java
new file mode 100644
index 000000000..dab0ddaed
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameter.java
@@ -0,0 +1 @@
+class TypeAnnoOnClassTypeParameter<@Anno T,@Anno(2) Q> { }
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameterBound.java b/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameterBound.java
new file mode 100644
index 000000000..3b87bd591
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnClassTypeParameterBound.java
@@ -0,0 +1 @@
+class TypeAnnoOnClassTypeParameterBound<T extends @Anno String & java.util.@Anno(2) List<@Anno(3) String>> { }
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnExceptionParameter.java b/bcel-builder/testsrc_j8/TypeAnnoOnExceptionParameter.java
new file mode 100644
index 000000000..755d34dd8
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnExceptionParameter.java
@@ -0,0 +1,11 @@
+public class TypeAnnoOnExceptionParameter {
+ class Throwable2 extends Throwable {}
+ class Throwable3 extends Throwable {}
+ public void m() {
+ try {
+ foo();
+ } catch (@Anno Throwable3 | @Anno(99) Throwable2 t) {
+ }
+ }
+ public void foo() throws Throwable2,Throwable3 {}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnField.java b/bcel-builder/testsrc_j8/TypeAnnoOnField.java
new file mode 100644
index 000000000..84c934cfc
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnField.java
@@ -0,0 +1,9 @@
+public class TypeAnnoOnField {
+ @Anno int f1;
+
+ java.util.List<@Anno String> f2;
+
+ java.util.@Anno List[] f3;
+
+ java.util.List<@Anno String>[] f4;
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnInstanceOf.java b/bcel-builder/testsrc_j8/TypeAnnoOnInstanceOf.java
new file mode 100644
index 000000000..a6ae232d7
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnInstanceOf.java
@@ -0,0 +1,11 @@
+public class TypeAnnoOnInstanceOf {
+ public void m() {
+ Object o = "abc";
+ if (o instanceof @Anno(1) String) {
+ String s = (String) o;
+ }
+ if (o instanceof @Anno(1) Integer) {
+ Integer s = (Integer) o;
+ }
+ }
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnLocalVariable.java b/bcel-builder/testsrc_j8/TypeAnnoOnLocalVariable.java
new file mode 100644
index 000000000..32e54eea1
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnLocalVariable.java
@@ -0,0 +1,7 @@
+public class TypeAnnoOnLocalVariable {
+ public void m() {
+ System.out.println("Hello");
+ @Anno String s = "abc";
+ System.out.println(s);
+ }
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnMethodFormalParameter.java b/bcel-builder/testsrc_j8/TypeAnnoOnMethodFormalParameter.java
new file mode 100644
index 000000000..072be669e
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnMethodFormalParameter.java
@@ -0,0 +1,3 @@
+public class TypeAnnoOnMethodFormalParameter {
+ void m(@Anno String s, @Anno(2) int i) {}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnMethodReceiver.java b/bcel-builder/testsrc_j8/TypeAnnoOnMethodReceiver.java
new file mode 100644
index 000000000..724c8ab68
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnMethodReceiver.java
@@ -0,0 +1,3 @@
+public class TypeAnnoOnMethodReceiver {
+ void m(@Anno TypeAnnoOnMethodReceiver this) {}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnMethodReturn.java b/bcel-builder/testsrc_j8/TypeAnnoOnMethodReturn.java
new file mode 100644
index 000000000..15b0a4a11
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnMethodReturn.java
@@ -0,0 +1,3 @@
+public class TypeAnnoOnMethodReturn {
+ @Anno String m() {return null;}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameter.java b/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameter.java
new file mode 100644
index 000000000..471a806e2
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameter.java
@@ -0,0 +1,3 @@
+class TypeAnnoOnMethodTypeParameter {
+ <@Anno T> void m() {}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameterBound.java b/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameterBound.java
new file mode 100644
index 000000000..fb73b42ce
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnMethodTypeParameterBound.java
@@ -0,0 +1,3 @@
+class TypeAnnoOnMethodTypeParameterBound {
+ <T extends @Anno String & java.util.@Anno(2) Map<Integer, @Anno(3) String>> void m() {}
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnNew.java b/bcel-builder/testsrc_j8/TypeAnnoOnNew.java
new file mode 100644
index 000000000..4d2e4e853
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnNew.java
@@ -0,0 +1,7 @@
+public class TypeAnnoOnNew {
+ public void m() {
+ Object o = new @Anno String();
+ Object o2= new @Anno(2) String[1];
+ Object o3 = new @Anno(3) int @Anno(4)[3][3];
+ }
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnResourceVariable.java b/bcel-builder/testsrc_j8/TypeAnnoOnResourceVariable.java
new file mode 100644
index 000000000..3104cfae3
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnResourceVariable.java
@@ -0,0 +1,10 @@
+import java.io.*;
+
+public class TypeAnnoOnResourceVariable {
+ public void m() throws Exception {
+ try (@Anno BufferedReader br1 = new BufferedReader(new FileReader("a"));
+ @Anno(99) BufferedReader br2 = new BufferedReader(new FileReader("b"))) {
+ System.out.println(br1.readLine()+br2.readLine());
+ }
+ }
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnSuperinterface1.java b/bcel-builder/testsrc_j8/TypeAnnoOnSuperinterface1.java
new file mode 100644
index 000000000..7d0f04a19
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnSuperinterface1.java
@@ -0,0 +1,2 @@
+class TypeAnnoOnSuperinterface1 implements @Anno Intface {
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnSupertypes.java b/bcel-builder/testsrc_j8/TypeAnnoOnSupertypes.java
new file mode 100644
index 000000000..702e38562
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnSupertypes.java
@@ -0,0 +1,3 @@
+
+class TypeAnnoOnSupertypes extends @Anno(1) Object implements @Anno Intface, @Anno(2) Intface2 {
+}
diff --git a/bcel-builder/testsrc_j8/TypeAnnoOnThrows.java b/bcel-builder/testsrc_j8/TypeAnnoOnThrows.java
new file mode 100644
index 000000000..113a7a51a
--- /dev/null
+++ b/bcel-builder/testsrc_j8/TypeAnnoOnThrows.java
@@ -0,0 +1,3 @@
+public class TypeAnnoOnThrows {
+ void m() throws @Anno Exception, @Anno(2) Throwable {}
+}
diff --git a/bcel-builder/testsrc_j8/buildjar.sh b/bcel-builder/testsrc_j8/buildjar.sh
new file mode 100644
index 000000000..5358b2513
--- /dev/null
+++ b/bcel-builder/testsrc_j8/buildjar.sh
@@ -0,0 +1 @@
+jar -cvMf ../testdata/java8testcode.jar *.class
diff --git a/bcel-builder/testsrc_j8/readme.txt b/bcel-builder/testsrc_j8/readme.txt
new file mode 100644
index 000000000..4005b02e0
--- /dev/null
+++ b/bcel-builder/testsrc_j8/readme.txt
@@ -0,0 +1,2 @@
+Notes:
+- build Parameters.java with -parameters option