From d430b03bc11c8fb279d9601fd33f5ac3ab48ed80 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 13 May 2014 15:13:39 +0200 Subject: Fix BeanInfo generation for GenBCode --- test/files/jvm/beanInfo.check | 6 ++++++ test/files/jvm/beanInfo/C_1.scala | 9 +++++++++ test/files/jvm/beanInfo/Test_2.scala | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/files/jvm/beanInfo.check create mode 100644 test/files/jvm/beanInfo/C_1.scala create mode 100644 test/files/jvm/beanInfo/Test_2.scala (limited to 'test/files') diff --git a/test/files/jvm/beanInfo.check b/test/files/jvm/beanInfo.check new file mode 100644 index 0000000000..d74e127711 --- /dev/null +++ b/test/files/jvm/beanInfo.check @@ -0,0 +1,6 @@ +property descriptors +x -- int -- public int p.C.x() -- null +y -- class java.lang.String -- public java.lang.String p.C.y() -- public void p.C.y_$eq(java.lang.String) +z -- class scala.collection.immutable.List -- public scala.collection.immutable.List p.C.z() -- public void p.C.z_$eq(scala.collection.immutable.List) +method descriptors +f -- public p.C p.C.f() diff --git a/test/files/jvm/beanInfo/C_1.scala b/test/files/jvm/beanInfo/C_1.scala new file mode 100644 index 0000000000..a338abea1d --- /dev/null +++ b/test/files/jvm/beanInfo/C_1.scala @@ -0,0 +1,9 @@ +package p + +@scala.beans.BeanInfo +class C { + val x: Int = 0 + var y: String = "" + var z: List[_] = Nil + def f: C = ??? +} diff --git a/test/files/jvm/beanInfo/Test_2.scala b/test/files/jvm/beanInfo/Test_2.scala new file mode 100644 index 0000000000..fa9b6e1391 --- /dev/null +++ b/test/files/jvm/beanInfo/Test_2.scala @@ -0,0 +1,17 @@ +object Test extends App { + val info = java.beans.Introspector.getBeanInfo(classOf[p.C]) + + println("property descriptors") + + val pds = info.getPropertyDescriptors + for (pd <- pds) { + println(s"${pd.getName} -- ${pd.getPropertyType} -- ${pd.getReadMethod} -- ${pd.getWriteMethod}") + } + + println("method descriptors") + + val mds = info.getMethodDescriptors + for (md <- mds) { + println(s"${md.getName} -- ${md.getMethod}") + } +} -- cgit v1.2.3