From 02ed5fb3bc8d792872223ceecfd8fd0ae089d923 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 31 Jan 2013 11:49:19 +0100 Subject: SI-6989 privateWithin is now populated in reflect Runtime reflection in JavaMirrors previously forgot to fill in privateWithin when importing Java reflection artifacts. Now this is fixed. --- test/files/run/t6989.check | 24 ++++++++++++++++++++++++ test/files/run/t6989/JavaClass_1.java | 7 +++++++ test/files/run/t6989/Test_2.scala | 23 +++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 test/files/run/t6989.check create mode 100644 test/files/run/t6989/JavaClass_1.java create mode 100644 test/files/run/t6989/Test_2.scala (limited to 'test/files') diff --git a/test/files/run/t6989.check b/test/files/run/t6989.check new file mode 100644 index 0000000000..06bc3b7200 --- /dev/null +++ b/test/files/run/t6989.check @@ -0,0 +1,24 @@ +============ +class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +variable x +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +variable y +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +variable z +isPrivate = false +isProtected = false +isPublic = true +privateWithin = diff --git a/test/files/run/t6989/JavaClass_1.java b/test/files/run/t6989/JavaClass_1.java new file mode 100644 index 0000000000..61253dfe6f --- /dev/null +++ b/test/files/run/t6989/JavaClass_1.java @@ -0,0 +1,7 @@ +package foo; + +class JavaClass_1 { + private int x = 0; + protected String y = ""; + public float z = 0.0f; +} \ No newline at end of file diff --git a/test/files/run/t6989/Test_2.scala b/test/files/run/t6989/Test_2.scala new file mode 100644 index 0000000000..ba88e5cce3 --- /dev/null +++ b/test/files/run/t6989/Test_2.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ + +package object foo { + def test(sym: Symbol) = { + println("============") + println(sym) + println(s"isPrivate = ${sym.isPrivate}") + println(s"isProtected = ${sym.isProtected}") + println(s"isPublic = ${sym.isPublic}") + println(s"privateWithin = ${sym.privateWithin}") + } + + def testAll() = { + test(typeOf[foo.JavaClass_1].typeSymbol) + test(typeOf[foo.JavaClass_1].declaration(newTermName("x"))) + test(typeOf[foo.JavaClass_1].declaration(newTermName("y"))) + test(typeOf[foo.JavaClass_1].declaration(newTermName("z"))) + } +} + +object Test extends App { + foo.testAll() +} \ No newline at end of file -- cgit v1.2.3