aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test5
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2015-01-06 01:17:34 +0900
committerchibash <chiba@javassist.org>2015-01-06 01:17:34 +0900
commitec3afdfb5d58b98ae8091d59f84d0d2f7f97a725 (patch)
treef1b1544f83f34fba403281e09c0a32a520286214 /src/test/test5
parentf2093c28be24336593e1ebd9c2c633ee0f8c5b5c (diff)
downloadjavassist-ec3afdfb5d58b98ae8091d59f84d0d2f7f97a725.tar.gz
javassist-ec3afdfb5d58b98ae8091d59f84d0d2f7f97a725.zip
fixed JASSIST-240. support for Runtime[In]VisibleTypeAnnotations
Diffstat (limited to 'src/test/test5')
-rw-r--r--src/test/test5/TypeAnno.java30
-rw-r--r--src/test/test5/TypeAnnoA.java10
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/test5/TypeAnno.java b/src/test/test5/TypeAnno.java
new file mode 100644
index 00000000..a24d4008
--- /dev/null
+++ b/src/test/test5/TypeAnno.java
@@ -0,0 +1,30 @@
+package test5;
+
+import java.util.ArrayList;
+
+class TypeAnnoSuper {}
+interface TypeAnnoI {}
+
+@TypeAnnoA
+public class TypeAnno<@TypeAnnoA TT extends @TypeAnnoA String> extends @TypeAnnoA TypeAnnoSuper implements @TypeAnnoA TypeAnnoI {
+ public @TypeAnnoA String foo(@TypeAnnoA int i) throws @TypeAnnoA Exception {
+ @TypeAnnoA String s = new @TypeAnnoA String("bar ");
+ Object t = s;
+ String ss = (@TypeAnnoA String)t;
+ ArrayList<@TypeAnnoA String> list = new ArrayList<@TypeAnnoA String>();
+ if (list instanceof /* @TypeAnnoA */ java.util.List)
+ System.out.println("ok");
+
+ try {
+ list.add(ss);
+ } catch (@TypeAnnoA RuntimeException e) {}
+ return "foo" + list.get(0) + i;
+ }
+
+ @TypeAnnoA double dvalue;
+ @TypeAnnoA int ivalue @TypeAnnoA [] @TypeAnnoA [] @TypeAnnoA [];
+
+ <@TypeAnnoA T extends @TypeAnnoA String> T bar(T t) { return t; }
+
+ @TypeAnnoA TT getNull() { return null; }
+}
diff --git a/src/test/test5/TypeAnnoA.java b/src/test/test5/TypeAnnoA.java
new file mode 100644
index 00000000..75267787
--- /dev/null
+++ b/src/test/test5/TypeAnnoA.java
@@ -0,0 +1,10 @@
+package test5;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE_USE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TypeAnnoA {}