--- /dev/null
+@AnnotationStringElement(stringval="hello")
+public class AnnotatedClass {
+}
--- /dev/null
+public class AnnotatedFields {
+ @SimpleAnnotation3(id=1) int i;
+
+ @SimpleAnnotation3(id=2) String s;
+}
--- /dev/null
+public class AnnotatedMethods {
+
+ @SimpleAnnotation3(id=1)
+ public void method1() {
+ }
+
+ @SimpleAnnotation3(id=2)
+ public void method2() {
+ }
+}
--- /dev/null
+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) {
+ }
+ }
+
+}
--- /dev/null
+@AnnotationClassElement(clz=Integer.class)
+public class AnnotatedWithClassClass {
+}
--- /dev/null
+@CombinedAnnotation({@SimpleAnnotation(id=4)})
+public class AnnotatedWithCombinedAnnotation {
+}
--- /dev/null
+@AnnotationEnumElement(enumval=SimpleEnum.Red)
+public class AnnotatedWithEnumClass {
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface AnnotationClassElement {
+ Class clz();
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface AnnotationEnumElement {
+ SimpleEnum enumval();
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface AnnotationStringElement {
+ String stringval();
+}
--- /dev/null
+public class AnonymousClassTest {
+
+ public void foo() {
+
+ new Runnable() {
+ public void run() {};
+ }.run();
+
+
+ }
+
+ class X {}
+
+ static class Y {}
+
+}
\ No newline at end of file
--- /dev/null
+import java.util.*;
+
+public aspect AspectFromHell {
+
+ public void Foo.m1() {}
+ public int Foo.m2() {return 2;}
+ public void Foo.m3(String s) {}
+ public Foo.new(String s) {super();}
+ public int Foo.x;
+ public List Foo.y;
+
+
+ before(): execution(void Goo.m1()) {}
+ after(): execution(void Goo.m2(String)) { System.err.println(thisJoinPoint);}
+ void around(int i): execution(void Goo.m3(..)) && args(i) { }
+
+ class Goo {
+ void m1() {}
+ void m2(String s) {}
+ void m3(int i) {}
+ }
+}
+
+ class Foo { }
--- /dev/null
+public class AttributeTestClassEM01 {
+
+ public static void main(String[]argv) {
+ class S {
+ public void sayhello() { System.err.println("hello");}
+ }
+ }
+}
--- /dev/null
+public class AttributeTestClassEM02 {
+
+ Runnable r = new Runnable() {
+ public void run() { System.err.println("hello");}
+ };
+ public static void main(String[]argv) {
+ }
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CombinedAnnotation {
+ public SimpleAnnotation[] value();
+}
--- /dev/null
+// Class contains everything, for delegate comparing..
+
+public class Complex {
+
+ int field1;
+ String field2;
+ Foo[] field3;
+
+
+
+ static class Foo {
+ }
+}
--- /dev/null
+@ComplexAnnotation(ival=4,bval=2,cval='5',fval=3.0f,dval=33.4,zval=false,jval=56,sval=99)
+public class ComplexAnnotatedClass {
+}
--- /dev/null
+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();
+}
--- /dev/null
+import java.util.*;
+
+public class ErasureTestData {
+
+ public Vector<String> getData() { return null; }
+
+}
--- /dev/null
+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);
+ }
+ }
--- /dev/null
+@MarkerAnnotationInvisible
+@MarkerAnnotation
+public class MarkedType {
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MarkerAnnotation { }
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.CLASS)
+public @interface MarkerAnnotationInvisible { }
--- /dev/null
+import java.util.*;
+
+public class PossibleGenericsSigs {
+
+ public void a(List<String> List_String) {}
+
+ public void b(List<Double> List_Double) {}
+
+ public void c(List<? extends Number> q_extends_Number) {}
+
+ public void d(List<? super Number> q_super_Number) {}
+
+ public void e(List<?> List_q) {}
+
+ public void f(Map<?,? super Number> Map_q_q_super_Number) {}
+
+
+
+ <T extends Object & Comparable<? super T>> void r(List<T> l) {}
+
+ <T extends Object & Comparable<? super T>> T s(Collection<T> col) {return null;}
+
+ static <T extends Comparable<? super Number>> T t(Collection<T> col) {return null;}
+
+ static <T extends Comparable<T>> T u(Collection<T> col) {return null;}
+
+ <X> X v(Collection<X> x) {return null;}
+
+ public void w(List<List<List<List<List<? extends List>>>>> wtf) {}
+
+ static <T> void x(List <T> a,List<? extends T> b) {}
+
+ <T extends Number> void y(Map<T,? super Number> n) {}
+
+ static <T> void z(T[] ts,Collection<T> c) {}
+}
--- /dev/null
+Rebuilding?
+
+Just do this:
+
+ajc -1.5 *.java -outjar stuff.jar
--- /dev/null
+@SimpleAnnotation(id=4)
+public class SimpleAnnotatedClass {
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.SOURCE)
+public @interface SimpleAnnotation {
+ int id();
+ String fruit() default "bananas";
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.CLASS)
+public @interface SimpleAnnotation2 {
+ int id();
+ String fruit() default "bananas";
+}
+
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SimpleAnnotation3 {
+ int id();
+ String fruit() default "bananas";
+}
+
--- /dev/null
+import java.lang.annotation.*;
+
+public @interface SimpleAnnotation4 {
+ int id();
+ String fruit() default "bananas";
+}
+
--- /dev/null
+public aspect SimpleAspect {
+ pointcut p(): call(* *(..));
+
+ before(): p() {
+
+ }
+
+ int SimpleAspect.i;
+
+ public void SimpleAspect.m() { }
+
+}
--- /dev/null
+public class SimpleClass {
+ public static void main(String[] argv) {
+ // Nothing unusual in this class
+ }
+}
--- /dev/null
+public enum SimpleEnum { Red,Orange,Yellow,Green,Blue,Indigo,Violet };
--- /dev/null
+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"));
+
+ }
+}
--- /dev/null
+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");
+ }
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SimpleStringAnnotation {
+ String fruit();
+}
--- /dev/null
+class SimpleType {
+ public Integer i;
+
+ public void setI(Integer i) { this.i=i;}
+ public Integer getI() { return i;}
+}
--- /dev/null
+
+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]);
+ }
+ }
+}
--- /dev/null
+public class VarargsClass {
+
+ public void foo(String abc,String... args) { }
+
+ public void goo(String... args) { }
+
+ public void hoo() {}
+
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface VerySimpleAnnotation {
+ int id();
+}