From 33e1dac4e4a3b20b981a3c078e8605ba9a1a22f1 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 12 Nov 2009 11:10:13 +0000 Subject: fixed #2470. --- test/files/jvm/t2470.check | 1 + test/files/jvm/t2470/Action.java | 6 ++++++ test/files/jvm/t2470/Read_Classfile_2.scala | 3 +++ test/files/jvm/t2470/Task.java | 3 +++ test/files/jvm/t2470/Test_1.scala | 11 +++++++++++ 5 files changed, 24 insertions(+) create mode 100644 test/files/jvm/t2470.check create mode 100644 test/files/jvm/t2470/Action.java create mode 100644 test/files/jvm/t2470/Read_Classfile_2.scala create mode 100644 test/files/jvm/t2470/Task.java create mode 100644 test/files/jvm/t2470/Test_1.scala (limited to 'test') diff --git a/test/files/jvm/t2470.check b/test/files/jvm/t2470.check new file mode 100644 index 0000000000..11539b2a9f --- /dev/null +++ b/test/files/jvm/t2470.check @@ -0,0 +1 @@ +List(@Action(block=ACTION)) diff --git a/test/files/jvm/t2470/Action.java b/test/files/jvm/t2470/Action.java new file mode 100644 index 0000000000..62c71c43f1 --- /dev/null +++ b/test/files/jvm/t2470/Action.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(value=RetentionPolicy.RUNTIME) +public @interface Action { + Task.Scope block() default Task.Scope.ACTION; +} diff --git a/test/files/jvm/t2470/Read_Classfile_2.scala b/test/files/jvm/t2470/Read_Classfile_2.scala new file mode 100644 index 0000000000..07961776dd --- /dev/null +++ b/test/files/jvm/t2470/Read_Classfile_2.scala @@ -0,0 +1,3 @@ +class Read { + val t = Test +} diff --git a/test/files/jvm/t2470/Task.java b/test/files/jvm/t2470/Task.java new file mode 100644 index 0000000000..64004b5867 --- /dev/null +++ b/test/files/jvm/t2470/Task.java @@ -0,0 +1,3 @@ +class Task { + public enum Scope { ACTION, HIKA } +} diff --git a/test/files/jvm/t2470/Test_1.scala b/test/files/jvm/t2470/Test_1.scala new file mode 100644 index 0000000000..00cf287482 --- /dev/null +++ b/test/files/jvm/t2470/Test_1.scala @@ -0,0 +1,11 @@ +object Test { + class Foo { + @Action(block = Task.Scope.ACTION) + def foo = 0 + } + + def main(args: Array[String]) { + val m = classOf[Foo].getDeclaredMethods().find(_.toString.contains("foo")).get + println(m.getAnnotations().toList) + } +} -- cgit v1.2.3