diff options
author | aclement <aclement> | 2004-11-19 16:52:30 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-11-19 16:52:30 +0000 |
commit | 4345b4b36f5b29b0b6783cb1985a52157c1ce3f5 (patch) | |
tree | 93d002a93f076e26c85fcdd4bd623247a9d47087 /bcel-builder/testdata | |
parent | 1ad46c857bb676ff7237b9b6519b2db3563efb66 (diff) | |
download | aspectj-4345b4b36f5b29b0b6783cb1985a52157c1ce3f5.tar.gz aspectj-4345b4b36f5b29b0b6783cb1985a52157c1ce3f5.zip |
BCEL Java5 Support
Diffstat (limited to 'bcel-builder/testdata')
29 files changed, 216 insertions, 0 deletions
diff --git a/bcel-builder/testdata/AnnotatedClass.java b/bcel-builder/testdata/AnnotatedClass.java new file mode 100644 index 000000000..033d2e8e5 --- /dev/null +++ b/bcel-builder/testdata/AnnotatedClass.java @@ -0,0 +1,3 @@ +@AnnotationStringElement(stringval="hello") +public class AnnotatedClass { +} diff --git a/bcel-builder/testdata/AnnotatedFields.java b/bcel-builder/testdata/AnnotatedFields.java new file mode 100644 index 000000000..97fba870a --- /dev/null +++ b/bcel-builder/testdata/AnnotatedFields.java @@ -0,0 +1,5 @@ +public class AnnotatedFields { + @SimpleAnnotation(id=1) int i; + + @SimpleAnnotation(id=2) String s; +} diff --git a/bcel-builder/testdata/AnnotatedMethods.java b/bcel-builder/testdata/AnnotatedMethods.java new file mode 100644 index 000000000..ed1ff3c63 --- /dev/null +++ b/bcel-builder/testdata/AnnotatedMethods.java @@ -0,0 +1,10 @@ +public class AnnotatedMethods { + + @SimpleAnnotation(id=1) + public void method1() { + } + + @SimpleAnnotation(id=2) + public void method2() { + } +} diff --git a/bcel-builder/testdata/AnnotatedParameters.java b/bcel-builder/testdata/AnnotatedParameters.java new file mode 100644 index 000000000..9cfb2b80b --- /dev/null +++ b/bcel-builder/testdata/AnnotatedParameters.java @@ -0,0 +1,15 @@ +public class AnnotatedParameters { + + + public static void main(@SimpleAnnotation(id=1) String args[]) { + } + + public void foo(@SimpleAnnotation(id=2) int arg1, + @SimpleAnnotation(id=3) @AnnotationEnumElement(enumval=SimpleEnum.Red) String arg2) { + try { + throw new RuntimeException("eee"); + } catch (@SimpleAnnotation(id=5) Exception ex) { + } + } + +} diff --git a/bcel-builder/testdata/AnnotatedWithClassClass.java b/bcel-builder/testdata/AnnotatedWithClassClass.java new file mode 100644 index 000000000..a9dc32138 --- /dev/null +++ b/bcel-builder/testdata/AnnotatedWithClassClass.java @@ -0,0 +1,3 @@ +@AnnotationClassElement(clz=Integer.class) +public class AnnotatedWithClassClass { +} diff --git a/bcel-builder/testdata/AnnotatedWithCombinedAnnotation.java b/bcel-builder/testdata/AnnotatedWithCombinedAnnotation.java new file mode 100644 index 000000000..c63e6bcaf --- /dev/null +++ b/bcel-builder/testdata/AnnotatedWithCombinedAnnotation.java @@ -0,0 +1,3 @@ +@CombinedAnnotation({@SimpleAnnotation(id=4)}) +public class AnnotatedWithCombinedAnnotation { +} diff --git a/bcel-builder/testdata/AnnotatedWithEnumClass.java b/bcel-builder/testdata/AnnotatedWithEnumClass.java new file mode 100644 index 000000000..5f532ff6b --- /dev/null +++ b/bcel-builder/testdata/AnnotatedWithEnumClass.java @@ -0,0 +1,3 @@ +@AnnotationEnumElement(enumval=SimpleEnum.Red) +public class AnnotatedWithEnumClass { +} diff --git a/bcel-builder/testdata/AnnotationClassElement.java b/bcel-builder/testdata/AnnotationClassElement.java new file mode 100644 index 000000000..629bd2155 --- /dev/null +++ b/bcel-builder/testdata/AnnotationClassElement.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface AnnotationClassElement { + Class clz(); +} diff --git a/bcel-builder/testdata/AnnotationEnumElement.java b/bcel-builder/testdata/AnnotationEnumElement.java new file mode 100644 index 000000000..201b34ad2 --- /dev/null +++ b/bcel-builder/testdata/AnnotationEnumElement.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface AnnotationEnumElement { + SimpleEnum enumval(); +} diff --git a/bcel-builder/testdata/AnnotationStringElement.java b/bcel-builder/testdata/AnnotationStringElement.java new file mode 100644 index 000000000..dc68cf2e9 --- /dev/null +++ b/bcel-builder/testdata/AnnotationStringElement.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface AnnotationStringElement { + String stringval(); +} diff --git a/bcel-builder/testdata/AttributeTestClassEM01.java b/bcel-builder/testdata/AttributeTestClassEM01.java new file mode 100644 index 000000000..e8bb5c7f5 --- /dev/null +++ b/bcel-builder/testdata/AttributeTestClassEM01.java @@ -0,0 +1,8 @@ +public class AttributeTestClassEM01 { + + public static void main(String[]argv) { + class S { + public void sayhello() { System.err.println("hello");} + } + } +} diff --git a/bcel-builder/testdata/AttributeTestClassEM02.java b/bcel-builder/testdata/AttributeTestClassEM02.java new file mode 100644 index 000000000..b152854a6 --- /dev/null +++ b/bcel-builder/testdata/AttributeTestClassEM02.java @@ -0,0 +1,8 @@ +public class AttributeTestClassEM02 { + + Runnable r = new Runnable() { + public void run() { System.err.println("hello");} + }; + public static void main(String[]argv) { + } +} diff --git a/bcel-builder/testdata/CombinedAnnotation.java b/bcel-builder/testdata/CombinedAnnotation.java new file mode 100644 index 000000000..a262c868f --- /dev/null +++ b/bcel-builder/testdata/CombinedAnnotation.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CombinedAnnotation { + public SimpleAnnotation[] value(); +} diff --git a/bcel-builder/testdata/ComplexAnnotatedClass.java b/bcel-builder/testdata/ComplexAnnotatedClass.java new file mode 100644 index 000000000..155e531d0 --- /dev/null +++ b/bcel-builder/testdata/ComplexAnnotatedClass.java @@ -0,0 +1,3 @@ +@ComplexAnnotation(ival=4,bval=2,cval=5,fval=3.0f,dval=33.4,zval=false,jval=56,sval=99) +public class ComplexAnnotatedClass { +} diff --git a/bcel-builder/testdata/ComplexAnnotation.java b/bcel-builder/testdata/ComplexAnnotation.java new file mode 100644 index 000000000..c5a76c71e --- /dev/null +++ b/bcel-builder/testdata/ComplexAnnotation.java @@ -0,0 +1,13 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface ComplexAnnotation { + int ival(); + byte bval(); + char cval(); + long jval(); + double dval(); + boolean zval(); + short sval(); + float fval(); +} diff --git a/bcel-builder/testdata/HelloWorld.java b/bcel-builder/testdata/HelloWorld.java new file mode 100644 index 000000000..9146fed8c --- /dev/null +++ b/bcel-builder/testdata/HelloWorld.java @@ -0,0 +1,14 @@ +import java.io.*; + +public class HelloWorld { + public static void main(String[] argv) { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + String name = null; + + try { + System.out.print("Please enter your name> "); + name = in.readLine(); + } catch(IOException e) { return; } + System.out.println("Hello, " + name); + } + } diff --git a/bcel-builder/testdata/SimpleAnnotatedClass.java b/bcel-builder/testdata/SimpleAnnotatedClass.java new file mode 100644 index 000000000..8d4e4ac95 --- /dev/null +++ b/bcel-builder/testdata/SimpleAnnotatedClass.java @@ -0,0 +1,3 @@ +@SimpleAnnotation(id=4) +public class SimpleAnnotatedClass { +} diff --git a/bcel-builder/testdata/SimpleAnnotation.java b/bcel-builder/testdata/SimpleAnnotation.java new file mode 100644 index 000000000..5b4303755 --- /dev/null +++ b/bcel-builder/testdata/SimpleAnnotation.java @@ -0,0 +1,7 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface SimpleAnnotation { + int id(); + String fruit() default "bananas"; +} diff --git a/bcel-builder/testdata/SimpleClass.java b/bcel-builder/testdata/SimpleClass.java new file mode 100644 index 000000000..9920c4912 --- /dev/null +++ b/bcel-builder/testdata/SimpleClass.java @@ -0,0 +1,5 @@ +public class SimpleClass { + public static void main(String[] argv) { + // Nothing unusual in this class + } +} diff --git a/bcel-builder/testdata/SimpleEnum.java b/bcel-builder/testdata/SimpleEnum.java new file mode 100644 index 000000000..2df536880 --- /dev/null +++ b/bcel-builder/testdata/SimpleEnum.java @@ -0,0 +1 @@ +public enum SimpleEnum { Red,Orange,Yellow,Green,Blue,Indigo,Violet }; diff --git a/bcel-builder/testdata/SimpleGenericsProgram.java b/bcel-builder/testdata/SimpleGenericsProgram.java new file mode 100644 index 000000000..2457a9155 --- /dev/null +++ b/bcel-builder/testdata/SimpleGenericsProgram.java @@ -0,0 +1,26 @@ +import java.util.*; + +class TreasureChest<T> { + + protected Set<T> contents; + + public TreasureChest() { + contents = new HashSet<T>(); + } + + public void add(T o) { + contents.add(o); + } +} + +public class SimpleGenericsProgram { + + public static void main(String []argv) { + TreasureChest<String> tc1 = new TreasureChest<String>(); + TreasureChest<Integer> tc2 = new TreasureChest<Integer>(); + + tc1.add("dubloon"); + tc2.add(new Integer("777")); + + } +} diff --git a/bcel-builder/testdata/SimpleGenericsUsage.java b/bcel-builder/testdata/SimpleGenericsUsage.java new file mode 100644 index 000000000..74a8df574 --- /dev/null +++ b/bcel-builder/testdata/SimpleGenericsUsage.java @@ -0,0 +1,12 @@ +import java.util.*; + +public class SimpleGenericsUsage { + + public static void main(String[]argv) { + ArrayList<String> fruits = new ArrayList<String>(); + fruits.add("Oranges"); + fruits.add("Apples"); + fruits.add("Pears"); + System.err.println(fruits.size()+" fruits defined"); + } +} diff --git a/bcel-builder/testdata/SimpleStringAnnotation.java b/bcel-builder/testdata/SimpleStringAnnotation.java new file mode 100644 index 000000000..af3b5ce36 --- /dev/null +++ b/bcel-builder/testdata/SimpleStringAnnotation.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface SimpleStringAnnotation { + String fruit(); +} diff --git a/bcel-builder/testdata/SimpleType.java b/bcel-builder/testdata/SimpleType.java new file mode 100644 index 000000000..2b0563bba --- /dev/null +++ b/bcel-builder/testdata/SimpleType.java @@ -0,0 +1,6 @@ +class SimpleType { + public Integer i; + + public void setI(Integer i) { this.i=i;} + public Integer getI() { return i;} +} diff --git a/bcel-builder/testdata/SimpleVarargs.java b/bcel-builder/testdata/SimpleVarargs.java new file mode 100644 index 000000000..3994d2cfb --- /dev/null +++ b/bcel-builder/testdata/SimpleVarargs.java @@ -0,0 +1,12 @@ + +public class SimpleVarargs { + public static void main(String[] argv) { + callfoo("a","b","c","d","e"); + } + + public static void callfoo(Object... args) { + for (int i = 0 ; i<args.length;i++) { + System.err.println(args[i]); + } + } +} diff --git a/bcel-builder/testdata/VarargsClass.java b/bcel-builder/testdata/VarargsClass.java new file mode 100644 index 000000000..c50e45e92 --- /dev/null +++ b/bcel-builder/testdata/VarargsClass.java @@ -0,0 +1,9 @@ +public class VarargsClass { + + public void foo(String abc,String... args) { } + + public void goo(String... args) { } + + public void hoo() {} + +} diff --git a/bcel-builder/testdata/VerySimpleAnnotation.java b/bcel-builder/testdata/VerySimpleAnnotation.java new file mode 100644 index 000000000..375ab3cbf --- /dev/null +++ b/bcel-builder/testdata/VerySimpleAnnotation.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface VerySimpleAnnotation { + int id(); +} diff --git a/bcel-builder/testdata/build.xml b/bcel-builder/testdata/build.xml new file mode 100644 index 000000000..6c3543eda --- /dev/null +++ b/bcel-builder/testdata/build.xml @@ -0,0 +1,11 @@ +<project name="Java 5 compilation of covariance test source" default="default" basedir="."> + + <target name="default"> + <delete dir="output" failonerror="false"/> + <mkdir dir="output"/> + <javac destdir="output" debug="on" srcdir="." includes="*.java"/> + <zip file="testcode.jar" basedir="output" includes="*"/> + <delete dir="output"/> + </target> + +</project> diff --git a/bcel-builder/testdata/testcode.jar b/bcel-builder/testdata/testcode.jar Binary files differnew file mode 100644 index 000000000..cbfaa1a2d --- /dev/null +++ b/bcel-builder/testdata/testcode.jar |