diff options
author | Paul Phillips <paulp@improving.org> | 2009-08-22 23:29:38 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-08-22 23:29:38 +0000 |
commit | cd36447b0af834fc6086acedf7625e513b9411d6 (patch) | |
tree | cd72a9b532cd81b57ed23910175db4fc793c615a | |
parent | a8edce124f7badd1570fa6a125b02ba654897c6a (diff) | |
download | scala-cd36447b0af834fc6086acedf7625e513b9411d6.tar.gz scala-cd36447b0af834fc6086acedf7625e513b9411d6.tar.bz2 scala-cd36447b0af834fc6086acedf7625e513b9411d6.zip |
A few straggler deprecations with straightforwa...
A few straggler deprecations with straightforward enough resolutions.
7 files changed, 12 insertions, 18 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 34338eaf03..4fad4d7bce 100755 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2413,7 +2413,7 @@ self => in.token == LBRACKET || //todo: remove in.token == AT || isModifier) { - stats ++ joinComment(List(topLevelTmplDef)) + stats ++= joinComment(List(topLevelTmplDef)) } else if (!isStatSep) { syntaxErrorOrIncomplete("expected class or object definition", true) } diff --git a/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala b/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala index 9ad4a9a5a7..ab32e69944 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala @@ -114,12 +114,12 @@ abstract class Checkers { def append(elems: List[BasicBlock]) = elems foreach appendBlock; def appendBlock(bl: BasicBlock) = - if ( !worklist.exists(bl.==) ) - worklist + bl; + if (!(worklist contains bl)) + worklist += bl in.clear; out.clear; code = c; - worklist + c.startBlock; + worklist += c.startBlock for (bl <- c.blocks) { in += (bl -> emptyStack) out += (bl -> emptyStack) diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index aa18d5226d..0461c5f0cc 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -2147,7 +2147,7 @@ abstract class GenICode extends SubComponent { locals -= l /** Return all locals that are in scope. */ - def varsInScope: Buffer[Local] = outer.varsInScope ++ locals + def varsInScope: Buffer[Local] = outer.varsInScope.clone() ++ locals override def toString() = outer.toString() + locals.mkString("[", ", ", "]") diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index a9747325e0..450ace6124 100755 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -212,7 +212,7 @@ trait JavaParsers extends JavaScanners { } def repsep[T <: Tree](p: () => T, sep: Int): List[T] = { - val buf = new ListBuffer[T] + p() + val buf = ListBuffer[T](p()) while (in.token == sep) { in.nextToken buf += p() @@ -456,7 +456,7 @@ trait JavaParsers extends JavaScanners { def bound(): Tree = atPos(in.currentPos) { - val buf = new ListBuffer[Tree] + typ() + val buf = ListBuffer[Tree](typ()) while (in.token == AMP) { in.nextToken buf += typ() @@ -577,7 +577,7 @@ trait JavaParsers extends JavaScanners { * these potential definitions are real or not. */ def fieldDecls(pos: Position, mods: Modifiers, tpt: Tree, name: Name): List[Tree] = { - val buf = new ListBuffer[Tree] + varDecl(pos, mods, tpt, name) + val buf = ListBuffer[Tree](varDecl(pos, mods, tpt, name)) val maybe = new ListBuffer[Tree] // potential variable definitions. while (in.token == COMMA) { in.nextToken diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index de8c005afa..6dd1996074 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -560,7 +560,7 @@ trait ParallelMatching extends ast.TreeDSL { val litMap = tags.zipWithIndex.reverse.foldLeft(IntMap.empty[List[Int]]) { // we reverse before the fold so the list can be built with :: - case (map, (tag, index)) => map.update(tag, index :: map.getOrElse(tag, Nil)) + case (map, (tag, index)) => map.updated(tag, index :: map.getOrElse(tag, Nil)) } (litMap, varMap) diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index fa796c4ab7..c3de8d6bd9 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -148,7 +148,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast. private def needsJavaSig(tp: Type) = !settings.Ynogenericsig.value && NeedsSigCollector.collect(tp) - private lazy val tagOfClass = new HashMap[Symbol,Char] + ( + private lazy val tagOfClass = Map[Symbol,Char]( ByteClass -> BYTE_TAG, CharClass -> CHAR_TAG, DoubleClass -> DOUBLE_TAG, diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index 081a4a4bd9..17a233d7bb 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -41,14 +41,8 @@ object ClassPath { } /** Split path using platform-dependent path separator */ - def splitPath(path: String): List[String] = { - val strtok = new StringTokenizer(path, File.pathSeparator) - val buf = new collection.mutable.ListBuffer[String] - while (strtok.hasMoreTokens()) { - buf + strtok.nextToken() - } - buf.toList - } + def splitPath(path: String): List[String] = + path split File.pathSeparator toList /** Expand path with expanding stars */ def expandPath(path: String): List[String] = splitPath(path).flatMap(expandStar(_)) |