diff options
Diffstat (limited to 'tests/features153/pipelining/annotations')
3 files changed, 81 insertions, 0 deletions
diff --git a/tests/features153/pipelining/annotations/AnAspect.java b/tests/features153/pipelining/annotations/AnAspect.java new file mode 100644 index 000000000..2b3d6eefe --- /dev/null +++ b/tests/features153/pipelining/annotations/AnAspect.java @@ -0,0 +1,15 @@ +import java.lang.annotation.*; + +public aspect AnAspect { + + declare @type: Foo: @SimpleAnnotation(id=5); // one type in an array + + + declare @type: Foo: @AnnotationClassElement(clz=Integer.class); // one type not in an array + + + before(): call(* (@SimpleAnnotation *).m(..)) { + } + +// declare @type: Foo: @AnnotationStringElement(stringval="www"); // two types in an array +} diff --git a/tests/features153/pipelining/annotations/DecoratedClass.java b/tests/features153/pipelining/annotations/DecoratedClass.java new file mode 100644 index 000000000..769c72f19 --- /dev/null +++ b/tests/features153/pipelining/annotations/DecoratedClass.java @@ -0,0 +1,61 @@ +// Use all the variants of annotations - to exercise the +// eclipse transform code in EclipseSourceType + +import java.lang.annotation.*; + +@AnnotationStringElement(stringval="hello") +@SimpleAnnotation(id=1) +@AnnotationClassElement(clz=Integer.class) +@CombinedAnnotation({@SimpleAnnotation(id=4)}) +@AnnotationEnumElement(enumval=SimpleEnum.Red) +@ComplexAnnotation(ival=4,bval=2,cval='5',fval=3.0f,dval=33.4,zval=false,jval=56,sval=99) +public class DecoratedClass { +public void m() {} + +} + +@Target(value={ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@interface SimpleAnnotation { + int id(); + String fruit() default "bananas"; +} +enum SimpleEnum { Red,Orange,Yellow,Green,Blue,Indigo,Violet }; + +@Retention(RetentionPolicy.RUNTIME) +@interface SimpleStringAnnotation { + String fruit(); +} + + +@Target({ElementType.TYPE,ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@interface AnnotationClassElement { + Class clz(); +} + +@Retention(RetentionPolicy.RUNTIME) +@interface AnnotationEnumElement { + SimpleEnum enumval(); +} +@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@interface AnnotationStringElement { + String stringval(); +} +@Retention(RetentionPolicy.RUNTIME) +@interface CombinedAnnotation { + SimpleAnnotation[] value(); +} +@Retention(RetentionPolicy.RUNTIME) +@interface ComplexAnnotation { + int ival(); + byte bval(); + char cval(); + long jval(); + double dval(); + boolean zval(); + short sval(); + float fval(); +} + diff --git a/tests/features153/pipelining/annotations/Foo.java b/tests/features153/pipelining/annotations/Foo.java new file mode 100644 index 000000000..a7d68dd35 --- /dev/null +++ b/tests/features153/pipelining/annotations/Foo.java @@ -0,0 +1,5 @@ +public class Foo { + public static void main(String []argv) { + new DecoratedClass().m(); + } +} |