Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Removed obsolete functionality #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,6 @@ TODO:
<path refid="aux.libs"/>
</path>

<path id="quick.actors.build.path">
<path refid="quick.library.build.path"/>
<pathelement location="${build-quick.dir}/classes/actors"/>
</path>

<path id="quick.reflect.build.path">
<path refid="quick.library.build.path"/>
<pathelement location="${build-quick.dir}/classes/reflect"/>
Expand Down Expand Up @@ -786,7 +781,6 @@ TODO:

<path id="quick.bin.tool.path">
<path refid="quick.repl.build.path"/>
<path refid="quick.actors.build.path"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
<path refid="external-modules-nocore"/>
Expand Down Expand Up @@ -820,10 +814,6 @@ TODO:
<fileset dir="${forkjoin-classes}"/>
</path>

<path id="pack.actors.files">
<fileset dir="${build-quick.dir}/classes/actors"/>
</path>

<path id="pack.compiler.files">
<fileset dir="${build-quick.dir}/classes/compiler"/>

Expand Down Expand Up @@ -871,7 +861,6 @@ TODO:
<path id="docs.scaladoc.build.path"> <path refid="quick.scaladoc.build.path"/> </path>
<path id="docs.interactive.build.path"> <path refid="quick.interactive.build.path"/> </path>
<path id="docs.scalap.build.path"> <path refid="quick.scalap.build.path"/> </path>
<path id="docs.actors.build.path"> <path refid="quick.actors.build.path"/> </path>

<!-- run-time classpath for scaladoc TODO: resolve through maven -->
<path id="scaladoc.classpath">
Expand Down Expand Up @@ -1108,11 +1097,6 @@ TODO:
<target name="quick.scalap" depends="quick.repl">
<staged-build with="locker" stage="quick" project="scalap"/> </target>

<target name="quick.actors" depends="quick.lib">
<staged-build with="locker" stage="quick" project="actors"/> </target>



<target name="quick.modules" depends="quick.repl, quick.scaladoc, quick.interactive, quick.scalap"/>

<target name="quick.bin" depends="quick.lib, quick.reflect, quick.comp, quick.modules">
Expand Down Expand Up @@ -1162,14 +1146,12 @@ TODO:
<target name="pack.interactive" depends="quick.interactive"> <staged-pack project="interactive"/> </target>
-->

<target name="pack.actors" depends="quick.actors"> <staged-pack project="actors"/> </target>

<target name="pack.scalap" depends="quick.scalap"> <staged-pack project="scalap"/> </target>

<target name="pack.core" depends="pack.reflect, pack.comp, pack.lib"/>

<!-- TODO modularize compiler: pack.scaladoc, pack.interactive, -->
<target name="pack.modules" depends="pack.actors, pack.scalap">
<target name="pack.modules" depends="pack.scalap">
<copy todir="${build-pack.dir}/lib">
<path refid="external-modules-nocore" />
<mapper type="flatten" />
Expand Down Expand Up @@ -1598,13 +1580,6 @@ TODO:
</staged-docs>
</target>
-->

<target name="docs.actors" depends="docs.start" unless="docs.skip">
<staged-docs project="actors">
<include name="**/*.scala"/>
</staged-docs>
</target>

<target name="docs.scalap" depends="docs.start" unless="docs.skip">
<staged-docs project="scalap">
<include name="**/*.scala"/>
Expand All @@ -1613,7 +1588,7 @@ TODO:

<target name="docs.core" depends="docs.lib, docs.reflect, docs.comp" unless="docs.skip"/>
<!-- TODO modularize compiler: docs.scaladoc, docs.interactive, -->
<target name="docs.done" depends="docs.core, docs.actors, docs.scalap" unless="docs.skip"/>
<target name="docs.done" depends="docs.core, docs.scalap" unless="docs.skip"/>

<!-- doc/ and man/ -->
<target name="pack.doc" depends="scaladoc.task" unless="docs.skip"> <!-- depends on scaladoc.task for scalac taskdef -->
Expand Down
15 changes: 0 additions & 15 deletions spec/11-user-defined-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,6 @@ Java platform, the following annotations have a standard meaning.
clause for the method or constructor must mention the class of that exception
or one of the superclasses of the class of that exception.

