diff options
23 files changed, 123 insertions, 233 deletions
diff --git a/lib/cldcapi10.jar.desired.sha1 b/lib/cldcapi10.jar.desired.sha1 deleted file mode 100644 index 163095f3a5..0000000000 --- a/lib/cldcapi10.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -2f1509aa3b9e252aece453560aee87718917434c ?cldcapi10.jar diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index 9fb6d09f56..f5ccf236a1 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -99,7 +99,7 @@ class Scalac extends MatchingTask { /** Defines valid values for the <code>target</code> property. */ object Target extends PermissibleValue { - val values = List("jvm-1.5", "msil", "cldc") + val values = List("jvm-1.5", "msil") } /** Defines valid values for the <code>deprecation</code> and diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 269c1f4e2d..77e8ec4869 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -946,7 +946,6 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable }) } - def forCLDC: Boolean = settings.target.value == "cldc" def forJVM : Boolean = settings.target.value startsWith "jvm" def forMSIL: Boolean = settings.target.value == "msil" def onlyPresentation = false diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala index dde81541a2..f89b576d8b 100644 --- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala +++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala @@ -276,10 +276,8 @@ abstract class ScalaPrimitives { addPrimitives(ByteClass, nme.UNARY_-, NEG) addPrimitives(ByteClass, nme.UNARY_~, NOT) - if (!forCLDC) { - addPrimitives(ByteClass, nme.toFloat, B2F) - addPrimitives(ByteClass, nme.toDouble, B2D) - } + addPrimitives(ByteClass, nme.toFloat, B2F) + addPrimitives(ByteClass, nme.toDouble, B2D) // scala.Short addPrimitives(ShortClass, nme.EQ, EQ) @@ -310,10 +308,8 @@ abstract class ScalaPrimitives { addPrimitives(ShortClass, nme.UNARY_-, NEG) addPrimitives(ShortClass, nme.UNARY_~, NOT) - if (!forCLDC) { - addPrimitives(ShortClass, nme.toFloat, S2F) - addPrimitives(ShortClass, nme.toDouble, S2D) - } + addPrimitives(ShortClass, nme.toFloat, S2F) + addPrimitives(ShortClass, nme.toDouble, S2D) // scala.Char addPrimitives(CharClass, nme.EQ, EQ) @@ -343,10 +339,8 @@ abstract class ScalaPrimitives { addPrimitives(CharClass, nme.UNARY_+, POS) addPrimitives(CharClass, nme.UNARY_-, NEG) addPrimitives(CharClass, nme.UNARY_~, NOT) - if (!forCLDC) { - addPrimitives(CharClass, nme.toFloat, C2F) - addPrimitives(CharClass, nme.toDouble, C2D) - } + addPrimitives(CharClass, nme.toFloat, C2F) + addPrimitives(CharClass, nme.toDouble, C2D) // scala.Int addPrimitives(IntClass, nme.EQ, EQ) @@ -376,10 +370,8 @@ abstract class ScalaPrimitives { addPrimitives(IntClass, nme.UNARY_+, POS) addPrimitives(IntClass, nme.UNARY_-, NEG) addPrimitives(IntClass, nme.UNARY_~, NOT) - if (!forCLDC) { - addPrimitives(IntClass, nme.toFloat, I2F) - addPrimitives(IntClass, nme.toDouble, I2D) - } + addPrimitives(IntClass, nme.toFloat, I2F) + addPrimitives(IntClass, nme.toDouble, I2D) // scala.Long addPrimitives(LongClass, nme.EQ, EQ) @@ -409,60 +401,57 @@ abstract class ScalaPrimitives { addPrimitives(LongClass, nme.UNARY_+, POS) addPrimitives(LongClass, nme.UNARY_-, NEG) addPrimitives(LongClass, nme.UNARY_~, NOT) - if (!forCLDC) { - addPrimitives(LongClass, nme.toFloat, L2F) - addPrimitives(LongClass, nme.toDouble, L2D) - } + addPrimitives(LongClass, nme.toFloat, L2F) + addPrimitives(LongClass, nme.toDouble, L2D) + + // scala.Float + addPrimitives(FloatClass, nme.EQ, EQ) + addPrimitives(FloatClass, nme.NE, NE) + addPrimitives(FloatClass, nme.ADD, ADD) + addPrimitives(FloatClass, nme.SUB, SUB) + addPrimitives(FloatClass, nme.MUL, MUL) + addPrimitives(FloatClass, nme.DIV, DIV) + addPrimitives(FloatClass, nme.MOD, MOD) + addPrimitives(FloatClass, nme.LT, LT) + addPrimitives(FloatClass, nme.LE, LE) + addPrimitives(FloatClass, nme.GT, GT) + addPrimitives(FloatClass, nme.GE, GE) + // conversions + addPrimitives(FloatClass, nme.toByte, F2B) + addPrimitives(FloatClass, nme.toShort, F2S) + addPrimitives(FloatClass, nme.toChar, F2C) + addPrimitives(FloatClass, nme.toInt, F2I) + addPrimitives(FloatClass, nme.toLong, F2L) + addPrimitives(FloatClass, nme.toFloat, F2F) + addPrimitives(FloatClass, nme.toDouble, F2D) + // unary methods + addPrimitives(FloatClass, nme.UNARY_+, POS) + addPrimitives(FloatClass, nme.UNARY_-, NEG) + + // scala.Double + addPrimitives(DoubleClass, nme.EQ, EQ) + addPrimitives(DoubleClass, nme.NE, NE) + addPrimitives(DoubleClass, nme.ADD, ADD) + addPrimitives(DoubleClass, nme.SUB, SUB) + addPrimitives(DoubleClass, nme.MUL, MUL) + addPrimitives(DoubleClass, nme.DIV, DIV) + addPrimitives(DoubleClass, nme.MOD, MOD) + addPrimitives(DoubleClass, nme.LT, LT) + addPrimitives(DoubleClass, nme.LE, LE) + addPrimitives(DoubleClass, nme.GT, GT) + addPrimitives(DoubleClass, nme.GE, GE) + // conversions + addPrimitives(DoubleClass, nme.toByte, D2B) + addPrimitives(DoubleClass, nme.toShort, D2S) + addPrimitives(DoubleClass, nme.toChar, D2C) + addPrimitives(DoubleClass, nme.toInt, D2I) + addPrimitives(DoubleClass, nme.toLong, D2L) + addPrimitives(DoubleClass, nme.toFloat, D2F) + addPrimitives(DoubleClass, nme.toDouble, D2D) + // unary methods + addPrimitives(DoubleClass, nme.UNARY_+, POS) + addPrimitives(DoubleClass, nme.UNARY_-, NEG) - if (!forCLDC) { - // scala.Float - addPrimitives(FloatClass, nme.EQ, EQ) - addPrimitives(FloatClass, nme.NE, NE) - addPrimitives(FloatClass, nme.ADD, ADD) - addPrimitives(FloatClass, nme.SUB, SUB) - addPrimitives(FloatClass, nme.MUL, MUL) - addPrimitives(FloatClass, nme.DIV, DIV) - addPrimitives(FloatClass, nme.MOD, MOD) - addPrimitives(FloatClass, nme.LT, LT) - addPrimitives(FloatClass, nme.LE, LE) - addPrimitives(FloatClass, nme.GT, GT) - addPrimitives(FloatClass, nme.GE, GE) - // conversions - addPrimitives(FloatClass, nme.toByte, F2B) - addPrimitives(FloatClass, nme.toShort, F2S) - addPrimitives(FloatClass, nme.toChar, F2C) - addPrimitives(FloatClass, nme.toInt, F2I) - addPrimitives(FloatClass, nme.toLong, F2L) - addPrimitives(FloatClass, nme.toFloat, F2F) - addPrimitives(FloatClass, nme.toDouble, F2D) - // unary methods - addPrimitives(FloatClass, nme.UNARY_+, POS) - addPrimitives(FloatClass, nme.UNARY_-, NEG) - - // scala.Double - addPrimitives(DoubleClass, nme.EQ, EQ) - addPrimitives(DoubleClass, nme.NE, NE) - addPrimitives(DoubleClass, nme.ADD, ADD) - addPrimitives(DoubleClass, nme.SUB, SUB) - addPrimitives(DoubleClass, nme.MUL, MUL) - addPrimitives(DoubleClass, nme.DIV, DIV) - addPrimitives(DoubleClass, nme.MOD, MOD) - addPrimitives(DoubleClass, nme.LT, LT) - addPrimitives(DoubleClass, nme.LE, LE) - addPrimitives(DoubleClass, nme.GT, GT) - addPrimitives(DoubleClass, nme.GE, GE) - // conversions - addPrimitives(DoubleClass, nme.toByte, D2B) - addPrimitives(DoubleClass, nme.toShort, D2S) - addPrimitives(DoubleClass, nme.toChar, D2C) - addPrimitives(DoubleClass, nme.toInt, D2I) - addPrimitives(DoubleClass, nme.toLong, D2L) - addPrimitives(DoubleClass, nme.toFloat, D2F) - addPrimitives(DoubleClass, nme.toDouble, D2D) - // unary methods - addPrimitives(DoubleClass, nme.UNARY_+, POS) - addPrimitives(DoubleClass, nme.UNARY_-, NEG) - } // and the type map! initPrimitiveTypeMap } diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 2a0acc053b..b7bdf1de9d 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -1439,14 +1439,7 @@ abstract class GenICode extends SubComponent { * not using the rich equality is possible (their own equals method will do ok.)*/ def mustUseAnyComparator: Boolean = { def isBoxed(sym: Symbol): Boolean = - if (forCLDC) { - (sym isNonBottomSubClass definitions.ByteClass) || - (sym isNonBottomSubClass definitions.ShortClass) || - (sym isNonBottomSubClass definitions.CharClass) || - (sym isNonBottomSubClass definitions.IntClass) || - (sym isNonBottomSubClass definitions.LongClass) - } - else ((sym isNonBottomSubClass definitions.BoxedNumberClass) || + ((sym isNonBottomSubClass definitions.BoxedNumberClass) || (!forMSIL && (sym isNonBottomSubClass definitions.BoxedCharacterClass))) val lsym = l.tpe.typeSymbol diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index ed57ff06e0..a9fc518272 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -481,10 +481,8 @@ trait TypeKinds { self: ICodes => primitiveTypeMap += (definitions.CharClass -> CHAR) primitiveTypeMap += (definitions.IntClass -> INT) primitiveTypeMap += (definitions.LongClass -> LONG) - if (!forCLDC) { - primitiveTypeMap += (definitions.FloatClass -> FLOAT) - primitiveTypeMap += (definitions.DoubleClass -> DOUBLE) - } + primitiveTypeMap += (definitions.FloatClass -> FLOAT) + primitiveTypeMap += (definitions.DoubleClass -> DOUBLE) // primitiveTypeMap += (definitions.StringClass -> STRING) } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index ec58e71a50..bcadd07137 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -157,19 +157,18 @@ abstract class GenJVM extends SubComponent { if (parents.isEmpty) parents = definitions.ObjectClass.tpe :: parents; - if (!forCLDC) - for (attr <- c.symbol.attributes) attr match { - case AnnotationInfo(tp, _, _) if tp.typeSymbol == SerializableAttr => - parents = parents ::: List(definitions.SerializableClass.tpe) - case AnnotationInfo(tp, _, _) if tp.typeSymbol == CloneableAttr => - parents = parents ::: List(CloneableClass.tpe) - case AnnotationInfo(tp, value :: _, _) if tp.typeSymbol == SerialVersionUID => - serialVUID = Some(value.constant.get.longValue) - case AnnotationInfo(tp, _, _) if tp.typeSymbol == RemoteAttr => - parents = parents ::: List(RemoteInterface.tpe) - remoteClass = true - case _ => () - } + for (attr <- c.symbol.attributes) attr match { + case AnnotationInfo(tp, _, _) if tp.typeSymbol == SerializableAttr => + parents = parents ::: List(definitions.SerializableClass.tpe) + case AnnotationInfo(tp, _, _) if tp.typeSymbol == CloneableAttr => + parents = parents ::: List(CloneableClass.tpe) + case AnnotationInfo(tp, value :: _, _) if tp.typeSymbol == SerialVersionUID => + serialVUID = Some(value.constant.get.longValue) + case AnnotationInfo(tp, _, _) if tp.typeSymbol == RemoteAttr => + parents = parents ::: List(RemoteInterface.tpe) + remoteClass = true + case _ => () + } parents = parents.removeDuplicates @@ -614,15 +613,12 @@ abstract class GenJVM extends SubComponent { case _ => false } - if (remoteClass || - (meth.hasAttribute(RemoteAttr) - && jmethod.isPublic() - && !forCLDC)) { - val ainfo = AnnotationInfo(ThrowsAttr.tpe, List(new AnnotationArgument(Constant(RemoteException))), List()) - if (!meth.attributes.exists(isRemoteThrows)) { - meth.attributes = ainfo :: meth.attributes; - } + if (remoteClass || (meth.hasAttribute(RemoteAttr) && jmethod.isPublic())) { + val ainfo = AnnotationInfo(ThrowsAttr.tpe, List(new AnnotationArgument(Constant(RemoteException))), List()) + if (!meth.attributes.exists(isRemoteThrows)) { + meth.attributes = ainfo :: meth.attributes; } + } } diff --git a/src/compiler/scala/tools/nsc/doc/ModelFrames.scala b/src/compiler/scala/tools/nsc/doc/ModelFrames.scala index 8475502737..bd6c816ea8 100644 --- a/src/compiler/scala/tools/nsc/doc/ModelFrames.scala +++ b/src/compiler/scala/tools/nsc/doc/ModelFrames.scala @@ -28,10 +28,8 @@ trait ModelFrames extends ModelExtractor { SyntheticClasses ++= List( NothingClass, NullClass, AnyClass, AnyRefClass, AnyValClass, //value classes - BooleanClass, ByteClass, CharClass, IntClass, LongClass, ShortClass, UnitClass) - - if (!global.forCLDC) - SyntheticClasses ++= List(FloatClass, DoubleClass) + BooleanClass, ByteClass, CharClass, IntClass, LongClass, ShortClass, + FloatClass, DoubleClass, UnitClass) } val outdir = settings.outdir.value diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 03783d054c..fdad54ffcb 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -533,10 +533,10 @@ trait Definitions { val longtype = LongClass.typeConstructor val longparam = List(longtype) - val floattype = if (forCLDC) null else FloatClass.typeConstructor - val floatparam = if (forCLDC) null else List(floattype) - val doubletype = if (forCLDC) null else DoubleClass.typeConstructor - val doubleparam = if (forCLDC) null else List(doubletype) + val floattype = FloatClass.typeConstructor + val floatparam = List(floattype) + val doubletype = DoubleClass.typeConstructor + val doubleparam = List(doubletype) val stringtype = StringClass.typeConstructor @@ -579,10 +579,8 @@ trait Definitions { newParameterlessMethod(clazz, nme.toInt, inttype) newParameterlessMethod(clazz, nme.toLong, longtype) - if (!forCLDC) { - newParameterlessMethod(clazz, nme.toFloat, floattype) - newParameterlessMethod(clazz, nme.toDouble, doubletype) - } + newParameterlessMethod(clazz, nme.toFloat, floattype) + newParameterlessMethod(clazz, nme.toDouble, doubletype) // def +(s: String): String newMethod(clazz, nme.ADD, List(stringtype), stringtype) @@ -619,11 +617,10 @@ trait Definitions { addBinops(charparam, restype, isCardinal) addBinops(intparam, restype, isCardinal) addBinops(longparam, restype2, isCardinal) - if (!forCLDC) { - val restype3 = if (clazz eq DoubleClass) doubletype else floattype - addBinops(floatparam, restype3, false) - addBinops(doubleparam, doubletype, false) - } + + val restype3 = if (clazz eq DoubleClass) doubletype else floattype + addBinops(floatparam, restype3, false) + addBinops(doubleparam, doubletype, false) } initValueClass(ByteClass, true) @@ -631,10 +628,9 @@ trait Definitions { initValueClass(CharClass, true) initValueClass(IntClass, true) initValueClass(LongClass, true) - if (!forCLDC) { - initValueClass(FloatClass, false) - initValueClass(DoubleClass, false) - } + initValueClass(FloatClass, false) + initValueClass(DoubleClass, false) + def addModuleMethod(clazz: Symbol, name: Name, value: Any) { val owner = clazz.linkedClassOfClass newParameterlessMethod(owner, name, mkConstantType(Constant(value))) @@ -650,21 +646,19 @@ trait Definitions { addModuleMethod(LongClass, "MinValue", java.lang.Long.MIN_VALUE) addModuleMethod(LongClass, "MaxValue", java.lang.Long.MAX_VALUE) - if (!forCLDC) { - addModuleMethod(FloatClass, "MinValue", -java.lang.Float.MAX_VALUE) - addModuleMethod(FloatClass, "MaxValue", java.lang.Float.MAX_VALUE) - addModuleMethod(FloatClass, "Epsilon", java.lang.Float.MIN_VALUE) - addModuleMethod(FloatClass, "NaN", java.lang.Float.NaN) - addModuleMethod(FloatClass, "PositiveInfinity", java.lang.Float.POSITIVE_INFINITY) - addModuleMethod(FloatClass, "NegativeInfinity", java.lang.Float.NEGATIVE_INFINITY) - - addModuleMethod(DoubleClass, "MinValue", -java.lang.Double.MAX_VALUE) - addModuleMethod(DoubleClass, "MaxValue", java.lang.Double.MAX_VALUE) - addModuleMethod(DoubleClass, "Epsilon", java.lang.Double.MIN_VALUE) - addModuleMethod(DoubleClass, "NaN", java.lang.Double.NaN) - addModuleMethod(DoubleClass, "PositiveInfinity", java.lang.Double.POSITIVE_INFINITY) - addModuleMethod(DoubleClass, "NegativeInfinity", java.lang.Double.NEGATIVE_INFINITY) - } + addModuleMethod(FloatClass, "MinValue", -java.lang.Float.MAX_VALUE) + addModuleMethod(FloatClass, "MaxValue", java.lang.Float.MAX_VALUE) + addModuleMethod(FloatClass, "Epsilon", java.lang.Float.MIN_VALUE) + addModuleMethod(FloatClass, "NaN", java.lang.Float.NaN) + addModuleMethod(FloatClass, "PositiveInfinity", java.lang.Float.POSITIVE_INFINITY) + addModuleMethod(FloatClass, "NegativeInfinity", java.lang.Float.NEGATIVE_INFINITY) + + addModuleMethod(DoubleClass, "MinValue", -java.lang.Double.MAX_VALUE) + addModuleMethod(DoubleClass, "MaxValue", java.lang.Double.MAX_VALUE) + addModuleMethod(DoubleClass, "Epsilon", java.lang.Double.MIN_VALUE) + addModuleMethod(DoubleClass, "NaN", java.lang.Double.NaN) + addModuleMethod(DoubleClass, "PositiveInfinity", java.lang.Double.POSITIVE_INFINITY) + addModuleMethod(DoubleClass, "NegativeInfinity", java.lang.Double.NEGATIVE_INFINITY) } /** Is symbol a value class? */ @@ -740,10 +734,8 @@ trait Definitions { CharClass = newValueClass(nme.Char, 'C') IntClass = newValueClass(nme.Int, 'I') LongClass = newValueClass(nme.Long, 'L') - if (!forCLDC) { - FloatClass = newValueClass(nme.Float, 'F') - DoubleClass = newValueClass(nme.Double, 'D') - } + FloatClass = newValueClass(nme.Float, 'F') + DoubleClass = newValueClass(nme.Double, 'D') CodeClass = getClass(sn.Code) CodeModule = getModule(sn.Code) diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala index f19a8e5138..a0b559885a 100644 --- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala +++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala @@ -485,18 +485,7 @@ trait StdNames { final val Code = newTermName("scala.reflect.Code") } - private class CLDCNames extends JavaNames { - final val Serializable = nme.NOSYMBOL - final val BeanProperty = nme.NOSYMBOL - final val Code = nme.NOSYMBOL - final val Method = nme.NOSYMBOL - } - - private var sn0 : SymbolNames = _ - def sn: SymbolNames = { - if (sn0 == null) sn0 = if (forMSIL) new MSILNames - else if (forCLDC) new CLDCNames + lazy val sn: SymbolNames = + if (forMSIL) new MSILNames else new J2SENames - sn0 - } } diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala index 9fd93ab6ff..50cccd0f05 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala @@ -26,9 +26,6 @@ abstract class SymbolTable extends Names def rootLoader: LazyType def log(msg: AnyRef) - /** Are we compiling for the J2ME CLDC platform ? */ - def forCLDC: Boolean - /** Are we compiling for Java SE ? */ def forJVM: Boolean diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 23a5d858e9..f9bd2ea831 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -1446,12 +1446,6 @@ trait Symbols { extends Symbol(initOwner, initPos, initName) { override def isTerm = true -/* - val marker = initName.toString match { - case "forCLDC" => new MarkForCLDC - case _ => null - } -*/ privateWithin = NoSymbol protected var referenced: Symbol = NoSymbol @@ -1798,17 +1792,4 @@ trait Symbols { override def toString() = "TypeHistory(" + phaseOf(validFrom)+":"+runId(validFrom) + "," + info + "," + prev + ")" } -/* - var occs = 0 - -class MarkForCLDC { - val atRun: Int = currentRunId - occs += 1 - println("new "+getClass+" at "+atRun+" ("+occs+" total)") - override def finalize() { - occs -=1 - println("drop "+getClass+" from "+atRun+" ("+occs+" total)") - } -} -*/ } diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 5339bef080..d99518c6cf 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -39,11 +39,9 @@ abstract class CleanUp extends Transform { javaBoxClassModule(IntClass) = getModule("java.lang.Integer") javaBoxClassModule(CharClass) = getModule("java.lang.Character") javaBoxClassModule(LongClass) = getModule("java.lang.Long") - if (!forCLDC) { - javaBoxClassModule(FloatClass) = getModule("java.lang.Float") - javaBoxClassModule(DoubleClass) = getModule("java.lang.Double") - javaBoxClassModule(UnitClass) = getModule("java.lang.Void") - } + javaBoxClassModule(FloatClass) = getModule("java.lang.Float") + javaBoxClassModule(DoubleClass) = getModule("java.lang.Double") + javaBoxClassModule(UnitClass) = getModule("java.lang.Void") } private var localTyper: analyzer.Typer = null @@ -351,14 +349,7 @@ abstract class CleanUp extends Transform { def mayRequirePrimitiveReplacement: Boolean = { def isBoxed(sym: Symbol): Boolean = - if (forCLDC) { - (sym isNonBottomSubClass ByteClass) || - (sym isNonBottomSubClass ShortClass) || - (sym isNonBottomSubClass CharClass) || - (sym isNonBottomSubClass IntClass) || - (sym isNonBottomSubClass LongClass) - } - else ((sym isNonBottomSubClass BoxedNumberClass) || + ((sym isNonBottomSubClass BoxedNumberClass) || (!forMSIL && (sym isNonBottomSubClass BoxedCharacterClass))) val sym = qual.tpe.typeSymbol @@ -719,8 +710,7 @@ abstract class CleanUp extends Transform { val tpe = c.typeValue atPos(tree.pos) { localTyper.typed { - if ((isValueClass(tpe.typeSymbol) || tpe.typeSymbol == definitions.UnitClass) - && !forCLDC) + if (isValueClass(tpe.typeSymbol) || tpe.typeSymbol == definitions.UnitClass) Select(gen.mkAttributedRef(javaBoxClassModule(tpe.typeSymbol)), "TYPE") else tree } diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index d4e9136b1a..686824a7f5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -612,7 +612,7 @@ abstract class RefChecks extends InfoTransform { nonSensible("", false) else if (isNumericValueClass(receiver) && !isNumericValueClass(actual) && - !(forMSIL || forCLDC|| (actual isSubClass BoxedNumberClass)) && + !(forMSIL || (actual isSubClass BoxedNumberClass)) && !(receiver isSubClass actual)) nonSensible("", false) else if ((receiver hasFlag FINAL) && hasObjectEquals && !isValueClass(receiver) && diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index 22ad123aae..00468abc8e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -323,7 +323,7 @@ trait SyntheticMethods { self: Analyzer => // only for those that carry a @serializable annotation? if (!hasImplementation(nme.readResolve)) ts += readResolveMethod } - if (!forCLDC && !forMSIL) + if (!forMSIL) for (sym <- clazz.info.decls.toList) if (!sym.getAttributes(BeanPropertyAttr).isEmpty) if (sym.isGetter) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d43d09f79f..915786597c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1572,7 +1572,7 @@ trait Typers { self: Analyzer => * @return ... */ def typedFunction(fun: Function, mode: Int, pt: Type): Tree = { - val codeExpected = !forCLDC && !forMSIL && (pt.typeSymbol isNonBottomSubClass CodeClass) + val codeExpected = !forMSIL && (pt.typeSymbol isNonBottomSubClass CodeClass) if (fun.vparams.length > definitions.MaxFunctionArity) return errorTree(fun, "implementation restricts functions to " + definitions.MaxFunctionArity + " parameters") diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index 421df1b745..330ea4fd82 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -126,7 +126,7 @@ object scalac extends Command { CmdOption("target:", Argument("target")), SeqPara( "Specify which backend to use (" & Mono("jvm-1.5," & - "msil,cldc") & ").", + "msil") & ").", "The default value is " & Mono("\"jvm-1.5\"") & " (was " & Mono("\"jvm-1.4\"") & " up to Scala version 2.6.1).")), Definition( diff --git a/src/scala-lang.iml b/src/scala-lang.iml index dec0e11a53..d860a9ce0f 100644 --- a/src/scala-lang.iml +++ b/src/scala-lang.iml @@ -20,7 +20,6 @@ <sourceFolder url="file://$MODULE_DIR$/scalap" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/swing" isTestSource="false" /> <excludeFolder url="file://$MODULE_DIR$/android-library" /> - <excludeFolder url="file://$MODULE_DIR$/cldc-library" /> <excludeFolder url="file://$MODULE_DIR$/dotnet-library" /> <excludeFolder url="file://$MODULE_DIR$/mono" /> </content> diff --git a/test/files/cldc/randoms.check b/test/files/cldc/randoms.check deleted file mode 100644 index e73fdf3e4f..0000000000 --- a/test/files/cldc/randoms.check +++ /dev/null @@ -1 +0,0 @@ -Execution completed. diff --git a/test/files/cldc/randoms.scala b/test/files/cldc/randoms.scala deleted file mode 100644 index 5d3380fef9..0000000000 --- a/test/files/cldc/randoms.scala +++ /dev/null @@ -1,29 +0,0 @@ -import javax.microedition.lcdui._ -import javax.microedition.midlet.MIDlet - -class Test extends MIDlet with CommandListener { - - def startApp { - val display = Display.getDisplay(this) - - val mainForm = new Form("randoms") - mainForm append "Welcome to the world of MIDlets!" - mainForm append "(build with Scala)" - val rnd = new Random - for (i <- 0 until 10) mainForm append rnd.nextInt.toString - - val exitCommand = new Command("Exit", Command.EXIT, 0) - mainForm addCommand exitCommand - mainForm setCommandListener this - - display setCurrent mainForm - } - def pauseApp {} - - def destroyApp(unconditional: Boolean) {} - - def commandAction(c: Command, s: Displayable) { - if (c.getCommandType == Command.EXIT) - notifyDestroyed - } -} diff --git a/test/files/cli/test1/Main.check.scalac b/test/files/cli/test1/Main.check.scalac index 22020d918d..8465810d0b 100644 --- a/test/files/cli/test1/Main.check.scalac +++ b/test/files/cli/test1/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding <encoding> Specify character encoding used by source files -windowtitle <windowtitle> Specify window title of generated HTML documentation -documenttitle <documenttitle> Specify document title of generated HTML documentation - -target:<target> Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) + -target:<target> Specify which backend to use (jvm-1.5,msil) -migrate Assist in migrating from Scala version 1.0 -o <file> Name of the output assembly (only relevant with -target:msil) -r <path> List of assemblies referenced by the program (only relevant with -target:msil) diff --git a/test/files/cli/test2/Main.check.scalac b/test/files/cli/test2/Main.check.scalac index 22020d918d..8465810d0b 100644 --- a/test/files/cli/test2/Main.check.scalac +++ b/test/files/cli/test2/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding <encoding> Specify character encoding used by source files -windowtitle <windowtitle> Specify window title of generated HTML documentation -documenttitle <documenttitle> Specify document title of generated HTML documentation - -target:<target> Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) + -target:<target> Specify which backend to use (jvm-1.5,msil) -migrate Assist in migrating from Scala version 1.0 -o <file> Name of the output assembly (only relevant with -target:msil) -r <path> List of assemblies referenced by the program (only relevant with -target:msil) diff --git a/test/files/cli/test3/Main.check.scalac b/test/files/cli/test3/Main.check.scalac index 22020d918d..8465810d0b 100644 --- a/test/files/cli/test3/Main.check.scalac +++ b/test/files/cli/test3/Main.check.scalac @@ -15,7 +15,7 @@ where possible options include: -encoding <encoding> Specify character encoding used by source files -windowtitle <windowtitle> Specify window title of generated HTML documentation -documenttitle <documenttitle> Specify document title of generated HTML documentation - -target:<target> Specify which backend to use (jvm-1.5,jvm-1.4,msil,cldc) + -target:<target> Specify which backend to use (jvm-1.5,msil) -migrate Assist in migrating from Scala version 1.0 -o <file> Name of the output assembly (only relevant with -target:msil) -r <path> List of assemblies referenced by the program (only relevant with -target:msil) |