diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-01 05:16:22 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-01 05:16:22 +0000 |
commit | 55109d0d253c7e89660f1b61d17408648c0c53a4 (patch) | |
tree | db44f381515b79a575562cb2eacaaa8b7b590b7d | |
parent | ff5619e1f0d1653642e93e2c6a051c88231c95fb (diff) | |
download | scala-55109d0d253c7e89660f1b61d17408648c0c53a4.tar.gz scala-55109d0d253c7e89660f1b61d17408648c0c53a4.tar.bz2 scala-55109d0d253c7e89660f1b61d17408648c0c53a4.zip |
Shuffling classes around.
Old Man Reflection is coming home and he's not going to like finding
out a bunch of beans have moved into his reflecting room. We had better
evict those guys before he blows his stack.
scala.reflect.*Bean* --> scala.beans.*
scala.beans, that's kind of a fancy package name for some beans. I
figure it's time to start fishing or cutting bait on this kind of thing.
I don't even know what beans are, but if we're going to have them in the
mainline, the least surprising place to find them is scala.beans. If we
don't want to put them in scala.beans for whatever reason, then I say
they don't belong in trunk at all.
Bonus round:
scala.annotation.target --> scala.beans.meta
I don't know if there is any more unfortunate name for a package
possible than "target". Maybe ".svn" or ".git" if you could have dots
in package names. Package CVS wouldn't hit too hard these days. Package
lib_managed? I'll try to come up with something. In any case this golden
opportunity could not be squandered.
There is a new starr included, because GenJVM contains all kinds of
shooting-from-the-hip Bean-related name hardcoding. (Yes, still. I ran
out of stones. So a few birds escape with their lives... this time.)
34 files changed, 171 insertions, 128 deletions
diff --git a/lib/scala-compiler.jar.desired.sha1 b/lib/scala-compiler.jar.desired.sha1 index f26ce8e027..b523db5638 100644 --- a/lib/scala-compiler.jar.desired.sha1 +++ b/lib/scala-compiler.jar.desired.sha1 @@ -1 +1 @@ -9361bf724565fdb20937e22c7dc4e6c67ff82221 ?scala-compiler.jar +14a0987b7538c3aadcfa9160965076dfe118ec0d ?scala-compiler.jar diff --git a/lib/scala-library-src.jar.desired.sha1 b/lib/scala-library-src.jar.desired.sha1 index 6dd90205c1..299e06422e 100644 --- a/lib/scala-library-src.jar.desired.sha1 +++ b/lib/scala-library-src.jar.desired.sha1 @@ -1 +1 @@ -b0308ec2747d2e1614a000298dacccdd78e57c2d ?scala-library-src.jar +6207899bfc2c03c7c9d014e332475eb313062e3c ?scala-library-src.jar diff --git a/lib/scala-library.jar.desired.sha1 b/lib/scala-library.jar.desired.sha1 index affb2ac272..32ae1abf35 100644 --- a/lib/scala-library.jar.desired.sha1 +++ b/lib/scala-library.jar.desired.sha1 @@ -1 +1 @@ -1489cddb0e70ade4a03766ab3f9811697294ab0a ?scala-library.jar +f374329f89c77e8205a377060b21cf97ace5ac9b ?scala-library.jar diff --git a/src/compiler/scala/reflect/internal/Definitions.scala b/src/compiler/scala/reflect/internal/Definitions.scala index 1f918d0df1..a46b7d6bc7 100644 --- a/src/compiler/scala/reflect/internal/Definitions.scala +++ b/src/compiler/scala/reflect/internal/Definitions.scala @@ -209,12 +209,12 @@ trait Definitions extends reflect.api.StandardDefinitions { lazy val ElidableMethodClass = getClass("scala.annotation.elidable") lazy val ImplicitNotFoundClass = getClass("scala.annotation.implicitNotFound") lazy val VarargsClass = getClass("scala.annotation.varargs") - lazy val FieldTargetClass = getClass("scala.annotation.target.field") - lazy val GetterTargetClass = getClass("scala.annotation.target.getter") - lazy val SetterTargetClass = getClass("scala.annotation.target.setter") - lazy val BeanGetterTargetClass = getClass("scala.annotation.target.beanGetter") - lazy val BeanSetterTargetClass = getClass("scala.annotation.target.beanSetter") - lazy val ParamTargetClass = getClass("scala.annotation.target.param") + lazy val FieldTargetClass = getClass("scala.beans.meta.field") + lazy val GetterTargetClass = getClass("scala.beans.meta.getter") + lazy val SetterTargetClass = getClass("scala.beans.meta.setter") + lazy val BeanGetterTargetClass = getClass("scala.beans.meta.beanGetter") + lazy val BeanSetterTargetClass = getClass("scala.beans.meta.beanSetter") + lazy val ParamTargetClass = getClass("scala.beans.meta.param") lazy val ScalaInlineClass = getClass("scala.inline") lazy val ScalaNoInlineClass = getClass("scala.noinline") lazy val SpecializedClass = getClass("scala.specialized") diff --git a/src/compiler/scala/reflect/internal/StdNames.scala b/src/compiler/scala/reflect/internal/StdNames.scala index 4947334c1e..eb17a13dd4 100644 --- a/src/compiler/scala/reflect/internal/StdNames.scala +++ b/src/compiler/scala/reflect/internal/StdNames.scala @@ -606,8 +606,8 @@ trait StdNames extends /*reflect.generic.StdNames with*/ NameManglers { self: Sy } private class J2SENames extends JavaNames { - final val BeanProperty: TypeName = "scala.reflect.BeanProperty" - final val BooleanBeanProperty: TypeName = "scala.reflect.BooleanBeanProperty" + final val BeanProperty: TypeName = "scala.beans.BeanProperty" + final val BooleanBeanProperty: TypeName = "scala.beans.BooleanBeanProperty" final val Code: TypeName = "scala.reflect.Code" final val JavaSerializable: TypeName = "java.io.Serializable" } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index d7e2d92837..7f1dc1fbcd 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -180,10 +180,10 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with val MethodHandleType = new JObjectType("java.dyn.MethodHandle") // Scala attributes - val BeanInfoAttr = definitions.getClass("scala.reflect.BeanInfo") - val BeanInfoSkipAttr = definitions.getClass("scala.reflect.BeanInfoSkip") - val BeanDisplayNameAttr = definitions.getClass("scala.reflect.BeanDisplayName") - val BeanDescriptionAttr = definitions.getClass("scala.reflect.BeanDescription") + val BeanInfoAttr = definitions.getClass("scala.beans.BeanInfo") + val BeanInfoSkipAttr = definitions.getClass("scala.beans.BeanInfoSkip") + val BeanDisplayNameAttr = definitions.getClass("scala.beans.BeanDisplayName") + val BeanDescriptionAttr = definitions.getClass("scala.beans.BeanDescription") lazy val CloneableClass = definitions.getClass("java.lang.Cloneable") lazy val RemoteInterface = definitions.getClass("java.rmi.Remote") @@ -443,7 +443,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with val beanInfoClass = fjbgContext.JClass(javaFlags(c.symbol), javaName(c.symbol) + "BeanInfo", - "scala/reflect/ScalaBeanInfo", + "scala/beans/ScalaBeanInfo", JClass.NO_INTERFACES, c.cunit.source.toString) @@ -497,7 +497,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with // invoke the superclass constructor, which will do the // necessary java reflection and create Method objects. - jcode.emitINVOKESPECIAL("scala/reflect/ScalaBeanInfo", "<init>", conType) + jcode.emitINVOKESPECIAL("scala/beans/ScalaBeanInfo", "<init>", conType) jcode.emitRETURN() // write the bean information class file. diff --git a/src/library/scala/annotation/target/package.scala b/src/library/scala/annotation/target/package.scala index 454ce46e5c..3aff964c7b 100644 --- a/src/library/scala/annotation/target/package.scala +++ b/src/library/scala/annotation/target/package.scala @@ -1,68 +1,29 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + package scala.annotation -/** - * When defining a field, the Scala compiler creates up to four accessors - * for it: a getter, a setter, and if the field is annotated with - * `@BeanProperty`, a bean getter and a bean setter. - * - * For instance in the following class definition - * - * {{{ - * class C(@myAnnot @BeanProperty var c: Int) - * }}} - * - * there are six entities which can carry the annotation `@myAnnot`: the - * constructor parameter, the generated field and the four accessors. - * - * By default, annotations on (`val`-, `var`- or plain) constructor parameters - * end up on the parameter, not on any other entity. Annotations on fields - * by default only end up on the field. - * - * The meta-annotations in package `scala.annotation.target` are used - * to control where annotations on fields and class parameters are copied. - * This is done by annotating either the annotation type or the annotation - * class with one or several of the meta-annotations in this package. - * - * ==Annotating the annotation type== - * - * The target meta-annotations can be put on the annotation type when - * instantiating the annotation. In the following example, the annotation - * `@Id` will be added only to the bean getter `getX`. - * - * {{{ - * import javax.persistence.Id - * class A { - * @(Id @beanGetter) @BeanProperty val x = 0 - * } - * }}} - * - * In order to annotate the field as well, the meta-annotation `@field` - * would need to be added. - * - * The syntax can be improved using a type alias: - * - * {{{ - * object ScalaJPA { - * type Id = javax.persistence.Id @beanGetter - * } - * import ScalaJPA.Id - * class A { - * @Id @BeanProperty val x = 0 - * } - * }}} - * - * ==Annotating the annotation class== - * - * For annotations defined in Scala, a default target can be specified - * in the annotation class itself, for example - * - * {{{ - * @getter - * class myAnnotation extends Annotation - * }}} - * - * This only changes the default target for the annotation `myAnnotation`. - * When instantiating the annotation, the target can still be specified - * as described in the last section. - */ -package object target +package object target { + @deprecated("Use `@scala.beans.meta.beanGetter` instead", "2.10.0") + type beanGetter = scala.beans.meta.beanGetter + + @deprecated("Use `@scala.beans.meta.beanSetter` instead", "2.10.0") + type beanSetter = scala.beans.meta.beanSetter + + @deprecated("Use `@scala.beans.meta.field` instead", "2.10.0") + type field = scala.beans.meta.field + + @deprecated("Use `@scala.beans.meta.getter` instead", "2.10.0") + type getter = scala.beans.meta.getter + + @deprecated("Use `@scala.beans.meta.param` instead", "2.10.0") + type param = scala.beans.meta.param + + @deprecated("Use `@scala.beans.meta.setter` instead", "2.10.0") + type setter = scala.beans.meta.setter +} diff --git a/src/library/scala/reflect/BeanDescription.scala b/src/library/scala/beans/BeanDescription.scala index d0069cdf79..d6c9b0c736 100644 --- a/src/library/scala/reflect/BeanDescription.scala +++ b/src/library/scala/beans/BeanDescription.scala @@ -7,7 +7,7 @@ \* */ -package scala.reflect +package scala.beans /** Provides a short description that will be included when generating * bean information. This annotation can be attached to the bean itself, diff --git a/src/library/scala/reflect/BeanDisplayName.scala b/src/library/scala/beans/BeanDisplayName.scala index 5fecee4dc3..fbbfa08ffc 100644 --- a/src/library/scala/reflect/BeanDisplayName.scala +++ b/src/library/scala/beans/BeanDisplayName.scala @@ -7,7 +7,7 @@ \* */ -package scala.reflect +package scala.beans /** Provides a display name when generating bean information. This * annotation can be attached to the bean itself, or to any member. diff --git a/src/library/scala/reflect/BeanInfo.scala b/src/library/scala/beans/BeanInfo.scala index 0522377f8e..1a1d8defa4 100644 --- a/src/library/scala/reflect/BeanInfo.scala +++ b/src/library/scala/beans/BeanInfo.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -package scala.reflect +package scala.beans /** This annotation indicates that a JavaBean-compliant `BeanInfo` class * should be generated for this annotated Scala class. diff --git a/src/library/scala/reflect/BeanInfoSkip.scala b/src/library/scala/beans/BeanInfoSkip.scala index 40596865c0..23adf74924 100644 --- a/src/library/scala/reflect/BeanInfoSkip.scala +++ b/src/library/scala/beans/BeanInfoSkip.scala @@ -7,7 +7,7 @@ \* */ -package scala.reflect +package scala.beans /** This annotation indicates that bean information should * <strong>not</strong> be generated for the val, var, or def that it is diff --git a/src/library/scala/reflect/BeanProperty.scala b/src/library/scala/beans/BeanProperty.scala index b52774cdff..f5708a0ab0 100644 --- a/src/library/scala/reflect/BeanProperty.scala +++ b/src/library/scala/beans/BeanProperty.scala @@ -6,9 +6,9 @@ ** |/ ** \* */ -package scala.reflect +package scala.beans -import annotation.target._ +import meta._ /** When attached to a field, this annotation adds a setter and a getter * method following the Java Bean convention. For example: @@ -22,7 +22,7 @@ import annotation.target._ * def getStatus: String = this.status * }}} * For fields of type `Boolean`, if you need a getter named `isStatus`, - * use the `scala.reflect.BooleanBeanProperty` annotation instead. + * use the `scala.beans.BooleanBeanProperty` annotation instead. */ @field class BeanProperty extends annotation.StaticAnnotation diff --git a/src/library/scala/reflect/BooleanBeanProperty.scala b/src/library/scala/beans/BooleanBeanProperty.scala index 97c05ffb7c..2215177a80 100644 --- a/src/library/scala/reflect/BooleanBeanProperty.scala +++ b/src/library/scala/beans/BooleanBeanProperty.scala @@ -6,12 +6,12 @@ ** |/ ** \* */ -package scala.reflect +package scala.beans -import annotation.target._ +import meta._ /** This annotation has the same functionality as - * `scala.reflect.BeanProperty`, but the generated Bean getter will be + * `scala.beans.BeanProperty`, but the generated Bean getter will be * named `isFieldName` instead of `getFieldName`. */ @field diff --git a/src/library/scala/reflect/ScalaBeanInfo.scala b/src/library/scala/beans/ScalaBeanInfo.scala index bcb76c38bc..4661b23568 100644 --- a/src/library/scala/reflect/ScalaBeanInfo.scala +++ b/src/library/scala/beans/ScalaBeanInfo.scala @@ -7,7 +7,7 @@ \* */ -package scala.reflect +package scala.beans /** Provides some simple runtime processing necessary to create * JavaBean descriptors for Scala entities. The compiler creates diff --git a/src/library/scala/annotation/target/beanGetter.scala b/src/library/scala/beans/meta/beanGetter.scala index 1707a9d258..3eb2dcbda3 100644 --- a/src/library/scala/annotation/target/beanGetter.scala +++ b/src/library/scala/beans/meta/beanGetter.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class beanGetter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/beanSetter.scala b/src/library/scala/beans/meta/beanSetter.scala index 11e95db3cb..8c61acfe6d 100644 --- a/src/library/scala/annotation/target/beanSetter.scala +++ b/src/library/scala/beans/meta/beanSetter.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class beanSetter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/field.scala b/src/library/scala/beans/meta/field.scala index cd0e5a58b3..135b2e590c 100644 --- a/src/library/scala/annotation/target/field.scala +++ b/src/library/scala/beans/meta/field.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class field extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/getter.scala b/src/library/scala/beans/meta/getter.scala index 9363401d35..18afa8e324 100644 --- a/src/library/scala/annotation/target/getter.scala +++ b/src/library/scala/beans/meta/getter.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class getter extends annotation.StaticAnnotation diff --git a/src/library/scala/beans/meta/package.scala b/src/library/scala/beans/meta/package.scala new file mode 100644 index 0000000000..c7b7b425e1 --- /dev/null +++ b/src/library/scala/beans/meta/package.scala @@ -0,0 +1,68 @@ +package scala.beans + +/** + * When defining a field, the Scala compiler creates up to four accessors + * for it: a getter, a setter, and if the field is annotated with + * `@BeanProperty`, a bean getter and a bean setter. + * + * For instance in the following class definition + * + * {{{ + * class C(@myAnnot @BeanProperty var c: Int) + * }}} + * + * there are six entities which can carry the annotation `@myAnnot`: the + * constructor parameter, the generated field and the four accessors. + * + * By default, annotations on (`val`-, `var`- or plain) constructor parameters + * end up on the parameter, not on any other entity. Annotations on fields + * by default only end up on the field. + * + * The meta-annotations in package `scala.beans.meta` are used + * to control where annotations on fields and class parameters are copied. + * This is done by annotating either the annotation type or the annotation + * class with one or several of the meta-annotations in this package. + * + * ==Annotating the annotation type== + * + * The target meta-annotations can be put on the annotation type when + * instantiating the annotation. In the following example, the annotation + * `@Id` will be added only to the bean getter `getX`. + * + * {{{ + * import javax.persistence.Id + * class A { + * @(Id @beanGetter) @BeanProperty val x = 0 + * } + * }}} + * + * In order to annotate the field as well, the meta-annotation `@field` + * would need to be added. + * + * The syntax can be improved using a type alias: + * + * {{{ + * object ScalaJPA { + * type Id = javax.persistence.Id @beanGetter + * } + * import ScalaJPA.Id + * class A { + * @Id @BeanProperty val x = 0 + * } + * }}} + * + * ==Annotating the annotation class== + * + * For annotations defined in Scala, a default target can be specified + * in the annotation class itself, for example + * + * {{{ + * @getter + * class myAnnotation extends Annotation + * }}} + * + * This only changes the default target for the annotation `myAnnotation`. + * When instantiating the annotation, the target can still be specified + * as described in the last section. + */ +package object meta diff --git a/src/library/scala/annotation/target/param.scala b/src/library/scala/beans/meta/param.scala index 5b917b883f..45c3e3e00f 100644 --- a/src/library/scala/annotation/target/param.scala +++ b/src/library/scala/beans/meta/param.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class param extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/setter.scala b/src/library/scala/beans/meta/setter.scala index 1c13a796a0..5a23b7b53d 100644 --- a/src/library/scala/annotation/target/setter.scala +++ b/src/library/scala/beans/meta/setter.scala @@ -5,9 +5,9 @@ ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ -package scala.annotation.target +package scala.beans.meta /** - * Consult the documentation in package [[scala.annotation.target]]. + * Consult the documentation in package [[scala.beans.meta]]. */ final class setter extends annotation.StaticAnnotation diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala index 53f5c456c2..12c36da8d3 100644 --- a/src/library/scala/deprecated.scala +++ b/src/library/scala/deprecated.scala @@ -8,7 +8,7 @@ package scala -import annotation.target._ +import beans.meta._ /** An annotation that designates that a definition is deprecated. * Access to the member then generates a deprecated warning. diff --git a/src/library/scala/deprecatedName.scala b/src/library/scala/deprecatedName.scala index 090ec133fe..53f26573c0 100644 --- a/src/library/scala/deprecatedName.scala +++ b/src/library/scala/deprecatedName.scala @@ -8,7 +8,7 @@ package scala -import annotation.target._ +import beans.meta._ /** * An annotation that designates the name of the parameter to which it is diff --git a/src/library/scala/reflect/package.scala b/src/library/scala/reflect/package.scala index ad541ce46e..d18924c409 100644 --- a/src/library/scala/reflect/package.scala +++ b/src/library/scala/reflect/package.scala @@ -17,4 +17,18 @@ package object reflect extends ReflectionUtils { type Type = mirror.Type type Tree = mirror.Tree */ + @deprecated("Use `@scala.beans.BeanDescription` instead", "2.10.0") + type BeanDescription = scala.beans.BeanDescription + @deprecated("Use `@scala.beans.BeanDisplayName` instead", "2.10.0") + type BeanDisplayName = scala.beans.BeanDisplayName + @deprecated("Use `@scala.beans.BeanInfo` instead", "2.10.0") + type BeanInfo = scala.beans.BeanInfo + @deprecated("Use `@scala.beans.BeanInfoSkip` instead", "2.10.0") + type BeanInfoSkip = scala.beans.BeanInfoSkip + @deprecated("Use `@scala.beans.BeanProperty` instead", "2.10.0") + type BeanProperty = scala.beans.BeanProperty + @deprecated("Use `@scala.beans.BooleanBeanProperty` instead", "2.10.0") + type BooleanBeanProperty = scala.beans.BooleanBeanProperty + @deprecated("Use `@scala.beans.ScalaBeanInfo` instead", "2.10.0") + type ScalaBeanInfo = scala.beans.ScalaBeanInfo } diff --git a/src/library/scala/transient.scala b/src/library/scala/transient.scala index c17fab1cb4..fd3c824e81 100644 --- a/src/library/scala/transient.scala +++ b/src/library/scala/transient.scala @@ -10,7 +10,7 @@ package scala -import annotation.target._ +import beans.meta._ @field class transient extends annotation.StaticAnnotation diff --git a/src/library/scala/volatile.scala b/src/library/scala/volatile.scala index 9b47a52766..a45bdf8d14 100644 --- a/src/library/scala/volatile.scala +++ b/src/library/scala/volatile.scala @@ -10,7 +10,7 @@ package scala -import annotation.target._ +import beans.meta._ @field class volatile extends annotation.StaticAnnotation diff --git a/test/files/jvm/annotations.scala b/test/files/jvm/annotations.scala index 740a74226e..a0b087a8db 100644 --- a/test/files/jvm/annotations.scala +++ b/test/files/jvm/annotations.scala @@ -94,8 +94,8 @@ object Test4 { } class Foo8(@SourceAnnotation("constructor val") val n: Int) {} class Foo9 { - import scala.annotation.target._ - import scala.reflect.BeanProperty + import scala.beans.meta._ + import scala.beans.BeanProperty @(SourceAnnotation @getter)("http://apple.com") val x = 0 @BeanProperty @(SourceAnnotation @beanSetter)("http://uppla.com") var y = 0 @@ -103,8 +103,8 @@ object Test4 { @BeanProperty @myAnn("http://eppli.com") var z = 0 } class Foo10(@SourceAnnotation("on param 1") val name: String) - class Foo11(@(SourceAnnotation @scala.annotation.target.field)("on param 2") val name: String) - class Foo12(@(SourceAnnotation @scala.annotation.target.setter)("on param 3") var name: String) + class Foo11(@(SourceAnnotation @scala.beans.meta.field)("on param 2") val name: String) + class Foo12(@(SourceAnnotation @scala.beans.meta.setter)("on param 3") var name: String) def run { import java.lang.annotation.Annotation import java.lang.reflect.AnnotatedElement @@ -157,7 +157,7 @@ object Test4 { } object Test5 { - import scala.reflect.BeanProperty + import scala.beans.BeanProperty import java.lang.Integer class Count { @@ -182,7 +182,7 @@ object Test5 { } object Test6 { - import scala.reflect.BeanProperty + import scala.beans.BeanProperty import scala.reflect.BooleanBeanProperty class C(@BeanProperty var text: String) class D(@BooleanBeanProperty var prop: Boolean) { diff --git a/test/files/pos/annotations.scala b/test/files/pos/annotations.scala index 0819379d86..1cae262bb0 100644 --- a/test/files/pos/annotations.scala +++ b/test/files/pos/annotations.scala @@ -25,7 +25,7 @@ object Test { //bug #1214 val y = new (Integer @ann(0))(2) - import scala.reflect.BeanProperty + import scala.beans.BeanProperty // bug #637 trait S { def getField(): Int } @@ -44,7 +44,7 @@ object Test { // test forward references to getters / setters class BeanPropertyTests { - @scala.reflect.BeanProperty lazy val lv1 = 0 + @scala.beans.BeanProperty lazy val lv1 = 0 def foo() { val bp1 = new BeanPropertyTests1 @@ -58,13 +58,13 @@ class BeanPropertyTests { bp1.setV2(100) } - @scala.reflect.BeanProperty var v1 = 0 + @scala.beans.BeanProperty var v1 = 0 } class BeanPropertyTests1 { - @scala.reflect.BeanProperty lazy val lv2 = "0" - @scala.reflect.BeanProperty var v2 = 0 + @scala.beans.BeanProperty lazy val lv2 = "0" + @scala.beans.BeanProperty var v2 = 0 } // test mixin of getters / setters, and implementing abstract @@ -78,7 +78,7 @@ class C extends T with BeanF { } trait T { - @scala.reflect.BeanProperty var f = "nei" + @scala.beans.BeanProperty var f = "nei" @scala.reflect.BooleanBeanProperty var g = false } diff --git a/test/files/pos/spec-annotations.scala b/test/files/pos/spec-annotations.scala index 215f00da50..35cab6de09 100644 --- a/test/files/pos/spec-annotations.scala +++ b/test/files/pos/spec-annotations.scala @@ -23,7 +23,7 @@ object Test { //bug #1214 val y = new (Integer @ann(0))(2) - import scala.reflect.BeanProperty + import scala.beans.BeanProperty // bug #637 trait S { def getField(): Int } diff --git a/test/files/pos/t1070.scala b/test/files/pos/t1070.scala index 95b77184d7..1622043a85 100644 --- a/test/files/pos/t1070.scala +++ b/test/files/pos/t1070.scala @@ -1,4 +1,4 @@ -import scala.reflect.BeanProperty; +import scala.beans.BeanProperty; trait beanpropertytrait { @BeanProperty var myVariable: Long = -1l; } diff --git a/test/files/pos/t1782/Test_1.scala b/test/files/pos/t1782/Test_1.scala index e61ef8eaf5..6467a74c29 100644 --- a/test/files/pos/t1782/Test_1.scala +++ b/test/files/pos/t1782/Test_1.scala @@ -10,7 +10,7 @@ class Provider @Ann(Days.Friday) def someMethod() = () // #2103 - @scala.reflect.BeanProperty + @scala.beans.BeanProperty @Ann(value = Days.Sunday) val t2103 = "test" } diff --git a/test/files/presentation/akka/src/akka/actor/Actor.scala b/test/files/presentation/akka/src/akka/actor/Actor.scala index 85026e8301..b955c4c38b 100644 --- a/test/files/presentation/akka/src/akka/actor/Actor.scala +++ b/test/files/presentation/akka/src/akka/actor/Actor.scala @@ -9,7 +9,7 @@ import akka.util.Helpers.{ narrow, narrowSilently } import akka.util.ListenerManagement import akka.AkkaException -import scala.reflect.BeanProperty +import scala.beans.BeanProperty import akka.util.{ ReflectiveAccess, Duration } import akka.remoteinterface.RemoteSupport import akka.japi.{ Creator, Procedure } diff --git a/test/files/presentation/akka/src/akka/actor/ActorRef.scala b/test/files/presentation/akka/src/akka/actor/ActorRef.scala index 4ce14512b8..07fa358744 100644 --- a/test/files/presentation/akka/src/akka/actor/ActorRef.scala +++ b/test/files/presentation/akka/src/akka/actor/ActorRef.scala @@ -15,7 +15,7 @@ import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.{ ScheduledFuture, ConcurrentHashMap, TimeUnit } import java.util.{ Map => JMap } -import scala.reflect.BeanProperty +import scala.beans.BeanProperty import scala.collection.immutable.Stack import scala.annotation.tailrec diff --git a/test/files/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala b/test/files/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala index 6366a4158c..0c5da82294 100644 --- a/test/files/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala +++ b/test/files/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala @@ -10,7 +10,7 @@ import akka.util._ import akka.dispatch.CompletableFuture import akka.AkkaException -import scala.reflect.BeanProperty +import scala.beans.BeanProperty import java.net.InetSocketAddress import java.util.concurrent.ConcurrentHashMap |