summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-09-16 13:35:33 -0700
committerPaul Phillips <paulp@improving.org>2012-09-16 13:35:33 -0700
commit997829f06cef218db227f90f2e3f781771a92bfe (patch)
tree66fd55a8ca0bb5bb20b24428676745a504f5e5cc
parent7281ec070dc538a58a74c1a1a23b74f1dfbce7a0 (diff)
parent88b917566683e4ff0ad8e3df68ec4e82eefb2976 (diff)
downloadscala-997829f06cef218db227f90f2e3f781771a92bfe.tar.gz
scala-997829f06cef218db227f90f2e3f781771a92bfe.tar.bz2
scala-997829f06cef218db227f90f2e3f781771a92bfe.zip
Merge pull request #1319 from paulp/eugene-pullreq-1306
Eugene pullreq 1306
-rw-r--r--test/files/run/reflection-java-annotations.check2
-rw-r--r--test/files/run/reflection-java-annotations.scala3
2 files changed, 4 insertions, 1 deletions
diff --git a/test/files/run/reflection-java-annotations.check b/test/files/run/reflection-java-annotations.check
index 9954c59d4a..84cfd03358 100644
--- a/test/files/run/reflection-java-annotations.check
+++ b/test/files/run/reflection-java-annotations.check
@@ -12,6 +12,8 @@ sym: reflect.runtime.universe.Symbol = class Foo
scala> sym.typeSignature
res0: reflect.runtime.universe.Type = java.lang.Object{def <init>(): Foo}
+scala> sym.getAnnotations foreach (_.javaArgs)
+
scala> println(sym.getAnnotations)
List(ComplexAnnotation(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[Foo], v110 = ["hello", "world"], v111 = [classOf[SimpleAnnotation], classOf[ComplexAnnotation]], v113 = [SimpleAnnotation(v1 = 21, v10 = "world2", v11 = classOf[ComplexAnnotation], v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v13 = SimpleAnnotation(v1 = 11, v10 = "world1", v11 = classOf[SimpleAnnotation], v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false))
diff --git a/test/files/run/reflection-java-annotations.scala b/test/files/run/reflection-java-annotations.scala
index 96dbca86ad..4a4fe2572d 100644
--- a/test/files/run/reflection-java-annotations.scala
+++ b/test/files/run/reflection-java-annotations.scala
@@ -6,12 +6,13 @@ object Test extends ReplTest {
import scala.reflect.runtime.universe._
val sym = typeOf[Foo].typeSymbol
sym.typeSignature
+ sym.getAnnotations foreach (_.javaArgs)
println(sym.getAnnotations)
"""
override def transformSettings(settings: Settings): Settings = {
val thisFile = testPath.jfile.getAbsolutePath
- val javaCompiledAnnotationsJar = thisFile.substring(0, thisFile.length - ".scala".length) + ".jar"
+ val javaCompiledAnnotationsJar = (thisFile stripSuffix "scala") + "jar"
val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect"), sys.props("partest.comp"), javaCompiledAnnotationsJar) mkString sys.props("path.separator")
settings.processArguments(List("-cp", classpath), true)
settings