## Java Beans Annotations

* `@scala.beans.BeanProperty` When prefixed to a definition of some variable `X`, this
annotation causes getter and setter methods `getX`, `setX`
in the Java bean style to be added in the class containing the
variable. The first letter of the variable appears capitalized after
the `get` or `set`. When the annotation is added to the
definition of an immutable value definition `X`, only a getter is
generated. The construction of these methods is part of
code-generation; therefore, these methods become visible only once a
classfile for the containing class is generated.

* `@scala.beans.BooleanBeanProperty` This annotation is equivalent to `scala.reflect.BeanProperty`, but
the generated getter method is named `isX` instead of `getX`.

## Deprecation Annotations

* `@deprecated(<stringlit>)` Marks a definition as deprecated. Accesses to the
Expand Down
15 changes: 0 additions & 15 deletions src/compiler/scala/reflect/reify/phases/Reshape.scala
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,6 @@ trait Reshape {
stats collect { case ddef: DefDef => ddef } foreach (defdef => {
val valdef = symdefs get defdef.symbol.accessedOrSelf collect { case vdef: ValDef => vdef } getOrElse null
if (valdef != null) accessors(valdef) = accessors.getOrElse(valdef, Nil) :+ defdef

def detectBeanAccessors(prefix: String): Unit = {
if (defdef.name.startsWith(prefix)) {
val name = defdef.name.toString.substring(prefix.length)
def uncapitalize(s: String) = if (s.length == 0) "" else { val chars = s.toCharArray; chars(0) = chars(0).toLower; new String(chars) }
def findValDef(name: String) = symdefs.values collectFirst {
case vdef: ValDef if vdef.name.dropLocal string_== name => vdef
}
val valdef = findValDef(name).orElse(findValDef(uncapitalize(name))).orNull
if (valdef != null) accessors(valdef) = accessors.getOrElse(valdef, Nil) :+ defdef
}
}
detectBeanAccessors("get")
detectBeanAccessors("set")
detectBeanAccessors("is")
})

val stats1 = stats flatMap {
Expand Down
116 changes: 1 addition & 115 deletions src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
}
} // end of trait BCClassGen

/* basic functionality for class file building of plain, mirror, and beaninfo classes. */
/* basic functionality for class file building of plain and mirror classes. */
abstract class JBuilder extends BCInnerClassGen {

} // end of class JBuilder
Expand Down Expand Up @@ -850,120 +850,6 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {

} // end of class JMirrorBuilder

