renamed all modules
This commit is contained in:
9
testdata/src/main/java/annos/AnnotatedType.java
vendored
Normal file
9
testdata/src/main/java/annos/AnnotatedType.java
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
package annos;
|
||||
|
||||
@SimpleAnnotation
|
||||
public class AnnotatedType {
|
||||
|
||||
public static void printit() {
|
||||
System.out.println(AnnotatedType.class.getAnnotation(SimpleAnnotation.class));
|
||||
}
|
||||
}
|
||||
9
testdata/src/main/java/annos/AnnotatedType2.java
vendored
Normal file
9
testdata/src/main/java/annos/AnnotatedType2.java
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
package annos;
|
||||
|
||||
@SimpleAnnotation
|
||||
public class AnnotatedType2 {
|
||||
|
||||
public static void printit() {
|
||||
System.out.println(">>" + AnnotatedType2.class.getAnnotation(SimpleAnnotation.class));
|
||||
}
|
||||
}
|
||||
8
testdata/src/main/java/annos/Foo2.java
vendored
Normal file
8
testdata/src/main/java/annos/Foo2.java
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
package annos;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
||||
@Documented
|
||||
public @interface Foo2 {
|
||||
|
||||
}
|
||||
26
testdata/src/main/java/annos/Play.java
vendored
Normal file
26
testdata/src/main/java/annos/Play.java
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package annos;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Play {
|
||||
|
||||
public void run() throws Exception {
|
||||
new Play().doit();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new Play().doit();
|
||||
}
|
||||
|
||||
public void doit() throws Exception {
|
||||
Class<?> clazz = Documented.class;
|
||||
System.out.println(clazz.getName());
|
||||
Method m = clazz.getMethod("annotationType");
|
||||
Documented d = Foo2.class.getAnnotation(Documented.class);
|
||||
System.out.println(m);
|
||||
System.out.println(d);
|
||||
System.out.println(m.getDeclaringClass().getName());
|
||||
}
|
||||
}
|
||||
// TODO $Proxy0 in the case I'm investigating is the impl of jlaDocumented.
|
||||
24
testdata/src/main/java/annos/Play2.java
vendored
Normal file
24
testdata/src/main/java/annos/Play2.java
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package annos;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
||||
// TODO [important] need to promote these to public so that the executor can see them!
|
||||
@Documented
|
||||
@interface Foo {
|
||||
}
|
||||
|
||||
public class Play2 {
|
||||
|
||||
public void run() {
|
||||
new Play2().doit();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Play2().doit();
|
||||
}
|
||||
|
||||
public void doit() {
|
||||
Documented d = Foo.class.getAnnotation(Documented.class);
|
||||
System.out.println(d.annotationType());
|
||||
}
|
||||
}
|
||||
9
testdata/src/main/java/annos/SimpleAnnotation.java
vendored
Normal file
9
testdata/src/main/java/annos/SimpleAnnotation.java
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
package annos;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SimpleAnnotation {
|
||||
String value() default "hello";
|
||||
}
|
||||
11
testdata/src/main/java/annos/SimpleAnnotation2.java
vendored
Normal file
11
testdata/src/main/java/annos/SimpleAnnotation2.java
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package annos;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SimpleAnnotation2 {
|
||||
String value() default "hello";
|
||||
|
||||
int number() default 42;
|
||||
}
|
||||
Reference in New Issue
Block a user