/* builder of bean info classes */
class JBeanInfoBuilder extends JBuilder {

/*
* Generate a bean info class that describes the given class.
*
* @author Ross Judson (ross.judson@soletta.com)
*
* must-single-thread
*/
def genBeanInfoClass(cls: Symbol, cunit: CompilationUnit, fieldSymbols: List[Symbol], methodSymbols: List[Symbol]): asm.tree.ClassNode = {

def javaSimpleName(s: Symbol): String = { s.javaSimpleName.toString }

innerClassBufferASM.clear()

val flags = javaFlags(cls)

val beanInfoName = (internalName(cls) + "BeanInfo")
val beanInfoClass = new asm.tree.ClassNode
beanInfoClass.visit(
classfileVersion,
flags,
beanInfoName,
null, // no java-generic-signature
"scala/beans/ScalaBeanInfo",
EMPTY_STRING_ARRAY
)

beanInfoClass.visitSource(
cunit.source.toString,
null /* SourceDebugExtension */
)

var fieldList = List[String]()

for (f <- fieldSymbols if f.hasGetter;
g = f.getter(cls);
s = f.setter(cls);
if g.isPublic && !(f.name startsWith "$")
) {
// inserting $outer breaks the bean
fieldList = javaSimpleName(f) :: javaSimpleName(g) :: (if (s != NoSymbol) javaSimpleName(s) else null) :: fieldList
}

val methodList: List[String] =
for (m <- methodSymbols
if !m.isConstructor &&
m.isPublic &&
!(m.name startsWith "$") &&
!m.isGetter &&
!m.isSetter)
yield javaSimpleName(m)

val constructor = beanInfoClass.visitMethod(
asm.Opcodes.ACC_PUBLIC,
INSTANCE_CONSTRUCTOR_NAME,
"()V",
null, // no java-generic-signature
EMPTY_STRING_ARRAY // no throwable exceptions
)

val stringArrayJType: BType = ArrayBType(StringReference)
val conJType: BType = MethodBType(
classBTypeFromSymbol(definitions.ClassClass) :: stringArrayJType :: stringArrayJType :: Nil,
UNIT
)

def push(lst: List[String]) {
var fi = 0
for (f <- lst) {
constructor.visitInsn(asm.Opcodes.DUP)
constructor.visitLdcInsn(new java.lang.Integer(fi))
if (f == null) { constructor.visitInsn(asm.Opcodes.ACONST_NULL) }
else { constructor.visitLdcInsn(f) }
constructor.visitInsn(StringReference.typedOpcode(asm.Opcodes.IASTORE))
fi += 1
}
}

constructor.visitCode()

constructor.visitVarInsn(asm.Opcodes.ALOAD, 0)
// push the class
constructor.visitLdcInsn(classBTypeFromSymbol(cls).toASMType)

// push the string array of field information
constructor.visitLdcInsn(new java.lang.Integer(fieldList.length))
constructor.visitTypeInsn(asm.Opcodes.ANEWARRAY, StringReference.internalName)
push(fieldList)

// push the string array of method information
constructor.visitLdcInsn(new java.lang.Integer(methodList.length))
constructor.visitTypeInsn(asm.Opcodes.ANEWARRAY, StringReference.internalName)
push(methodList)

// invoke the superclass constructor, which will do the
// necessary java reflection and create Method objects.
constructor.visitMethodInsn(asm.Opcodes.INVOKESPECIAL, "scala/beans/ScalaBeanInfo", INSTANCE_CONSTRUCTOR_NAME, conJType.descriptor, false)
constructor.visitInsn(asm.Opcodes.RETURN)

constructor.visitMaxs(0, 0) // just to follow protocol, dummy arguments
constructor.visitEnd()

innerClassBufferASM ++= classBTypeFromSymbol(cls).info.memberClasses
addInnerClassesASM(beanInfoClass, innerClassBufferASM.toList)

beanInfoClass.visitEnd()

beanInfoClass
}

} // end of class JBeanInfoBuilder

trait JAndroidBuilder {
self: BCInnerClassGen =>

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ abstract class BTypes {
* Mirror Classes
* --------------
*
* TODO: innerclass attributes on mirror class, bean info class
* TODO: innerclass attributes on mirror class class
*/

/**
Expand Down
4 changes: 0 additions & 4 deletions src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ class CoreBTypes[BTFS <: BTypesFromSymbols[_ <: Global]](val bTypes: BTFS) {
lazy val AndroidParcelableInterface : Symbol = getClassIfDefined("android.os.Parcelable")
lazy val AndroidCreatorClass : Symbol = getClassIfDefined("android.os.Parcelable$Creator")

lazy val BeanInfoAttr: Symbol = requiredClass[scala.beans.BeanInfo]

/* The Object => String overload. */
lazy val String_valueOf: Symbol = {
getMember(StringModule, nme.valueOf) filter (sym => sym.info.paramTypes match {
Expand Down Expand Up @@ -273,8 +271,6 @@ final class CoreBTypesProxy[BTFS <: BTypesFromSymbols[_ <: Global]](val bTypes:
def AndroidParcelableInterface : Symbol = _coreBTypes.AndroidParcelableInterface
def AndroidCreatorClass : Symbol = _coreBTypes.AndroidCreatorClass

def BeanInfoAttr: Symbol = _coreBTypes.BeanInfoAttr

def String_valueOf: Symbol = _coreBTypes.String_valueOf

def FunctionReference : Vector[ClassBType] = _coreBTypes.FunctionReference
Expand Down
Loading