diff options
395 files changed, 832 insertions, 845 deletions
diff --git a/src/actors-migration/scala/actors/Pattern.scala b/src/actors-migration/scala/actors/Pattern.scala index 26e9d1bb64..fa2db79152 100644 --- a/src/actors-migration/scala/actors/Pattern.scala +++ b/src/actors-migration/scala/actors/Pattern.scala @@ -1,7 +1,7 @@ package scala.actors import scala.concurrent.util.Duration -import language.implicitConversions +import scala.language.implicitConversions object pattern { @@ -23,4 +23,4 @@ class AskableActorRef(val ar: ActorRef) extends ActorRef { def forward(message: Any) = ar.forward(message) private[actors] def localActor: AbstractActor = ar.localActor -}
\ No newline at end of file +} diff --git a/src/actors-migration/scala/actors/StashingActor.scala b/src/actors-migration/scala/actors/StashingActor.scala index 8f96e1b002..29f370a3e2 100644 --- a/src/actors-migration/scala/actors/StashingActor.scala +++ b/src/actors-migration/scala/actors/StashingActor.scala @@ -3,7 +3,7 @@ package scala.actors import scala.collection._ import scala.concurrent.util.Duration import java.util.concurrent.TimeUnit -import language.implicitConversions +import scala.language.implicitConversions object StashingActor extends Combinators { implicit def mkBody[A](body: => A) = new InternalActor.Body[A] { diff --git a/src/actors-migration/scala/actors/Timeout.scala b/src/actors-migration/scala/actors/Timeout.scala index 7e400ab140..5540d2880e 100644 --- a/src/actors-migration/scala/actors/Timeout.scala +++ b/src/actors-migration/scala/actors/Timeout.scala @@ -10,7 +10,7 @@ package scala.actors import scala.concurrent.util.Duration import java.util.concurrent.TimeUnit -import language.implicitConversions +import scala.language.implicitConversions case class Timeout(duration: Duration) { def this(timeout: Long) = this(Duration(timeout, TimeUnit.MILLISECONDS)) diff --git a/src/actors/scala/actors/AbstractActor.scala b/src/actors/scala/actors/AbstractActor.scala index dec91859bb..fd11b9a0a8 100644 --- a/src/actors/scala/actors/AbstractActor.scala +++ b/src/actors/scala/actors/AbstractActor.scala @@ -8,7 +8,7 @@ package scala.actors -import language.higherKinds +import scala.language.higherKinds /** * @author Philipp Haller diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 0b1e7fb1e9..8869165062 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -10,7 +10,7 @@ package scala.actors import scala.util.control.ControlThrowable import java.util.{Timer, TimerTask} -import language.implicitConversions +import scala.language.implicitConversions /** * Provides functions for the definition of actors, as well as actor diff --git a/src/actors/scala/actors/CanReply.scala b/src/actors/scala/actors/CanReply.scala index 9bf0022247..92ab23dae1 100644 --- a/src/actors/scala/actors/CanReply.scala +++ b/src/actors/scala/actors/CanReply.scala @@ -8,7 +8,7 @@ package scala.actors -import language.higherKinds +import scala.language.higherKinds /** * Defines result-bearing message send operations. diff --git a/src/actors/scala/actors/Combinators.scala b/src/actors/scala/actors/Combinators.scala index dd704436fc..aef01b67a8 100644 --- a/src/actors/scala/actors/Combinators.scala +++ b/src/actors/scala/actors/Combinators.scala @@ -10,7 +10,7 @@ package scala.actors -import language.implicitConversions +import scala.language.implicitConversions private[actors] trait Combinators { diff --git a/src/actors/scala/actors/Future.scala b/src/actors/scala/actors/Future.scala index 735c13190b..0198e95ae1 100644 --- a/src/actors/scala/actors/Future.scala +++ b/src/actors/scala/actors/Future.scala @@ -174,7 +174,7 @@ object Futures { * or timeout + `System.currentTimeMillis()` is negative. */ def awaitAll(timeout: Long, fts: Future[Any]*): List[Option[Any]] = { - var resultsMap: collection.mutable.Map[Int, Option[Any]] = new collection.mutable.HashMap[Int, Option[Any]] + var resultsMap: scala.collection.mutable.Map[Int, Option[Any]] = new collection.mutable.HashMap[Int, Option[Any]] var cnt = 0 val mappedFts = fts.map(ft => diff --git a/src/actors/scala/actors/Reactor.scala b/src/actors/scala/actors/Reactor.scala index c962bb9d3d..11c910e577 100644 --- a/src/actors/scala/actors/Reactor.scala +++ b/src/actors/scala/actors/Reactor.scala @@ -12,7 +12,7 @@ package scala.actors import scala.actors.scheduler.{DelegatingScheduler, ExecutorScheduler, ForkJoinScheduler, ThreadPoolConfig} import java.util.concurrent.{ThreadPoolExecutor, TimeUnit, LinkedBlockingQueue} -import language.implicitConversions +import scala.language.implicitConversions private[actors] object Reactor { diff --git a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala index a7bf8ec2ba..59f4afccc4 100644 --- a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala +++ b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala @@ -10,7 +10,7 @@ package scala.actors package scheduler -import util.Properties.{ javaVersion, javaVmVendor, isJavaAtLeast, propIsSetTo, propOrNone } +import scala.util.Properties.{ javaVersion, javaVmVendor, isJavaAtLeast, propIsSetTo, propOrNone } /** * @author Erik Engbrecht diff --git a/src/build/InnerObjectTestGen.scala b/src/build/InnerObjectTestGen.scala index 5945bc17c7..b66112609c 100644 --- a/src/build/InnerObjectTestGen.scala +++ b/src/build/InnerObjectTestGen.scala @@ -1,4 +1,4 @@ -import collection.mutable +import scala.collection.mutable /** All contexts where objects can be embedded. */ object Contexts extends Enumeration { diff --git a/src/build/genprod.scala b/src/build/genprod.scala index 83a65e6876..b9511c1ad2 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -6,7 +6,7 @@ ** |/ ** \* */ -import language.postfixOps +import scala.language.postfixOps /** This program generates the ProductN, TupleN, FunctionN, * and AbstractFunctionN, where 0 <= N <= MAX_ARITY. diff --git a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala index 0a8a8d015d..77ac8c6581 100644 --- a/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala +++ b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala @@ -34,7 +34,7 @@ trait Infrastructure { val currentMacro: Symbol = expandee.symbol - val globalCache: collection.mutable.Map[Any, Any] = universe.analyzer.globalMacroCache + val globalCache: scala.collection.mutable.Map[Any, Any] = universe.analyzer.globalMacroCache - val cache: collection.mutable.Map[Any, Any] = universe.analyzer.perRunMacroCache.getOrElseUpdate(currentMacro, collection.mutable.Map[Any, Any]()) -}
\ No newline at end of file + val cache: scala.collection.mutable.Map[Any, Any] = universe.analyzer.perRunMacroCache.getOrElseUpdate(currentMacro, collection.mutable.Map[Any, Any]()) +} diff --git a/src/compiler/scala/reflect/macros/runtime/Parsers.scala b/src/compiler/scala/reflect/macros/runtime/Parsers.scala index 6d89b71f39..e4acf104e3 100644 --- a/src/compiler/scala/reflect/macros/runtime/Parsers.scala +++ b/src/compiler/scala/reflect/macros/runtime/Parsers.scala @@ -1,7 +1,7 @@ package scala.reflect.macros package runtime -import language.existentials +import scala.language.existentials import scala.tools.reflect.ToolBox import scala.tools.reflect.ToolBoxError @@ -22,4 +22,4 @@ trait Parsers { case class ParseError(val pos: Position, val msg: String) extends Throwable(msg) object ParseError extends ParseErrorExtractor -}
\ No newline at end of file +} diff --git a/src/compiler/scala/reflect/reify/package.scala b/src/compiler/scala/reflect/reify/package.scala index fab5699da6..a76f147dc4 100644 --- a/src/compiler/scala/reflect/reify/package.scala +++ b/src/compiler/scala/reflect/reify/package.scala @@ -1,6 +1,6 @@ package scala.reflect -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.base.{Universe => BaseUniverse} import scala.reflect.macros.{Context, ReificationError, UnexpectedReificationError} import scala.tools.nsc.Global diff --git a/src/compiler/scala/tools/ant/ClassloadVerify.scala b/src/compiler/scala/tools/ant/ClassloadVerify.scala index 33a20f6894..d1d557b9d3 100644 --- a/src/compiler/scala/tools/ant/ClassloadVerify.scala +++ b/src/compiler/scala/tools/ant/ClassloadVerify.scala @@ -10,7 +10,7 @@ package scala.tools.ant import org.apache.tools.ant.Project import org.apache.tools.ant.types.{Path, Reference} -import collection.JavaConverters._ +import scala.collection.JavaConverters._ import scala.tools.util.VerifyClass class ClassloadVerify extends ScalaMatchingTask { diff --git a/src/compiler/scala/tools/ant/sabbus/Compilers.scala b/src/compiler/scala/tools/ant/sabbus/Compilers.scala index 843ee043ea..bb32149a75 100644 --- a/src/compiler/scala/tools/ant/sabbus/Compilers.scala +++ b/src/compiler/scala/tools/ant/sabbus/Compilers.scala @@ -11,7 +11,7 @@ package scala.tools.ant.sabbus import java.net.URL -object Compilers extends collection.DefaultMap[String, Compiler] { +object Compilers extends scala.collection.DefaultMap[String, Compiler] { val debug = false diff --git a/src/compiler/scala/tools/cmd/Property.scala b/src/compiler/scala/tools/cmd/Property.scala index aae5bebcc8..bde7bb8cb8 100644 --- a/src/compiler/scala/tools/cmd/Property.scala +++ b/src/compiler/scala/tools/cmd/Property.scala @@ -64,7 +64,7 @@ trait Property extends Reference { propertiesToOptions(loadProperties(file)) def propertiesToOptions(props: java.util.Properties): List[String] = { - import collection.JavaConversions._ + import scala.collection.JavaConversions._ propertiesToOptions(props.toList) } def propertiesToOptions(props: List[(String, String)]) = props flatMap propMapper diff --git a/src/compiler/scala/tools/cmd/Reference.scala b/src/compiler/scala/tools/cmd/Reference.scala index 77fe01051e..b6c564e9fb 100644 --- a/src/compiler/scala/tools/cmd/Reference.scala +++ b/src/compiler/scala/tools/cmd/Reference.scala @@ -6,7 +6,7 @@ package scala.tools package cmd -import collection.mutable.ListBuffer +import scala.collection.mutable.ListBuffer import nsc.Properties.envOrNone /** Mixes in the specification trait and uses the vals therein to diff --git a/src/compiler/scala/tools/cmd/gen/AnyVals.scala b/src/compiler/scala/tools/cmd/gen/AnyVals.scala index 3f8283590c..b4f5641b98 100644 --- a/src/compiler/scala/tools/cmd/gen/AnyVals.scala +++ b/src/compiler/scala/tools/cmd/gen/AnyVals.scala @@ -281,7 +281,7 @@ trait AnyValTemplates { %s package scala -import language.implicitConversions +import scala.language.implicitConversions """.trim.format(timestampString) + "\n\n") diff --git a/src/compiler/scala/tools/cmd/gen/Codegen.scala b/src/compiler/scala/tools/cmd/gen/Codegen.scala index b94c640f1c..ff3d41c8b7 100644 --- a/src/compiler/scala/tools/cmd/gen/Codegen.scala +++ b/src/compiler/scala/tools/cmd/gen/Codegen.scala @@ -6,7 +6,7 @@ package scala.tools.cmd package gen -import language.postfixOps +import scala.language.postfixOps class Codegen(args: List[String]) extends { val parsed = CodegenSpec(args: _*) diff --git a/src/compiler/scala/tools/nsc/EvalLoop.scala b/src/compiler/scala/tools/nsc/EvalLoop.scala index da03419d8a..bd1381faf5 100644 --- a/src/compiler/scala/tools/nsc/EvalLoop.scala +++ b/src/compiler/scala/tools/nsc/EvalLoop.scala @@ -5,7 +5,7 @@ package scala.tools.nsc -import annotation.tailrec +import scala.annotation.tailrec import java.io.EOFException trait EvalLoop { diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 9e3f47e8fb..6fb6b1736b 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -7,7 +7,7 @@ package scala.tools.nsc import java.io.{ File, FileOutputStream, PrintWriter, IOException, FileNotFoundException } import java.nio.charset.{ Charset, CharsetDecoder, IllegalCharsetNameException, UnsupportedCharsetException } -import compat.Platform.currentTime +import scala.compat.Platform.currentTime import scala.tools.util.PathResolver import scala.collection.{ mutable, immutable } import io.{ SourceReader, AbstractFile, Path } @@ -29,8 +29,8 @@ import backend.{ ScalaPrimitives, Platform, MSILPlatform, JavaPlatform } import backend.jvm.{GenJVM, GenASM} import backend.opt.{ Inliners, InlineExceptionHandlers, ClosureElimination, DeadCodeElimination } import backend.icode.analysis._ -import language.postfixOps -import reflect.internal.StdAttachments +import scala.language.postfixOps +import scala.reflect.internal.StdAttachments import scala.reflect.ClassTag class Global(var currentSettings: Settings, var reporter: Reporter) @@ -940,7 +940,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) reSync(RootClass, Some(classPath), Some(oldEntries), Some(newEntries), invalidated, failed) } } - def show(msg: String, syms: collection.Traversable[Symbol]) = + def show(msg: String, syms: scala.collection.Traversable[Symbol]) = if (syms.nonEmpty) informProgress(s"$msg: ${syms map (_.fullName) mkString ","}") show("invalidated packages", invalidated) diff --git a/src/compiler/scala/tools/nsc/PhaseAssembly.scala b/src/compiler/scala/tools/nsc/PhaseAssembly.scala index e69382be21..46cdc6a4a0 100644 --- a/src/compiler/scala/tools/nsc/PhaseAssembly.scala +++ b/src/compiler/scala/tools/nsc/PhaseAssembly.scala @@ -8,7 +8,7 @@ package scala.tools.nsc import java.io.{ BufferedWriter, FileWriter } import scala.collection.mutable -import language.postfixOps +import scala.language.postfixOps /** * PhaseAssembly diff --git a/src/compiler/scala/tools/nsc/Phases.scala b/src/compiler/scala/tools/nsc/Phases.scala index d2274b108b..c80be474a6 100644 --- a/src/compiler/scala/tools/nsc/Phases.scala +++ b/src/compiler/scala/tools/nsc/Phases.scala @@ -6,8 +6,8 @@ package scala.tools.nsc import symtab.Flags -import reflect.internal.util.TableDef -import language.postfixOps +import scala.reflect.internal.util.TableDef +import scala.language.postfixOps object Phases { val MaxPhases = 64 diff --git a/src/compiler/scala/tools/nsc/ast/NodePrinters.scala b/src/compiler/scala/tools/nsc/ast/NodePrinters.scala index 0b54eda66d..d1faa4d219 100644 --- a/src/compiler/scala/tools/nsc/ast/NodePrinters.scala +++ b/src/compiler/scala/tools/nsc/ast/NodePrinters.scala @@ -6,9 +6,9 @@ package scala.tools.nsc package ast -import compat.Platform.EOL +import scala.compat.Platform.EOL import symtab.Flags._ -import language.postfixOps +import scala.language.postfixOps /** The object `nodePrinter` converts the internal tree * representation to a string. diff --git a/src/compiler/scala/tools/nsc/ast/Printers.scala b/src/compiler/scala/tools/nsc/ast/Printers.scala index 885fc3f518..3392b78595 100644 --- a/src/compiler/scala/tools/nsc/ast/Printers.scala +++ b/src/compiler/scala/tools/nsc/ast/Printers.scala @@ -10,7 +10,7 @@ import java.io.{ OutputStream, PrintWriter, StringWriter, Writer } import symtab.Flags._ import symtab.SymbolTable -trait Printers extends reflect.internal.Printers { this: Global => +trait Printers extends scala.reflect.internal.Printers { this: Global => import treeInfo.{ IsTrue, IsFalse } diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index 043834ae55..267a5dcefd 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -18,7 +18,7 @@ import scala.concurrent.Lock import scala.text._ import symtab.Flags._ import symtab.SymbolTable -import language.implicitConversions +import scala.language.implicitConversions /** * Tree browsers can show the AST in a graphical and interactive diff --git a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala index e90d779885..01bd0bbb06 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala @@ -9,7 +9,7 @@ package ast import PartialFunction._ import symtab.Flags -import language.implicitConversions +import scala.language.implicitConversions /** A DSL for generating scala code. The goal is that the * code generating code should look a lot like the code it diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index b22681e52b..fc8228f644 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -9,12 +9,12 @@ package ast import scala.collection.mutable.ListBuffer import symtab.Flags._ import symtab.SymbolTable -import language.postfixOps +import scala.language.postfixOps /** XXX to resolve: TreeGen only assumes global is a SymbolTable, but * TreeDSL at the moment expects a Global. Can we get by with SymbolTable? */ -abstract class TreeGen extends reflect.internal.TreeGen with TreeDSL { +abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL { val global: Global import global._ diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala index e755553e25..9e46155d14 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala @@ -6,8 +6,8 @@ package scala.tools.nsc package ast -import reflect.internal.HasFlags -import reflect.internal.Flags._ +import scala.reflect.internal.HasFlags +import scala.reflect.internal.Flags._ import symtab._ /** This class ... @@ -15,7 +15,7 @@ import symtab._ * @author Martin Odersky * @version 1.0 */ -abstract class TreeInfo extends reflect.internal.TreeInfo { +abstract class TreeInfo extends scala.reflect.internal.TreeInfo { val global: Global import global._ diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index bd5c9b2f68..4e643e6f32 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -15,7 +15,7 @@ import scala.reflect.internal.Flags.PRESUPER import scala.reflect.internal.Flags.TRAIT import scala.compat.Platform.EOL -trait Trees extends reflect.internal.Trees { self: Global => +trait Trees extends scala.reflect.internal.Trees { self: Global => def treeLine(t: Tree): String = if (t.pos.isDefined && t.pos.isRange) t.pos.lineContent.drop(t.pos.column - 1).take(t.pos.end - t.pos.start + 1) diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala index 146329183c..9466b7222d 100755 --- a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala @@ -7,11 +7,11 @@ package scala.tools.nsc package ast.parser import scala.collection.{ mutable, immutable } -import xml.{ EntityRef, Text } -import xml.XML.{ xmlns } +import scala.xml.{ EntityRef, Text } +import scala.xml.XML.{ xmlns } import symtab.Flags.MUTABLE import scala.reflect.internal.util.StringOps.splitWhere -import language.implicitConversions +import scala.language.implicitConversions /** This class builds instance of `Tree` that represent XML. * @@ -144,7 +144,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) { (buf map convertToTextPat).toList def parseAttribute(pos: Position, s: String): Tree = { - val ts = xml.Utility.parseAttributeValue(s) map { + val ts = scala.xml.Utility.parseAttributeValue(s) map { case Text(s) => text(pos, s) case EntityRef(s) => entityRef(pos, s) } diff --git a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala index 7e7972f9dd..9ce74b2b17 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package ast.parser -import annotation.switch +import scala.annotation.switch /** Common code between JavaTokens and Tokens. Not as much (and not as concrete) * as one might like because JavaTokens for no clear reason chose new numbers for diff --git a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala index 486a43614b..06492e4ac6 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala @@ -11,7 +11,7 @@ import scala.collection.{ mutable, immutable } import mutable.{ ListBuffer, ArrayBuffer } import scala.reflect.internal.util.{ Position, NoPosition } import backend.icode.analysis.ProgramPoint -import language.postfixOps +import scala.language.postfixOps trait BasicBlocks { self: ICodes => diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 24662e2ac3..bab658e141 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -13,7 +13,7 @@ import scala.collection.mutable.{ ListBuffer, Buffer } import scala.tools.nsc.symtab._ import scala.annotation.switch import PartialFunction._ -import language.postfixOps +import scala.language.postfixOps /** This class ... * diff --git a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala index 1c5c9224f2..4739750daa 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala @@ -231,7 +231,7 @@ trait Linearizers { val handlersByCovered = m.exh.groupBy(_.covered) // number of basic blocks covered by the entire try-catch expression - def size(covered: collection.immutable.Set[BasicBlock]) = { + def size(covered: scala.collection.immutable.Set[BasicBlock]) = { val hs = handlersByCovered(covered) covered.size + (hs :\ 0)((h, s) => h.blocks.length + s) } diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala index 6bd3ac5791..31c2077097 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala @@ -640,7 +640,7 @@ abstract class TypeFlowAnalysis { For each of them, its `lastInstruction` (after which no more typeflows are needed) is found. */ - def reinit(m: icodes.IMethod, staleOut: List[BasicBlock], inlined: collection.Set[BasicBlock], staleIn: collection.Set[BasicBlock]) { + def reinit(m: icodes.IMethod, staleOut: List[BasicBlock], inlined: scala.collection.Set[BasicBlock], staleIn: scala.collection.Set[BasicBlock]) { if (this.method == null || this.method.symbol != m.symbol) { init(m) return @@ -691,7 +691,7 @@ abstract class TypeFlowAnalysis { bs foreach enqueue } - private def blankOut(blocks: collection.Set[BasicBlock]) { + private def blankOut(blocks: scala.collection.Set[BasicBlock]) { blocks foreach { b => in(b) = typeFlowLattice.bottom out(b) = typeFlowLattice.bottom diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala index 485864d8e3..ef3e82a75a 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala @@ -12,7 +12,7 @@ import scala.tools.nsc.util.ScalaClassLoader import scala.tools.util.JavapClass import java.util.jar.{ JarEntry, JarOutputStream, Attributes } import Attributes.Name -import language.postfixOps +import scala.language.postfixOps /** For the last mile: turning generated bytecode in memory into * something you can use. Has implementations for writing to class diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index ea0a0148e4..1653ca9c2a 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -2044,12 +2044,12 @@ abstract class GenASM extends SubComponent with BytecodeWriters { var isModuleInitialized = false - val labels: collection.Map[BasicBlock, asm.Label] = mutable.HashMap(linearization map (_ -> new asm.Label()) : _*) + val labels: scala.collection.Map[BasicBlock, asm.Label] = mutable.HashMap(linearization map (_ -> new asm.Label()) : _*) val onePastLast = new asm.Label // token for the mythical instruction past the last instruction in the method being emitted // maps a BasicBlock b to the Label that corresponds to b's successor in the linearization. The last BasicBlock is mapped to the onePastLast label. - val linNext: collection.Map[BasicBlock, asm.Label] = { + val linNext: scala.collection.Map[BasicBlock, asm.Label] = { val result = mutable.HashMap.empty[BasicBlock, asm.Label] var rest = linearization var prev = rest.head @@ -2227,7 +2227,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } } - def getMerged(): collection.Map[Local, List[Interval]] = { + def getMerged(): scala.collection.Map[Local, List[Interval]] = { // TODO should but isn't: unbalanced start(s) of scope(s) val shouldBeEmpty = pending filter { p => val Pair(k, st) = p; st.nonEmpty }; val merged = mutable.Map[Local, List[Interval]]() @@ -2412,7 +2412,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { import asm.Opcodes (instr.category: @scala.annotation.switch) match { - case icodes.localsCat => + case icodes.localsCat => def genLocalInstr = (instr: @unchecked) match { case THIS(_) => jmethod.visitVarInsn(Opcodes.ALOAD, 0) case LOAD_LOCAL(local) => jcode.load(indexOf(local), local.kind) @@ -2445,7 +2445,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genLocalInstr - case icodes.stackCat => + case icodes.stackCat => def genStackInstr = (instr: @unchecked) match { case LOAD_MODULE(module) => @@ -2473,7 +2473,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case icodes.arilogCat => genPrimitive(instr.asInstanceOf[CALL_PRIMITIVE].primitive, instr.pos) - case icodes.castsCat => + case icodes.castsCat => def genCastInstr = (instr: @unchecked) match { case IS_INSTANCE(tpe) => @@ -2503,7 +2503,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genCastInstr - case icodes.objsCat => + case icodes.objsCat => def genObjsInstr = (instr: @unchecked) match { case BOX(kind) => @@ -2523,7 +2523,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genObjsInstr - case icodes.fldsCat => + case icodes.fldsCat => def genFldsInstr = (instr: @unchecked) match { case lf @ LOAD_FIELD(field, isStatic) => @@ -2544,7 +2544,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genFldsInstr - case icodes.mthdsCat => + case icodes.mthdsCat => def genMethodsInstr = (instr: @unchecked) match { /** Special handling to access native Array.clone() */ @@ -2557,7 +2557,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genMethodsInstr - case icodes.arraysCat => + case icodes.arraysCat => def genArraysInstr = (instr: @unchecked) match { case LOAD_ARRAY_ITEM(kind) => jcode.aload(kind) case STORE_ARRAY_ITEM(kind) => jcode.astore(kind) @@ -2566,7 +2566,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genArraysInstr - case icodes.jumpsCat => + case icodes.jumpsCat => def genJumpInstr = (instr: @unchecked) match { case sw @ SWITCH(tagss, branches) => @@ -2696,7 +2696,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genJumpInstr - case icodes.retCat => + case icodes.retCat => def genRetInstr = (instr: @unchecked) match { case RETURN(kind) => jcode emitRETURN kind case THROW(_) => emit(Opcodes.ATHROW) @@ -2816,9 +2816,9 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // TODO Logical's 2nd elem should be declared ValueTypeKind, to better approximate its allowed values (isIntSized, its comments appears to convey) // TODO GenICode uses `toTypeKind` to define that elem, `toValueTypeKind` would be needed instead. // TODO How about adding some asserts to Logical and similar ones to capture the remaining constraint (UNIT not allowed). - case Logical(op, kind) => + case Logical(op, kind) => def genLogical = op match { - case AND => + case AND => kind match { case LONG => emit(Opcodes.LAND) case INT => emit(Opcodes.IAND) @@ -2844,8 +2844,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } } genLogical - - case Shift(op, kind) => + + case Shift(op, kind) => def genShift = op match { case LSL => kind match { @@ -2874,7 +2874,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } genShift - case Comparison(op, kind) => + case Comparison(op, kind) => def genCompare = op match { case CMP => (kind: @unchecked) match { @@ -2889,7 +2889,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { (kind: @unchecked) match { case FLOAT => emit(Opcodes.FCMPG) case DOUBLE => emit(Opcodes.DCMPL) // TODO bug? why not DCMPG? http://docs.oracle.com/javase/specs/jvms/se5.0/html/Instructions2.doc3.html - + } } genCompare diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 0f64a55d70..a2151633a7 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -18,7 +18,7 @@ import JAccessFlags._ import JObjectType.{ JAVA_LANG_STRING, JAVA_LANG_OBJECT } import java.util.jar.{ JarEntry, JarOutputStream } import scala.tools.nsc.io.AbstractFile -import language.postfixOps +import scala.language.postfixOps /** This class ... * diff --git a/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala b/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala index 465a0c61e8..f56aa74d53 100644 --- a/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala +++ b/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala @@ -15,7 +15,7 @@ import scala.tools.nsc.symtab._ import ch.epfl.lamp.compiler.msil.{Type => MsilType, _} import ch.epfl.lamp.compiler.msil.emit._ import ch.epfl.lamp.compiler.msil.util.PECustomMod -import language.postfixOps +import scala.language.postfixOps abstract class GenMSIL extends SubComponent { import global._ diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala index 62bb23c3a7..e9fb060dda 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala @@ -746,7 +746,7 @@ abstract class Inliners extends SubComponent { toBecomePublic: List[Symbol] ) - final class CallerCalleeInfo(val caller: IMethodInfo, val inc: IMethodInfo, fresh: mutable.Map[String, Int], inlinedMethodCount: collection.Map[Symbol, Int]) { + final class CallerCalleeInfo(val caller: IMethodInfo, val inc: IMethodInfo, fresh: mutable.Map[String, Int], inlinedMethodCount: scala.collection.Map[Symbol, Int]) { assert(!caller.isBridge && inc.m.hasCode, "A guard in Inliner.analyzeClass() should have prevented from getting here.") diff --git a/src/compiler/scala/tools/nsc/dependencies/Changes.scala b/src/compiler/scala/tools/nsc/dependencies/Changes.scala index 176c00c025..7f5f412a20 100644 --- a/src/compiler/scala/tools/nsc/dependencies/Changes.scala +++ b/src/compiler/scala/tools/nsc/dependencies/Changes.scala @@ -3,7 +3,7 @@ package dependencies import symtab.Flags -import collection._ +import scala.collection._ /** A component that describes the possible changes between successive * compilations of a class. diff --git a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala index 317cc28298..cdde768274 100644 --- a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala +++ b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala @@ -2,7 +2,7 @@ package scala.tools.nsc package dependencies import io.Path -import collection._ +import scala.collection._ import symtab.Flags import scala.tools.nsc.io.AbstractFile import scala.reflect.internal.util.SourceFile diff --git a/src/compiler/scala/tools/nsc/doc/Settings.scala b/src/compiler/scala/tools/nsc/doc/Settings.scala index 60cd375175..f5df772d7d 100644 --- a/src/compiler/scala/tools/nsc/doc/Settings.scala +++ b/src/compiler/scala/tools/nsc/doc/Settings.scala @@ -8,7 +8,7 @@ package doc import java.io.File import java.lang.System -import language.postfixOps +import scala.language.postfixOps /** An extended version of compiler settings, with additional Scaladoc-specific options. * @param error A function that prints a string to the appropriate error stream diff --git a/src/compiler/scala/tools/nsc/doc/Uncompilable.scala b/src/compiler/scala/tools/nsc/doc/Uncompilable.scala index 7e57f9fd9f..812b62a1c6 100644 --- a/src/compiler/scala/tools/nsc/doc/Uncompilable.scala +++ b/src/compiler/scala/tools/nsc/doc/Uncompilable.scala @@ -5,8 +5,8 @@ package scala.tools.nsc package doc -import language.implicitConversions -import language.postfixOps +import scala.language.implicitConversions +import scala.language.postfixOps /** Some glue between DocParser (which reads source files which can't be compiled) * and the scaladoc model. diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala index 7a74c569f3..f7c5611b8a 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala @@ -10,8 +10,8 @@ package html import model._ import comment._ -import xml.{XML, NodeSeq} -import xml.dtd.{DocType, PublicID} +import scala.xml.{XML, NodeSeq} +import scala.xml.dtd.{DocType, PublicID} import scala.collection._ import java.io.Writer @@ -87,7 +87,7 @@ abstract class HtmlPage extends Page { thisPage => case Title(in, _) => <h6>{ inlineToHtml(in) }</h6> case Paragraph(in) => <p>{ inlineToHtml(in) }</p> case Code(data) => - <pre>{ SyntaxHigh(data) }</pre> //<pre>{ xml.Text(data) }</pre> + <pre>{ SyntaxHigh(data) }</pre> //<pre>{ scala.xml.Text(data) }</pre> case UnorderedList(items) => <ul>{ listItemsToHtml(items) }</ul> case OrderedList(items, listStyle) => @@ -119,9 +119,9 @@ abstract class HtmlPage extends Page { thisPage => case Subscript(in) => <sub>{ inlineToHtml(in) }</sub> case Link(raw, title) => <a href={ raw }>{ inlineToHtml(title) }</a> case Monospace(in) => <code>{ inlineToHtml(in) }</code> - case Text(text) => xml.Text(text) + case Text(text) => scala.xml.Text(text) case Summary(in) => inlineToHtml(in) - case HtmlTag(tag) => xml.Unparsed(tag) + case HtmlTag(tag) => scala.xml.Unparsed(tag) case EntityLink(target, link) => linkToHtml(target, link, true) } @@ -158,11 +158,11 @@ abstract class HtmlPage extends Page { thisPage => if (starts.isEmpty && (inPos == string.length)) NodeSeq.Empty else if (starts.isEmpty) - xml.Text(string.slice(inPos, string.length)) + scala.xml.Text(string.slice(inPos, string.length)) else if (inPos == starts.head) toLinksIn(inPos, starts) else { - xml.Text(string.slice(inPos, starts.head)) ++ toLinksIn(starts.head, starts) + scala.xml.Text(string.slice(inPos, starts.head)) ++ toLinksIn(starts.head, starts) } } def toLinksIn(inPos: Int, starts: List[Int]): NodeSeq = { @@ -173,7 +173,7 @@ abstract class HtmlPage extends Page { thisPage => if (hasLinks) toLinksOut(0, tpe.refEntity.keySet.toList) else - xml.Text(string) + scala.xml.Text(string) } def typesToHtml(tpess: List[model.TypeEntity], hasLinks: Boolean, sep: NodeSeq): NodeSeq = tpess match { @@ -192,10 +192,10 @@ abstract class HtmlPage extends Page { thisPage => if (hasPage(dTpl)) { <a href={ relativeLinkTo(dTpl) } class="extype" name={ dTpl.qualifiedName }>{ if (name eq null) dTpl.name else name }</a> } else { - xml.Text(if (name eq null) dTpl.name else name) + scala.xml.Text(if (name eq null) dTpl.name else name) } case ndTpl: NoDocTemplate => - xml.Text(if (name eq null) ndTpl.name else name) + scala.xml.Text(if (name eq null) ndTpl.name else name) } /** Returns the HTML code that represents the templates in `tpls` as a list of hyperlinked names. */ diff --git a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala index 9b0765e394..e21ee07963 100644 --- a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala +++ b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala @@ -5,7 +5,7 @@ package scala.tools.nsc.doc.html -import xml.NodeSeq +import scala.xml.NodeSeq /** Highlight the syntax of Scala code appearing in a `{{{` wiki block * (see method `HtmlPage.blockToHtml`). @@ -281,6 +281,6 @@ private[html] object SyntaxHigh { } parse("", 0) - xml.Unparsed(out.toString) + scala.xml.Unparsed(out.toString) } } diff --git a/src/compiler/scala/tools/nsc/doc/html/page/ReferenceIndex.scala b/src/compiler/scala/tools/nsc/doc/html/page/ReferenceIndex.scala index 6d83b4e6a5..cd76f84a37 100755 --- a/src/compiler/scala/tools/nsc/doc/html/page/ReferenceIndex.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/ReferenceIndex.scala @@ -44,7 +44,7 @@ class ReferenceIndex(letter: Char, index: doc.Index, universe: Universe) extends <strike>{ name }</strike> }</div> <div class="occurrences">{ - for (owner <- occurrences) yield owner ++ xml.Text(" ") + for (owner <- occurrences) yield owner ++ scala.xml.Text(" ") }</div> </div> } diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Source.scala b/src/compiler/scala/tools/nsc/doc/html/page/Source.scala index a51d66c6cc..edc0736400 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Source.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Source.scala @@ -10,7 +10,7 @@ package page import model._ import comment._ -import xml.{NodeSeq, Unparsed} +import scala.xml.{NodeSeq, Unparsed} import java.io.File class Source(sourceFile: File) extends HtmlPage { diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index 24a26b2ad3..d4e52ba120 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -13,7 +13,7 @@ import model.diagram._ import diagram._ import scala.xml.{ NodeSeq, Text, UnprefixedAttribute } -import language.postfixOps +import scala.language.postfixOps import model._ import model.diagram._ @@ -51,7 +51,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp var hash = '{ val p = templateToPath(tpl); (p.tail.reverse ::: List(p.head.replace(".html", ""))).mkString(".") }'; var anchor = window.location.hash; var anchor_opt = ''; - if (anchor.length { scala.xml.Unparsed(">=") /* unless we use Unparsed, it gets escaped and crashes the script */ } 1) + if (anchor.length { scala.xml.Unparsed(">=") /* unless we use Unparsed, it gets escaped and crashes the script */ } 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; }} @@ -93,7 +93,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp if (tpl.isRootPackage || tpl.inTemplate.isRootPackage) NodeSeq.Empty else - <p id="owner">{ templatesToHtml(tpl.inTemplate.toRoot.reverse.tail, xml.Text(".")) }</p> + <p id="owner">{ templatesToHtml(tpl.inTemplate.toRoot.reverse.tail, scala.xml.Text(".")) }</p> } <body class={ if (tpl.isType) "type" else "value" }> @@ -152,7 +152,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp <div id="ancestors"> <span class="filtertype">Implicitly<br/> </span> - <ol id="implicits"> { + <ol id="implicits"> { tpl.conversions.map { conv => val name = conv.conversionQualifiedName val hide = universe.settings.hiddenImplicits(name) @@ -415,14 +415,14 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp case Nil => NodeSeq.Empty case List(constraint) => - xml.Text("This conversion will take place only if ") ++ constraintToHtml(constraint) ++ xml.Text(".") + scala.xml.Text("This conversion will take place only if ") ++ constraintToHtml(constraint) ++ scala.xml.Text(".") case List(constraint1, constraint2) => - xml.Text("This conversion will take place only if ") ++ constraintToHtml(constraint1) ++ - xml.Text(" and at the same time ") ++ constraintToHtml(constraint2) ++ xml.Text(".") + scala.xml.Text("This conversion will take place only if ") ++ constraintToHtml(constraint1) ++ + scala.xml.Text(" and at the same time ") ++ constraintToHtml(constraint2) ++ scala.xml.Text(".") case constraints => <br/> ++ "This conversion will take place only if all of the following constraints are met:" ++ <br/> ++ { var index = 0 - constraints map { constraint => xml.Text({ index += 1; index } + ". ") ++ constraintToHtml(constraint) ++ <br/> } + constraints map { constraint => scala.xml.Text({ index += 1; index } + ". ") ++ constraintToHtml(constraint) ++ <br/> } } } @@ -440,18 +440,18 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp case d: Def => d.valueParams map (_ map (_ name) mkString("(", ", ", ")")) mkString case _ => "" // no parameters } - <br/> ++ xml.Text("To access this member you can use a ") ++ + <br/> ++ scala.xml.Text("To access this member you can use a ") ++ <a href="http://stackoverflow.com/questions/2087250/what-is-the-purpose-of-type-ascription-in-scala" - target="_blank">type ascription</a> ++ xml.Text(":") ++ + target="_blank">type ascription</a> ++ scala.xml.Text(":") ++ <br/> ++ <div class="cmt"><pre>{"(" + Template.lowerFirstLetter(tpl.name) + ": " + conv.targetType.name + ")." + mbr.name + params }</pre></div> } val shadowingWarning: NodeSeq = if (mbr.isShadowedImplicit) - xml.Text("This implicitly inherited member is shadowed by one or more members in this " + + scala.xml.Text("This implicitly inherited member is shadowed by one or more members in this " + "class.") ++ shadowingSuggestion else if (mbr.isAmbiguousImplicit) - xml.Text("This implicitly inherited member is ambiguous. One or more implicitly " + + scala.xml.Text("This implicitly inherited member is ambiguous. One or more implicitly " + "inherited members have similar signatures, so calling this member may produce an ambiguous " + "implicit conversion compiler error.") ++ shadowingSuggestion else NodeSeq.Empty @@ -471,7 +471,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp if (fvs.isEmpty || isReduced) NodeSeq.Empty else { <dt>Attributes</dt> - <dd>{ fvs map { fv => { inlineToHtml(fv.text) ++ xml.Text(" ") } } }</dd> + <dd>{ fvs map { fv => { inlineToHtml(fv.text) ++ scala.xml.Text(" ") } } }</dd> } } @@ -480,7 +480,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp if ((inDefTpls.tail.isEmpty && (inDefTpls.head == inTpl)) || isReduced) NodeSeq.Empty else { <dt>Definition Classes</dt> - <dd>{ templatesToHtml(inDefTpls, xml.Text(" → ")) }</dd> + <dd>{ templatesToHtml(inDefTpls, scala.xml.Text(" → ")) }</dd> } } @@ -628,7 +628,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp <div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent">{ - typesToHtml(dtpl.linearizationTypes, hasLinks = true, sep = xml.Text(", ")) + typesToHtml(dtpl.linearizationTypes, hasLinks = true, sep = scala.xml.Text(", ")) }</div> </div> case _ => NodeSeq.Empty @@ -639,7 +639,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp <div class="toggleContainer block"> <span class="toggle">Known Subclasses</span> <div class="subClasses hiddenContent">{ - templatesToHtml(dtpl.allSubClasses.sortBy(_.name), xml.Text(", ")) + templatesToHtml(dtpl.allSubClasses.sortBy(_.name), scala.xml.Text(", ")) }</div> </div> case _ => NodeSeq.Empty @@ -663,7 +663,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp def boundsToHtml(hi: Option[TypeEntity], lo: Option[TypeEntity], hasLinks: Boolean): NodeSeq = { def bound0(bnd: Option[TypeEntity], pre: String): NodeSeq = bnd match { case None => NodeSeq.Empty - case Some(tpe) => xml.Text(pre) ++ typeToHtml(tpe, hasLinks) + case Some(tpe) => scala.xml.Text(pre) ++ typeToHtml(tpe, hasLinks) } bound0(lo, " >: ") ++ bound0(hi, " <: ") } @@ -694,7 +694,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp def inside(hasLinks: Boolean, nameLink: String = ""): NodeSeq = <xml:group> <span class="modifier_kind"> - <span class="modifier">{ mbr.flags.map(flag => inlineToHtml(flag.text) ++ xml.Text(" ")) }</span> + <span class="modifier">{ mbr.flags.map(flag => inlineToHtml(flag.text) ++ scala.xml.Text(" ")) }</span> <span class="kind">{ kindToString(mbr) }</span> </span> <span class="symbol"> @@ -872,7 +872,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp def argumentsToHtml0(argss: List[ValueArgument]): NodeSeq = argss match { case Nil => NodeSeq.Empty case arg :: Nil => argumentToHtml(arg) - case arg :: args => argumentToHtml(arg) ++ xml.Text(", ") ++ argumentsToHtml0(args) + case arg :: args => argumentToHtml(arg) ++ scala.xml.Text(", ") ++ argumentsToHtml0(args) } <span class="args">({ argumentsToHtml0(argss) })</span> } @@ -922,29 +922,29 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp private def constraintToHtml(constraint: Constraint): NodeSeq = constraint match { case ktcc: KnownTypeClassConstraint => - xml.Text(ktcc.typeExplanation(ktcc.typeParamName) + " (" + ktcc.typeParamName + ": ") ++ - templateToHtml(ktcc.typeClassEntity) ++ xml.Text(")") + scala.xml.Text(ktcc.typeExplanation(ktcc.typeParamName) + " (" + ktcc.typeParamName + ": ") ++ + templateToHtml(ktcc.typeClassEntity) ++ scala.xml.Text(")") case tcc: TypeClassConstraint => - xml.Text(tcc.typeParamName + " is ") ++ + scala.xml.Text(tcc.typeParamName + " is ") ++ <a href="http://stackoverflow.com/questions/2982276/what-is-a-context-bound-in-scala" target="_blank"> - context-bounded</a> ++ xml.Text(" by " + tcc.typeClassEntity.qualifiedName + " (" + tcc.typeParamName + ": ") ++ - templateToHtml(tcc.typeClassEntity) ++ xml.Text(")") + context-bounded</a> ++ scala.xml.Text(" by " + tcc.typeClassEntity.qualifiedName + " (" + tcc.typeParamName + ": ") ++ + templateToHtml(tcc.typeClassEntity) ++ scala.xml.Text(")") case impl: ImplicitInScopeConstraint => - xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, true) ++ xml.Text(" is in scope") + scala.xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, true) ++ scala.xml.Text(" is in scope") case eq: EqualTypeParamConstraint => - xml.Text(eq.typeParamName + " is " + eq.rhs.name + " (" + eq.typeParamName + " =:= ") ++ - typeToHtml(eq.rhs, true) ++ xml.Text(")") + scala.xml.Text(eq.typeParamName + " is " + eq.rhs.name + " (" + eq.typeParamName + " =:= ") ++ + typeToHtml(eq.rhs, true) ++ scala.xml.Text(")") case bt: BoundedTypeParamConstraint => - xml.Text(bt.typeParamName + " is a superclass of " + bt.lowerBound.name + " and a subclass of " + + scala.xml.Text(bt.typeParamName + " is a superclass of " + bt.lowerBound.name + " and a subclass of " + bt.upperBound.name + " (" + bt.typeParamName + " >: ") ++ - typeToHtml(bt.lowerBound, true) ++ xml.Text(" <: ") ++ - typeToHtml(bt.upperBound, true) ++ xml.Text(")") + typeToHtml(bt.lowerBound, true) ++ scala.xml.Text(" <: ") ++ + typeToHtml(bt.upperBound, true) ++ scala.xml.Text(")") case lb: LowerBoundedTypeParamConstraint => - xml.Text(lb.typeParamName + " is a superclass of " + lb.lowerBound.name + " (" + lb.typeParamName + " >: ") ++ - typeToHtml(lb.lowerBound, true) ++ xml.Text(")") + scala.xml.Text(lb.typeParamName + " is a superclass of " + lb.lowerBound.name + " (" + lb.typeParamName + " >: ") ++ + typeToHtml(lb.lowerBound, true) ++ scala.xml.Text(")") case ub: UpperBoundedTypeParamConstraint => - xml.Text(ub.typeParamName + " is a subclass of " + ub.upperBound.name + " (" + ub.typeParamName + " <: ") ++ - typeToHtml(ub.upperBound, true) ++ xml.Text(")") + scala.xml.Text(ub.typeParamName + " is a subclass of " + ub.upperBound.name + " (" + ub.typeParamName + " <: ") ++ + typeToHtml(ub.upperBound, true) ++ scala.xml.Text(")") } def makeDiagramHtml(tpl: DocTemplateEntity, diagram: Option[Diagram], description: String, id: String) = { diff --git a/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala b/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala index c46c33c1ee..304c534bdc 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala @@ -426,7 +426,7 @@ class DotDiagramGenerator(settings: doc.Settings) extends DiagramGenerator { else if (klass.contains("object")) "object" else "" - def getPosition(g: xml.Node, axis: String, offset: Double): Option[Double] = { + def getPosition(g: scala.xml.Node, axis: String, offset: Double): Option[Double] = { val node = g \ "a" \ "text" \ ("@" + axis) if (node.isEmpty) None @@ -508,4 +508,4 @@ class DotDiagramGenerator(settings: doc.Settings) extends DiagramGenerator { private val graphAttributesStr = graphAttributes.map{ case (key, value) => key + "=\"" + value + "\";\n" }.mkString private val nodeAttributesStr = flatten(nodeAttributes) private val edgeAttributesStr = flatten(edgeAttributes) -}
\ No newline at end of file +} diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala index ed8541f692..002cf0c5e8 100644 --- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala @@ -154,7 +154,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { if (!sym.isTrait && (sym hasFlag Flags.ABSTRACT)) fgs += Paragraph(Text("abstract")) /* Resetting the DEFERRED flag is a little trick here for refined types: (example from scala.collections) * {{{ - * implicit def traversable2ops[T](t: collection.GenTraversableOnce[T]) = new TraversableOps[T] { + * implicit def traversable2ops[T](t: scala.collection.GenTraversableOnce[T]) = new TraversableOps[T] { * def isParallel = ... * }}} * the type the method returns is TraversableOps, which has all-abstract symbols. But in reality, it couldn't have diff --git a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala index 59cdf05957..47eea52095 100644 --- a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala @@ -13,7 +13,7 @@ import scala.collection._ import scala.util.matching.Regex import scala.annotation.switch import scala.reflect.internal.util.{NoPosition, Position} -import language.postfixOps +import scala.language.postfixOps /** The comment parser transforms raw comment strings into `Comment` objects. * Call `parse` to run the parser. Note that the parser is stateless and diff --git a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala index 2645d8fd14..fa698afaa6 100644 --- a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala @@ -4,7 +4,7 @@ package diagram import model._ import comment.CommentFactory -import collection.mutable +import scala.collection.mutable // statistics import html.page.diagram.DiagramStats diff --git a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala index e31c5eda31..7067daec26 100644 --- a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala +++ b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala @@ -13,7 +13,7 @@ import scala.reflect.internal.util.FakePos import dependencies._ import io.AbstractFile -import language.implicitConversions +import scala.language.implicitConversions trait BuildManager { diff --git a/src/compiler/scala/tools/nsc/interactive/ContextTrees.scala b/src/compiler/scala/tools/nsc/interactive/ContextTrees.scala index 4a60211254..a906d1454c 100644 --- a/src/compiler/scala/tools/nsc/interactive/ContextTrees.scala +++ b/src/compiler/scala/tools/nsc/interactive/ContextTrees.scala @@ -5,7 +5,7 @@ package scala.tools.nsc package interactive -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer import scala.reflect.internal.util.Position trait ContextTrees { self: Global => diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index cb2e7d641b..5514983d98 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -20,7 +20,7 @@ import scala.tools.nsc.io.Pickler._ import scala.tools.nsc.typechecker.DivergentImplicit import scala.annotation.tailrec import symtab.Flags.{ACCESSOR, PARAMACCESSOR} -import language.implicitConversions +import scala.language.implicitConversions /** The main class of the presentation compiler in an interactive environment such as an IDE */ diff --git a/src/compiler/scala/tools/nsc/interactive/InteractiveReporter.scala b/src/compiler/scala/tools/nsc/interactive/InteractiveReporter.scala index f57786578a..104a69897d 100644 --- a/src/compiler/scala/tools/nsc/interactive/InteractiveReporter.scala +++ b/src/compiler/scala/tools/nsc/interactive/InteractiveReporter.scala @@ -5,7 +5,7 @@ package scala.tools.nsc package interactive -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer import scala.reflect.internal.util.Position import reporters.Reporter diff --git a/src/compiler/scala/tools/nsc/interactive/Picklers.scala b/src/compiler/scala/tools/nsc/interactive/Picklers.scala index f4ec03bb47..8ed7a67058 100644 --- a/src/compiler/scala/tools/nsc/interactive/Picklers.scala +++ b/src/compiler/scala/tools/nsc/interactive/Picklers.scala @@ -13,7 +13,7 @@ import util.EmptyAction import scala.reflect.internal.util.{Position, RangePosition, NoPosition, OffsetPosition, TransparentPosition} import io.{Pickler, CondPickler} import io.Pickler._ -import collection.mutable +import scala.collection.mutable import mutable.ListBuffer trait Picklers { self: Global => diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala index de6974cbb2..40982c62f0 100644 --- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala +++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala @@ -220,7 +220,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana } /** Return the set of source files that are invalidated by the given changes. */ - def invalidated(files: Set[AbstractFile], changesOf: collection.Map[Symbol, List[Change]], + def invalidated(files: Set[AbstractFile], changesOf: scala.collection.Map[Symbol, List[Change]], processed: Set[AbstractFile] = Set.empty): Set[AbstractFile] = { val buf = new mutable.HashSet[AbstractFile] diff --git a/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala b/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala index 0f52258b7e..ca5bdd632f 100644 --- a/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala +++ b/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package interactive import scala.reflect.internal.util.{SourceFile, Position, NoPosition} -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer trait RichCompilationUnits { self: Global => diff --git a/src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala b/src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala index 0080cfd753..dfbbb6ff88 100644 --- a/src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala +++ b/src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala @@ -2,8 +2,8 @@ package scala.tools.nsc package interactive import scala.reflect.internal.util.{SourceFile, BatchSourceFile, RangePosition} -import collection.mutable.ArrayBuffer -import reflect.internal.Chars.{isLineBreakChar, isWhitespace} +import scala.collection.mutable.ArrayBuffer +import scala.reflect.internal.Chars.{isLineBreakChar, isWhitespace} import ast.parser.Tokens._ trait ScratchPadMaker { self: Global => diff --git a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala index deeb398d39..cb46c0fdca 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala @@ -15,7 +15,7 @@ import scala.annotation.migration import scala.reflect.internal.util.Position import scala.reflect.internal.util.SourceFile -import collection.mutable.ListBuffer +import scala.collection.mutable.ListBuffer /** A base class for writing interactive compiler tests. * @@ -127,4 +127,4 @@ abstract class InteractiveTest // the presentation compiler sys.exit(0) } -}
\ No newline at end of file +} diff --git a/src/compiler/scala/tools/nsc/interactive/tests/Tester.scala b/src/compiler/scala/tools/nsc/interactive/tests/Tester.scala index 5270b1971a..aadffe2da5 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/Tester.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/Tester.scala @@ -9,7 +9,7 @@ package tests import scala.reflect.internal.util._ import reporters._ import io.AbstractFile -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) { @@ -168,7 +168,7 @@ class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) { } case class ErrorTrace( - sfidx: Int, changes: Seq[Change], infos: collection.Set[reporter.Info], content: Array[Char]) { + sfidx: Int, changes: Seq[Change], infos: scala.collection.Set[reporter.Info], content: Array[Char]) { override def toString = "Sourcefile: "+inputs(sfidx)+ "\nChanges:\n "+changes.mkString("\n ")+ diff --git a/src/compiler/scala/tools/nsc/interactive/tests/core/TestMarker.scala b/src/compiler/scala/tools/nsc/interactive/tests/core/TestMarker.scala index b5ea6ab7ce..ba1722382b 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/core/TestMarker.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/core/TestMarker.scala @@ -3,7 +3,7 @@ package scala.tools.nsc.interactive.tests.core case class DuplicateTestMarker(msg: String) extends Exception(msg) object TestMarker { - import collection.mutable.Map + import scala.collection.mutable.Map private val markers: Map[String, TestMarker] = Map.empty private def checkForDuplicate(marker: TestMarker) { @@ -24,4 +24,4 @@ object CompletionMarker extends TestMarker("/*!*/") object TypeMarker extends TestMarker("/*?*/") -object HyperlinkMarker extends TestMarker("/*#*/")
\ No newline at end of file +object HyperlinkMarker extends TestMarker("/*#*/") diff --git a/src/compiler/scala/tools/nsc/interpreter/CompletionAware.scala b/src/compiler/scala/tools/nsc/interpreter/CompletionAware.scala index abf326e746..5475410a84 100644 --- a/src/compiler/scala/tools/nsc/interpreter/CompletionAware.scala +++ b/src/compiler/scala/tools/nsc/interpreter/CompletionAware.scala @@ -77,7 +77,7 @@ object CompletionAware { /** Convenience factories. */ def apply(terms: () => List[String]): CompletionAware = apply(terms, _ => None) - def apply(map: collection.Map[String, CompletionAware]): CompletionAware = + def apply(map: scala.collection.Map[String, CompletionAware]): CompletionAware = apply(() => map.keys.toList, map.get _) } diff --git a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala index 4cc58d3f25..864f9bd073 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala @@ -23,7 +23,7 @@ import scala.reflect.NameTransformer._ import util.ScalaClassLoader import ScalaClassLoader._ import scala.tools.util._ -import language.{implicitConversions, existentials} +import scala.language.{implicitConversions, existentials} import scala.reflect.{ClassTag, classTag} import scala.tools.reflect.StdRuntimeTags._ @@ -839,7 +839,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter) addThunk({ import scala.tools.nsc.io._ import Properties.userHome - import compat.Platform.EOL + import scala.compat.Platform.EOL val autorun = replProps.replAutorunCode.option flatMap (f => io.File(f).safeSlurp()) if (autorun.isDefined) intp.quietRun(autorun.get) }) diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala index a2df1494ef..e7c56718f7 100644 --- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala +++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala @@ -25,7 +25,7 @@ import scala.util.control.Exception.{ ultimately } import IMain._ import java.util.concurrent.Future import typechecker.Analyzer -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.runtime.{ universe => ru } import scala.reflect.{ ClassTag, classTag } import scala.tools.reflect.StdRuntimeTags._ diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala index edb95f7526..bab3a1e506 100644 --- a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala +++ b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala @@ -9,7 +9,7 @@ package interpreter import scala.tools.jline._ import scala.tools.jline.console.completer._ import Completion._ -import collection.mutable.ListBuffer +import scala.collection.mutable.ListBuffer // REPL completor - queries supplied interpreter for valid // completions based on current contents of buffer. diff --git a/src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala b/src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala index 2dc394a081..f0e643d572 100644 --- a/src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala +++ b/src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala @@ -6,12 +6,12 @@ package scala.tools.nsc package interpreter -import collection.{ mutable, immutable } +import scala.collection.{ mutable, immutable } import mutable.ListBuffer -import language.implicitConversions +import scala.language.implicitConversions class ProcessResult(val line: String) { - import sys.process._ + import scala.sys.process._ private val buffer = new ListBuffer[String] val builder = Process(line) diff --git a/src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala b/src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala index c041f02859..bf7204c754 100644 --- a/src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala +++ b/src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala @@ -10,7 +10,7 @@ import scala.collection.{ mutable, immutable } import scala.PartialFunction.cond import scala.reflect.internal.Chars import scala.reflect.internal.Flags._ -import language.implicitConversions +import scala.language.implicitConversions trait MemberHandlers { val intp: IMain diff --git a/src/compiler/scala/tools/nsc/interpreter/NamedParam.scala b/src/compiler/scala/tools/nsc/interpreter/NamedParam.scala index a2b42aeefc..3203e2ba49 100644 --- a/src/compiler/scala/tools/nsc/interpreter/NamedParam.scala +++ b/src/compiler/scala/tools/nsc/interpreter/NamedParam.scala @@ -7,7 +7,7 @@ package scala.tools.nsc package interpreter import NamedParam._ -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.runtime.{universe => ru} import scala.reflect.{ClassTag, classTag} diff --git a/src/compiler/scala/tools/nsc/interpreter/Phased.scala b/src/compiler/scala/tools/nsc/interpreter/Phased.scala index 9124eace05..66d748a9f1 100644 --- a/src/compiler/scala/tools/nsc/interpreter/Phased.scala +++ b/src/compiler/scala/tools/nsc/interpreter/Phased.scala @@ -7,7 +7,7 @@ package scala.tools.nsc package interpreter import scala.collection.{ mutable, immutable } -import language.implicitConversions +import scala.language.implicitConversions /** Mix this into an object and use it as a phasing * swiss army knife. diff --git a/src/compiler/scala/tools/nsc/interpreter/Power.scala b/src/compiler/scala/tools/nsc/interpreter/Power.scala index 4ba0c59112..244c04bdf4 100644 --- a/src/compiler/scala/tools/nsc/interpreter/Power.scala +++ b/src/compiler/scala/tools/nsc/interpreter/Power.scala @@ -13,7 +13,7 @@ import session.{ History } import scala.io.Codec import java.net.{ URL, MalformedURLException } import io.{ Path } -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.runtime.{universe => ru} import scala.reflect.{ClassTag, classTag} diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplVals.scala b/src/compiler/scala/tools/nsc/interpreter/ReplVals.scala index cb10de7dca..f27c4a8123 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ReplVals.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ReplVals.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package interpreter -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.base.{Universe => BaseUniverse} import scala.reflect.runtime.{universe => ru} diff --git a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala index 9dcc4006a3..5642566cf7 100644 --- a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala +++ b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala @@ -14,7 +14,7 @@ import scala.reflect.runtime.{universe => ru} import scala.reflect.{ClassTag, classTag} import typechecker.DestructureTypes import scala.reflect.internal.util.StringOps.ojoin -import language.implicitConversions +import scala.language.implicitConversions /** A more principled system for turning types into strings. */ @@ -256,4 +256,4 @@ trait TypeStrings { ) } -object TypeStrings extends TypeStrings { }
\ No newline at end of file +object TypeStrings extends TypeStrings { } diff --git a/src/compiler/scala/tools/nsc/interpreter/package.scala b/src/compiler/scala/tools/nsc/interpreter/package.scala index 98129aded8..89006be8e2 100644 --- a/src/compiler/scala/tools/nsc/interpreter/package.scala +++ b/src/compiler/scala/tools/nsc/interpreter/package.scala @@ -5,7 +5,7 @@ package scala.tools.nsc -import language.implicitConversions +import scala.language.implicitConversions /** The main REPL related classes and values are as follows. * In addition to standard compiler classes Global and Settings, there are: @@ -38,7 +38,7 @@ package object interpreter extends ReplConfig with ReplStrings { implicit def postfixOps = language.postfixOps // make all postfix ops in this package compile without warning private[interpreter] implicit def javaCharSeqCollectionToScala(xs: JCollection[_ <: CharSequence]): List[String] = { - import collection.JavaConverters._ + import scala.collection.JavaConverters._ xs.asScala.toList map ("" + _) } diff --git a/src/compiler/scala/tools/nsc/interpreter/session/package.scala b/src/compiler/scala/tools/nsc/interpreter/session/package.scala index c1cd599941..58232e6b9a 100644 --- a/src/compiler/scala/tools/nsc/interpreter/session/package.scala +++ b/src/compiler/scala/tools/nsc/interpreter/session/package.scala @@ -5,7 +5,7 @@ package scala.tools.nsc package interpreter -import language.implicitConversions +import scala.language.implicitConversions /** Files having to do with the state of a repl session: * lines of text entered, types and terms defined, etc. diff --git a/src/compiler/scala/tools/nsc/io/Jar.scala b/src/compiler/scala/tools/nsc/io/Jar.scala index 12ba3e4bd7..f66f3daa32 100644 --- a/src/compiler/scala/tools/nsc/io/Jar.scala +++ b/src/compiler/scala/tools/nsc/io/Jar.scala @@ -8,10 +8,10 @@ package io import java.io.{ InputStream, OutputStream, IOException, FileNotFoundException, FileInputStream, DataOutputStream } import java.util.jar._ -import collection.JavaConverters._ +import scala.collection.JavaConverters._ import Attributes.Name import util.ClassPath -import language.implicitConversions +import scala.language.implicitConversions // Attributes.Name instances: // diff --git a/src/compiler/scala/tools/nsc/io/Pickler.scala b/src/compiler/scala/tools/nsc/io/Pickler.scala index 48361cd157..b03a921e87 100644 --- a/src/compiler/scala/tools/nsc/io/Pickler.scala +++ b/src/compiler/scala/tools/nsc/io/Pickler.scala @@ -1,10 +1,10 @@ package scala.tools.nsc.io -import annotation.unchecked +import scala.annotation.unchecked import Lexer._ import java.io.Writer -import language.implicitConversions -import reflect.ClassTag +import scala.language.implicitConversions +import scala.reflect.ClassTag /** An abstract class for writing and reading Scala objects to and * from a legible representation. The presesentation follows the following grammar: diff --git a/src/compiler/scala/tools/nsc/io/package.scala b/src/compiler/scala/tools/nsc/io/package.scala index 3c4f004198..6385706830 100644 --- a/src/compiler/scala/tools/nsc/io/package.scala +++ b/src/compiler/scala/tools/nsc/io/package.scala @@ -8,7 +8,7 @@ package scala.tools.nsc import java.util.concurrent.{ Future, Callable } import java.util.{ Timer, TimerTask } import java.util.jar.{ Attributes } -import language.implicitConversions +import scala.language.implicitConversions package object io { implicit def postfixOps = language.postfixOps // make all postfix ops in this package compile without warning diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index c5da8822d5..a30ae1cb36 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -12,7 +12,7 @@ import scala.reflect.internal.util.OffsetPosition import scala.collection.mutable.ListBuffer import symtab.Flags import JavaTokens._ -import language.implicitConversions +import scala.language.implicitConversions trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { val global : Global diff --git a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala index 0367119547..7aeae485d0 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala @@ -11,7 +11,7 @@ import scala.reflect.internal.util._ import scala.reflect.internal.Chars._ import JavaTokens._ import scala.annotation.switch -import language.implicitConversions +import scala.language.implicitConversions // Todo merge these better with Scanners trait JavaScanners extends ast.parser.ScannersCommon { diff --git a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala index 6d8c80d1d0..be8f1e3d9e 100644 --- a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala +++ b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala @@ -9,8 +9,8 @@ package matching import transform.ExplicitOuter import ast.{ Printers, Trees } import java.io.{ StringWriter, PrintWriter } -import annotation.elidable -import language.postfixOps +import scala.annotation.elidable +import scala.language.postfixOps /** Ancillary bits of ParallelMatching which are better off * out of the way. diff --git a/src/compiler/scala/tools/nsc/matching/Matrix.scala b/src/compiler/scala/tools/nsc/matching/Matrix.scala index 1cf4bccb40..93e936fe1f 100644 --- a/src/compiler/scala/tools/nsc/matching/Matrix.scala +++ b/src/compiler/scala/tools/nsc/matching/Matrix.scala @@ -9,7 +9,7 @@ package matching import transform.ExplicitOuter import symtab.Flags import scala.collection.mutable -import language.implicitConversions +import scala.language.implicitConversions trait Matrix extends MatrixAdditions { self: ExplicitOuter with ParallelMatching => diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index 71deb2d356..1d21e4952f 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -13,8 +13,8 @@ import scala.reflect.internal.util.Position import transform.ExplicitOuter import symtab.Flags import mutable.ListBuffer -import annotation.elidable -import language.postfixOps +import scala.annotation.elidable +import scala.language.postfixOps trait ParallelMatching extends ast.TreeDSL with MatchSupport diff --git a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala index 8e043613b8..ee96f15f40 100644 --- a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala +++ b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala @@ -8,7 +8,7 @@ package matching import transform.ExplicitOuter import PartialFunction._ -import language.postfixOps +import scala.language.postfixOps trait PatternBindings extends ast.TreeDSL { diff --git a/src/compiler/scala/tools/nsc/scratchpad/Mixer.scala b/src/compiler/scala/tools/nsc/scratchpad/Mixer.scala index 67ff916b11..f7ad39bd95 100644 --- a/src/compiler/scala/tools/nsc/scratchpad/Mixer.scala +++ b/src/compiler/scala/tools/nsc/scratchpad/Mixer.scala @@ -5,7 +5,7 @@ import java.io.{FileInputStream, InputStreamReader, IOException} import scala.runtime.ScalaRunTime.stringOf import java.lang.reflect.InvocationTargetException import scala.reflect.runtime.ReflectionUtils._ -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer class Mixer { diff --git a/src/compiler/scala/tools/nsc/scratchpad/SourceInserter.scala b/src/compiler/scala/tools/nsc/scratchpad/SourceInserter.scala index 1c4fad5511..5eeab53fca 100644 --- a/src/compiler/scala/tools/nsc/scratchpad/SourceInserter.scala +++ b/src/compiler/scala/tools/nsc/scratchpad/SourceInserter.scala @@ -3,8 +3,7 @@ package scratchpad import java.io.Writer import scala.reflect.internal.util.SourceFile - -import reflect.internal.Chars._ +import scala.reflect.internal.Chars._ object SourceInserter { def stripRight(cs: Array[Char]): Array[Char] = { diff --git a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala index 120ada965a..78b56a8596 100644 --- a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala @@ -15,7 +15,7 @@ trait AbsSettings extends scala.reflect.internal.settings.AbsSettings { type Setting <: AbsSetting // Fix to the concrete Setting type type ResultOfTryToSet // List[String] in mutable, (Settings, List[String]) in immutable def errorFn: String => Unit - protected def allSettings: collection.Set[Setting] + protected def allSettings: scala.collection.Set[Setting] // settings minus internal usage settings def visibleSettings = allSettings filterNot (_.isInternalOnly) diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index 19392ec23a..3ff7af791b 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -8,10 +8,10 @@ package scala.tools package nsc package settings -import annotation.elidable +import scala.annotation.elidable import scala.tools.util.PathResolver.Defaults import scala.collection.mutable -import language.{implicitConversions, existentials} +import scala.language.{implicitConversions, existentials} trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index 8e77f8b6f4..f7c3a55954 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -10,9 +10,9 @@ import java.io.IOException import scala.compat.Platform.currentTime import scala.tools.nsc.util.{ ClassPath } import classfile.ClassfileParser -import reflect.internal.Flags._ -import reflect.internal.MissingRequirementError -import reflect.internal.util.Statistics +import scala.reflect.internal.Flags._ +import scala.reflect.internal.MissingRequirementError +import scala.reflect.internal.util.Statistics import scala.tools.nsc.io.{ AbstractFile, MsilFile } /** This class ... @@ -300,6 +300,6 @@ abstract class SymbolLoaders { } object SymbolLoadersStats { - import reflect.internal.TypesStats.typerNanos + import scala.reflect.internal.TypesStats.typerNanos val classReadNanos = Statistics.newSubTimer ("time classfilereading", typerNanos) } diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala index c6bd236e8a..7e2741f6bc 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala @@ -6,4 +6,4 @@ package scala.tools.nsc package symtab -abstract class SymbolTable extends reflect.internal.SymbolTable
\ No newline at end of file +abstract class SymbolTable extends scala.reflect.internal.SymbolTable diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala index c596eb014a..d9d25bf95a 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala @@ -7,8 +7,8 @@ package scala.tools.nsc package symtab import scala.collection.{ mutable, immutable } -import language.implicitConversions -import language.postfixOps +import scala.language.implicitConversions +import scala.language.postfixOps /** Printing the symbol graph (for those symbols attached to an AST node) * after each phase. diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index fcd5e369f5..903b3095de 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -1164,7 +1164,7 @@ abstract class ClassfileParser { originalName + " in " + outerName + "(" + externalName +")" } - object innerClasses extends collection.mutable.HashMap[Name, InnerClassEntry] { + object innerClasses extends scala.collection.mutable.HashMap[Name, InnerClassEntry] { /** Return the Symbol of the top level class enclosing `name`, * or 'name's symbol if no entry found for `name`. */ diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 3c34cf1c80..b30969d451 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -512,7 +512,7 @@ abstract class Pickler extends SubComponent { private def writeName(name: Name) { ensureCapacity(name.length * 3) val utfBytes = Codec toUTF8 name.toString - compat.Platform.arraycopy(utfBytes, 0, bytes, writeIndex, utfBytes.length) + scala.compat.Platform.arraycopy(utfBytes, 0, bytes, writeIndex, utfBytes.length) writeIndex += utfBytes.length } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/package.scala b/src/compiler/scala/tools/nsc/symtab/classfile/package.scala index fe66c515de..1f9a823bb4 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/package.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/package.scala @@ -2,6 +2,6 @@ package scala.tools.nsc.symtab package object classfile { - val ClassfileConstants = reflect.internal.ClassfileConstants + val ClassfileConstants = scala.reflect.internal.ClassfileConstants } diff --git a/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala b/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala index 5e52415ab2..18b95ba191 100644 --- a/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala @@ -12,7 +12,7 @@ import ch.epfl.lamp.compiler.msil.{Type => MSILType, Attribute => MSILAttribute, import scala.collection.{ mutable, immutable } import scala.reflect.internal.pickling.UnPickler import ch.epfl.lamp.compiler.msil.Type.TMVarUsage -import language.implicitConversions +import scala.language.implicitConversions /** * @author Nikolay Mihaylov diff --git a/src/compiler/scala/tools/nsc/symtab/package.scala b/src/compiler/scala/tools/nsc/symtab/package.scala index 1cf0d2c2ae..0e6719f225 100644 --- a/src/compiler/scala/tools/nsc/symtab/package.scala +++ b/src/compiler/scala/tools/nsc/symtab/package.scala @@ -2,6 +2,6 @@ package scala.tools.nsc package object symtab { - val Flags = reflect.internal.Flags + val Flags = scala.reflect.internal.Flags } diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 4a668d4c61..ab0a8756a4 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -9,7 +9,7 @@ package transform import symtab._ import Flags._ import scala.collection.{ mutable, immutable } -import collection.mutable.ListBuffer +import scala.collection.mutable.ListBuffer abstract class AddInterfaces extends InfoTransform { self: Erasure => import global._ // the global environment diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 972debb900..dff9a65649 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -9,7 +9,7 @@ package transform import symtab._ import Flags._ import scala.collection._ -import language.postfixOps +import scala.language.postfixOps abstract class CleanUp extends Transform with ast.TreeDSL { import global._ @@ -351,8 +351,8 @@ abstract class CleanUp extends Transform with ast.TreeDSL { /** Normal non-Array call */ def genDefaultCall = { // reflective method call machinery - val invokeName = MethodClass.tpe member nme.invoke_ // reflect.Method.invoke(...) - def cache = REF(reflectiveMethodCache(ad.symbol.name.toString, paramTypes)) // cache Symbol + val invokeName = MethodClass.tpe member nme.invoke_ // scala.reflect.Method.invoke(...) + def cache = REF(reflectiveMethodCache(ad.symbol.name.toString, paramTypes)) // cache Symbol def lookup = Apply(cache, List(qual1() GETCLASS)) // get Method object from cache def invokeArgs = ArrayValue(TypeTree(ObjectClass.tpe), params) // args for invocation def invocation = (lookup DOT invokeName)(qual1(), invokeArgs) // .invoke(qual1, ...) diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 37e452dc6a..7dafc9b467 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -12,7 +12,7 @@ import symtab._ import Flags._ abstract class Erasure extends AddInterfaces - with reflect.internal.transform.Erasure + with scala.reflect.internal.transform.Erasure with typechecker.Analyzer with TypingTransformers with ast.TreeDSL diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 79b24e826d..2b0520592b 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -430,7 +430,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { * * Such fields will be nulled after the initializer has memoized the lazy value. */ - def singleUseFields(templ: Template): collection.Map[Symbol, List[Symbol]] = { + def singleUseFields(templ: Template): scala.collection.Map[Symbol, List[Symbol]] = { val usedIn = mutable.HashMap[Symbol, List[Symbol]]() withDefaultValue Nil object SingleUseTraverser extends Traverser { diff --git a/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala b/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala index 4401e3bd3e..f9d8d19b10 100644 --- a/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala +++ b/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala @@ -9,7 +9,7 @@ package transform import scala.collection.mutable import symtab.Flags._ import util.HashSet -import annotation.tailrec +import scala.annotation.tailrec /** A class that yields a kind of iterator (`Cursor`), * which yields all pairs of overriding/overridden symbols diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 86cdc59303..0fa50a255b 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -8,8 +8,8 @@ package transform import scala.tools.nsc.symtab.Flags import scala.collection.{ mutable, immutable } -import language.postfixOps -import language.existentials +import scala.language.postfixOps +import scala.language.existentials /** Specialize code on types. * diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index a97b7ab907..5a3db26e30 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -8,7 +8,7 @@ package transform import symtab.Flags._ import scala.collection.{ mutable, immutable } -import language.postfixOps +import scala.language.postfixOps /*<export> */ /** - uncurry all symbol and tree types (@see UnCurryPhase) -- this includes normalizing all proper types. @@ -44,7 +44,7 @@ import language.postfixOps */ /*</export> */ abstract class UnCurry extends InfoTransform - with reflect.internal.transform.UnCurry + with scala.reflect.internal.transform.UnCurry with TypingTransformers with ast.TreeDSL { val global: Global // need to repeat here because otherwise last mixin defines global as // SymbolTable. If we had DOT this would not be an issue @@ -684,16 +684,16 @@ abstract class UnCurry extends InfoTransform else tree } - + def isThrowable(pat: Tree): Boolean = pat match { - case Typed(Ident(nme.WILDCARD), tpt) => + case Typed(Ident(nme.WILDCARD), tpt) => tpt.tpe =:= ThrowableClass.tpe - case Bind(_, pat) => + case Bind(_, pat) => isThrowable(pat) case _ => false } - + def isDefaultCatch(cdef: CaseDef) = isThrowable(cdef.pat) && cdef.guard.isEmpty def postTransformTry(tree: Try) = { @@ -757,10 +757,10 @@ abstract class UnCurry extends InfoTransform case tree: Try => postTransformTry(tree) - + case Apply(Apply(fn, args), args1) => treeCopy.Apply(tree, fn, args ::: args1) - + case Ident(name) => assert(name != tpnme.WILDCARD_STAR, tree) applyUnary() diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala index ab8836f339..399f9a1eac 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package typechecker -import reflect.internal.util.Statistics +import scala.reflect.internal.util.Statistics /** The main attribution phase. */ @@ -72,7 +72,7 @@ trait Analyzer extends AnyRef } object typerFactory extends SubComponent { - import reflect.internal.TypesStats.typerNanos + import scala.reflect.internal.TypesStats.typerNanos val global: Analyzer.this.global.type = Analyzer.this.global val phaseName = "typer" val runsAfter = List[String]() diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 6a908c6c65..dbf769c79f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -8,7 +8,7 @@ package typechecker import symtab.Flags._ import scala.collection.mutable.{LinkedHashSet, Set} -import annotation.tailrec +import scala.annotation.tailrec /** * @author Martin Odersky diff --git a/src/compiler/scala/tools/nsc/typechecker/DestructureTypes.scala b/src/compiler/scala/tools/nsc/typechecker/DestructureTypes.scala index 5802d36878..6a21639391 100644 --- a/src/compiler/scala/tools/nsc/typechecker/DestructureTypes.scala +++ b/src/compiler/scala/tools/nsc/typechecker/DestructureTypes.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package typechecker -import language.implicitConversions +import scala.language.implicitConversions /** A generic means of breaking down types into their subcomponents. * Types are decomposed top down, and recognizable substructure is diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index 070f083a89..97e86d183e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -29,7 +29,7 @@ abstract class Duplicators extends Analyzer { * the old class with the new class, and map symbols through the given 'env'. The * environment is a map from type skolems to concrete types (see SpecializedTypes). */ - def retyped(context: Context, tree: Tree, oldThis: Symbol, newThis: Symbol, env: collection.Map[Symbol, Type]): Tree = { + def retyped(context: Context, tree: Tree, oldThis: Symbol, newThis: Symbol, env: scala.collection.Map[Symbol, Type]): Tree = { if (oldThis ne newThis) { oldClassOwner = oldThis newClassOwner = newThis diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 08978ef4b5..e3f0756b6c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -11,13 +11,13 @@ package scala.tools.nsc package typechecker -import annotation.tailrec +import scala.annotation.tailrec import scala.collection.{ mutable, immutable } import mutable.{ LinkedHashMap, ListBuffer } import scala.util.matching.Regex import symtab.Flags._ import scala.reflect.internal.util.Statistics -import language.implicitConversions +import scala.language.implicitConversions /** This trait provides methods to find various kinds of implicits. * @@ -1217,14 +1217,14 @@ trait Implicits { private val ManifestSymbols = Set[Symbol](PartialManifestClass, FullManifestClass, OptManifestClass) /** Creates a tree that calls the relevant factory method in object - * reflect.Manifest for type 'tp'. An EmptyTree is returned if + * scala.reflect.Manifest for type 'tp'. An EmptyTree is returned if * no manifest is found. todo: make this instantiate take type params as well? */ private def manifestOfType(tp: Type, flavor: Symbol): SearchResult = { val full = flavor == FullManifestClass val opt = flavor == OptManifestClass - /** Creates a tree that calls the factory method called constructor in object reflect.Manifest */ + /** Creates a tree that calls the factory method called constructor in object scala.reflect.Manifest */ def manifestFactoryCall(constructor: String, tparg: Type, args: Tree*): Tree = if (args contains EmptyTree) EmptyTree else typedPos(tree.pos.focus) { @@ -1472,7 +1472,7 @@ trait Implicits { interpolate(msg, Map((typeParamNames zip typeArgs): _*)) // TODO: give access to the name and type of the implicit argument, etc? def validate: Option[String] = { - import scala.util.matching.Regex; import collection.breakOut + import scala.util.matching.Regex; import scala.collection.breakOut // is there a shorter way to avoid the intermediate toList? val refs = """\$\{([^}]+)\}""".r.findAllIn(msg).matchData.map(_ group 1).toSet val decls = typeParamNames.toSet @@ -1492,7 +1492,7 @@ trait Implicits { object ImplicitsStats { - import reflect.internal.TypesStats._ + import scala.reflect.internal.TypesStats._ val rawTypeImpl = Statistics.newSubCounter (" of which in implicits", rawTypeCount) val subtypeImpl = Statistics.newSubCounter(" of which in implicit", subtypeCount) diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index 27a88a3683..7e9b288853 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -7,7 +7,7 @@ import scala.tools.nsc.util.ClassPath._ import scala.reflect.runtime.ReflectionUtils import scala.collection.mutable.ListBuffer import scala.compat.Platform.EOL -import reflect.internal.util.Statistics +import scala.reflect.internal.util.Statistics import scala.reflect.macros.util._ import java.lang.{Class => jClass} import java.lang.reflect.{Array => jArray, Method => jMethod} @@ -832,7 +832,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { var hasPendingMacroExpansions = false private val delayed = perRunCaches.newWeakMap[Tree, collection.mutable.Set[Int]] private def isDelayed(expandee: Tree) = delayed contains expandee - private def calculateUndetparams(expandee: Tree): collection.mutable.Set[Int] = + private def calculateUndetparams(expandee: Tree): scala.collection.mutable.Set[Int] = delayed.get(expandee).getOrElse { val calculated = collection.mutable.Set[Symbol]() expandee foreach (sub => { @@ -886,7 +886,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { } object MacrosStats { - import reflect.internal.TypesStats.typerNanos + import scala.reflect.internal.TypesStats.typerNanos val macroExpandCount = Statistics.newCounter ("#macro expansions", "typer") val macroExpandNanos = Statistics.newSubTimer("time spent in macroExpand", typerNanos) } diff --git a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala index 83740f1658..91dcd90962 100644 --- a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala +++ b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala @@ -10,7 +10,7 @@ import scala.collection.{ mutable, immutable } import scala.reflect.internal.util.StringOps.{ ojoin } import scala.reflect.ClassTag import scala.reflect.runtime.{ universe => ru } -import language.higherKinds +import scala.language.higherKinds /** Logic related to method synthesis which involves cooperation between * Namer and Typer. diff --git a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala index c60118a8b4..237d17887d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala +++ b/src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala @@ -9,12 +9,12 @@ package typechecker import symtab._ import Flags.{MUTABLE, METHOD, LABEL, SYNTHETIC, ARTIFACT} -import language.postfixOps +import scala.language.postfixOps import scala.tools.nsc.transform.TypingTransformers import scala.tools.nsc.transform.Transform import scala.collection.mutable.HashSet import scala.collection.mutable.HashMap -import reflect.internal.util.Statistics +import scala.reflect.internal.util.Statistics import scala.reflect.internal.Types /** Translate pattern matching. @@ -2941,7 +2941,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL } // node in the tree that describes how to construct a counter-example - case class VariableAssignment(variable: Var, equalTo: List[Const], notEqualTo: List[Const], fields: collection.mutable.Map[Symbol, VariableAssignment]) { + case class VariableAssignment(variable: Var, equalTo: List[Const], notEqualTo: List[Const], fields: scala.collection.mutable.Map[Symbol, VariableAssignment]) { // need to prune since the model now incorporates all super types of a constant (needed for reachability) private lazy val uniqueEqualTo = equalTo filterNot (subsumed => equalTo.exists(better => (better ne subsumed) && instanceOfTpImplies(better.tp, subsumed.tp))) private lazy val prunedEqualTo = uniqueEqualTo filterNot (subsumed => variable.staticTpCheckable <:< subsumed.tp) diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index d515934c58..84ec86b194 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -7,10 +7,10 @@ package scala.tools.nsc package typechecker import symtab.Flags._ -import collection.{ mutable, immutable } +import scala.collection.{ mutable, immutable } import transform.InfoTransform import scala.collection.mutable.ListBuffer -import language.postfixOps +import scala.language.postfixOps /** <p> * Post-attribution checking and transformation. @@ -38,7 +38,7 @@ import language.postfixOps * * @todo Check whether we always check type parameter bounds. */ -abstract class RefChecks extends InfoTransform with reflect.internal.transform.RefChecks { +abstract class RefChecks extends InfoTransform with scala.reflect.internal.transform.RefChecks { val global: Global // need to repeat here because otherwise last mixin defines global as // SymbolTable. If we had DOT this would not be an issue @@ -509,7 +509,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R } } } - + def checkOverrideDeprecated() { if (other.hasDeprecatedOverridingAnnotation) { val suffix = other.deprecatedOverridingMessage map (": " + _) getOrElse "" diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d0722f7b98..8a3c509e81 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -13,10 +13,9 @@ package scala.tools.nsc package typechecker import scala.collection.mutable -import scala.reflect.internal.util.BatchSourceFile +import scala.reflect.internal.util.{ BatchSourceFile, Statistics } import mutable.ListBuffer import symtab.Flags._ -import reflect.internal.util.Statistics // Suggestion check whether we can do without priming scopes with symbols of outer scopes, // like the IDE does. @@ -779,7 +778,7 @@ trait Typers extends Modes with Adaptations with Tags { var raw = featureDesc + " " + req + " be enabled\n" + "by making the implicit value language." + featureName + " visible." if (!(currentRun.reportedFeature contains featureTrait)) - raw += "\nThis can be achieved by adding the import clause 'import language." + featureName + "'\n" + + raw += "\nThis can be achieved by adding the import clause 'import scala.language." + featureName + "'\n" + "or by setting the compiler option -language:" + featureName + ".\n" + "See the Scala docs for value scala.language." + featureName + " for a discussion\n" + "why the feature " + req + " be explicitly enabled." @@ -5558,8 +5557,8 @@ trait Typers extends Modes with Adaptations with Tags { } object TypersStats { - import reflect.internal.TypesStats._ - import reflect.internal.BaseTypeSeqsStats._ + import scala.reflect.internal.TypesStats._ + import scala.reflect.internal.BaseTypeSeqsStats._ val typedIdentCount = Statistics.newCounter("#typechecked identifiers") val typedSelectCount = Statistics.newCounter("#typechecked selections") val typedApplyCount = Statistics.newCounter("#typechecked applications") diff --git a/src/compiler/scala/tools/nsc/util/Exceptional.scala b/src/compiler/scala/tools/nsc/util/Exceptional.scala index 90d032518a..34344263e8 100644 --- a/src/compiler/scala/tools/nsc/util/Exceptional.scala +++ b/src/compiler/scala/tools/nsc/util/Exceptional.scala @@ -4,7 +4,7 @@ package util import java.util.concurrent.ExecutionException import java.lang.reflect.{ InvocationTargetException, UndeclaredThrowableException } import scala.reflect.internal.util.StringOps._ -import language.implicitConversions +import scala.language.implicitConversions object Exceptional { def unwrap(x: Throwable): Throwable = x match { diff --git a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala b/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala index 25caae9ecb..9de3a2427f 100644 --- a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala +++ b/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala @@ -14,7 +14,7 @@ import java.net.URL import scala.reflect.runtime.ReflectionUtils.unwrapHandler import ScalaClassLoader._ import scala.util.control.Exception.{ catching } -import language.implicitConversions +import scala.language.implicitConversions import scala.reflect.{ ClassTag, classTag } trait HasClassPath { diff --git a/src/compiler/scala/tools/nsc/util/StatisticsInfo.scala b/src/compiler/scala/tools/nsc/util/StatisticsInfo.scala index 8cdb96c586..3682b9fb54 100644 --- a/src/compiler/scala/tools/nsc/util/StatisticsInfo.scala +++ b/src/compiler/scala/tools/nsc/util/StatisticsInfo.scala @@ -6,13 +6,13 @@ package scala.tools.nsc package util -import reflect.internal.util.Statistics +import scala.reflect.internal.util.Statistics abstract class StatisticsInfo { val global: Global import global._ - import reflect.internal.TreesStats.nodeByType + import scala.reflect.internal.TreesStats.nodeByType val phasesShown = List("parser", "typer", "patmat", "erasure", "cleanup") @@ -35,4 +35,4 @@ abstract class StatisticsInfo { for (q <- quants if q.showAt(phase.name)) inform(q.line) } -}
\ No newline at end of file +} diff --git a/src/compiler/scala/tools/reflect/FastTrack.scala b/src/compiler/scala/tools/reflect/FastTrack.scala index d6bed0c6d1..38e4e3c9f1 100644 --- a/src/compiler/scala/tools/reflect/FastTrack.scala +++ b/src/compiler/scala/tools/reflect/FastTrack.scala @@ -13,7 +13,7 @@ trait FastTrack { import global._ import definitions._ - import language.implicitConversions + import scala.language.implicitConversions private implicit def context2taggers(c0: MacroContext): Taggers { val c: c0.type } = new { val c: c0.type = c0 } with Taggers private implicit def context2macroimplementations(c0: MacroContext): MacroImplementations { val c: c0.type } = new { val c: c0.type = c0 } with MacroImplementations @@ -38,4 +38,4 @@ trait FastTrack { StringContext_f bindTo { case (c, app@Apply(Select(Apply(_, parts), _), args)) => c.macro_StringInterpolation_f(parts, args, app.pos) } registry } -}
\ No newline at end of file +} diff --git a/src/compiler/scala/tools/reflect/package.scala b/src/compiler/scala/tools/reflect/package.scala index 3008930823..d5569e448d 100644 --- a/src/compiler/scala/tools/reflect/package.scala +++ b/src/compiler/scala/tools/reflect/package.scala @@ -6,7 +6,7 @@ package scala.tools import scala.reflect.api.JavaUniverse -import language.implicitConversions +import scala.language.implicitConversions package object reflect extends FrontEnds { // [todo: can we generalize this? diff --git a/src/compiler/scala/tools/util/Javap.scala b/src/compiler/scala/tools/util/Javap.scala index ce149a5aa0..70f71a222a 100644 --- a/src/compiler/scala/tools/util/Javap.scala +++ b/src/compiler/scala/tools/util/Javap.scala @@ -12,7 +12,7 @@ import scala.tools.nsc.util.ScalaClassLoader import java.io.{ InputStream, PrintWriter, ByteArrayInputStream, FileNotFoundException } import scala.tools.nsc.io.File import Javap._ -import language.reflectiveCalls +import scala.language.reflectiveCalls trait Javap { def loader: ScalaClassLoader diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala index 739878c282..f6dc92f96e 100644 --- a/src/compiler/scala/tools/util/PathResolver.scala +++ b/src/compiler/scala/tools/util/PathResolver.scala @@ -13,7 +13,7 @@ import nsc.util.{ ClassPath, JavaClassPath, ScalaClassLoader } import nsc.io.{ File, Directory, Path, AbstractFile } import ClassPath.{ JavaContext, DefaultJavaContext, join, split } import PartialFunction.condOpt -import language.postfixOps +import scala.language.postfixOps // Loosely based on the draft specification at: // https://wiki.scala-lang.org/display/SW/Classpath diff --git a/src/compiler/scala/tools/util/VerifyClass.scala b/src/compiler/scala/tools/util/VerifyClass.scala index e0e089d0b2..d208a9f9c2 100644 --- a/src/compiler/scala/tools/util/VerifyClass.scala +++ b/src/compiler/scala/tools/util/VerifyClass.scala @@ -2,7 +2,7 @@ package scala.tools.util import scala.tools.nsc.io._ import java.net.URLClassLoader -import collection.JavaConverters._ +import scala.collection.JavaConverters._ object VerifyClass { diff --git a/src/continuations/library/scala/util/continuations/ControlContext.scala b/src/continuations/library/scala/util/continuations/ControlContext.scala index 910ca60eb0..37e3f45a4f 100644 --- a/src/continuations/library/scala/util/continuations/ControlContext.scala +++ b/src/continuations/library/scala/util/continuations/ControlContext.scala @@ -8,7 +8,7 @@ package scala.util.continuations -import annotation.{ Annotation, StaticAnnotation, TypeConstraint } +import scala.annotation.{ Annotation, StaticAnnotation, TypeConstraint } /** This annotation is used to mark a parameter as part of a continuation * context. diff --git a/src/detach/library/scala/remoting/Channel.scala b/src/detach/library/scala/remoting/Channel.scala index 54b8fb100e..18944a152d 100644 --- a/src/detach/library/scala/remoting/Channel.scala +++ b/src/detach/library/scala/remoting/Channel.scala @@ -116,7 +116,7 @@ class Channel protected (socket: Socket) { * the expected type. */ @throws(classOf[ChannelException]) - def receive[T](implicit expected: reflect.ClassTag[T]): T = { + def receive[T](implicit expected: scala.reflect.ClassTag[T]): T = { val found = in.readObject().asInstanceOf[reflect.ClassTag[_]] info("receive: found="+found+", expected="+expected) import scala.reflect.ClassTag @@ -144,11 +144,11 @@ class Channel protected (socket: Socket) { /** <code>?</code> method may throw either an * <code>ClassNotFoundException</code> or an <code>IOException</code>. */ - def ?[T](implicit t: reflect.ClassTag[T]): T = receive[T](t) + def ?[T](implicit t: scala.reflect.ClassTag[T]): T = receive[T](t) /** <code>send</code> method may throw an <code>IOException</code>. */ - def send[T](x: T)(implicit t: reflect.ClassTag[T]) { + def send[T](x: T)(implicit t: scala.reflect.ClassTag[T]) { out writeObject t x match { case x: Unit => // nop @@ -168,7 +168,7 @@ class Channel protected (socket: Socket) { /** <code>!</code> method may throw an <code>IOException</code>. */ - def ![T](x: T)(implicit m: reflect.ClassTag[T]) { send(x)(m) } + def ![T](x: T)(implicit m: scala.reflect.ClassTag[T]) { send(x)(m) } def close() { try { socket.close() } diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index de61d40cd5..c61a255e3b 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -11,7 +11,7 @@ package scala import scala.collection.generic._ import scala.collection.{ mutable, immutable } import mutable.{ ArrayBuilder, ArraySeq } -import compat.Platform.arraycopy +import scala.compat.Platform.arraycopy import scala.reflect.ClassTag import scala.runtime.ScalaRunTime.{ array_apply, array_update } diff --git a/src/library/scala/Boolean.scala b/src/library/scala/Boolean.scala index 617c2eac36..d7311078ab 100644 --- a/src/library/scala/Boolean.scala +++ b/src/library/scala/Boolean.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Boolean` (equivalent to Java's `boolean` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Boolean` are not diff --git a/src/library/scala/Byte.scala b/src/library/scala/Byte.scala index 7a5a36c5f6..02ef913fc5 100644 --- a/src/library/scala/Byte.scala +++ b/src/library/scala/Byte.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Byte`, a 8-bit signed integer (equivalent to Java's `byte` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Byte` are not diff --git a/src/library/scala/Char.scala b/src/library/scala/Char.scala index 5b0caf327f..5a1bf16f1d 100644 --- a/src/library/scala/Char.scala +++ b/src/library/scala/Char.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Char`, a 16-bit unsigned integer (equivalent to Java's `char` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Char` are not diff --git a/src/library/scala/Double.scala b/src/library/scala/Double.scala index 09b393e515..7bebbf9418 100644 --- a/src/library/scala/Double.scala +++ b/src/library/scala/Double.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Double`, a 64-bit IEEE-754 floating point number (equivalent to Java's `double` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Double` are not diff --git a/src/library/scala/Float.scala b/src/library/scala/Float.scala index 4aa74244b0..79ed2ac20b 100644 --- a/src/library/scala/Float.scala +++ b/src/library/scala/Float.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Float`, a 32-bit IEEE-754 floating point number (equivalent to Java's `float` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Float` are not diff --git a/src/library/scala/Int.scala b/src/library/scala/Int.scala index 8f05596633..fa2f9a97e7 100644 --- a/src/library/scala/Int.scala +++ b/src/library/scala/Int.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Int`, a 32-bit signed integer (equivalent to Java's `int` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Int` are not diff --git a/src/library/scala/Long.scala b/src/library/scala/Long.scala index 7447fa3a15..94204e893c 100644 --- a/src/library/scala/Long.scala +++ b/src/library/scala/Long.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Long`, a 64-bit signed integer (equivalent to Java's `long` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Long` are not diff --git a/src/library/scala/LowPriorityImplicits.scala b/src/library/scala/LowPriorityImplicits.scala index 8c49d2f67b..7697a7367a 100644 --- a/src/library/scala/LowPriorityImplicits.scala +++ b/src/library/scala/LowPriorityImplicits.scala @@ -12,7 +12,7 @@ import scala.collection.{ mutable, immutable, generic } import mutable.WrappedArray import immutable.WrappedString import generic.CanBuildFrom -import language.implicitConversions +import scala.language.implicitConversions /** The `LowPriorityImplicits` class provides implicit values that * are valid in all Scala compilation units without explicit qualification, diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index b7420f4447..945b0a0c3b 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -10,7 +10,7 @@ package scala object Option { - import language.implicitConversions + import scala.language.implicitConversions /** An implicit conversion that converts an option to an iterable value */ diff --git a/src/library/scala/PartialFunction.scala b/src/library/scala/PartialFunction.scala index d0a339bdd5..7c6e2d2e3e 100644 --- a/src/library/scala/PartialFunction.scala +++ b/src/library/scala/PartialFunction.scala @@ -211,8 +211,8 @@ object PartialFunction { @inline private final def checkFallback[B] = fallback_pf.asInstanceOf[PartialFunction[Any, B]] @inline private final def fallbackOccurred[B](x: B) = (fallback_pf eq x.asInstanceOf[AnyRef]) - private final class Lifted[-A, +B] (val pf: PartialFunction[A, B]) - extends runtime.AbstractFunction1[A, Option[B]] { + private final class Lifted[-A, +B] (val pf: PartialFunction[A, B]) + extends scala.runtime.AbstractFunction1[A, Option[B]] { def apply(x: A): Option[B] = { val z = pf.applyOrElse(x, checkFallback[B]) @@ -220,7 +220,7 @@ object PartialFunction { } } - private final class Unlifted[A, B] (f: A => Option[B]) extends runtime.AbstractPartialFunction[A, B] { + private final class Unlifted[A, B] (f: A => Option[B]) extends scala.runtime.AbstractPartialFunction[A, B] { def isDefinedAt(x: A): Boolean = f(x).isDefined override def applyOrElse[A1 <: A, B1 >: B](x: A1, default: A1 => B1): B1 = { diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index f3d36473dd..4792de6bf5 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -12,9 +12,9 @@ import scala.collection.{ mutable, immutable, generic } import immutable.StringOps import mutable.ArrayOps import generic.CanBuildFrom -import annotation.{ elidable, implicitNotFound } -import annotation.elidable.ASSERTION -import language.{implicitConversions, existentials} +import scala.annotation.{ elidable, implicitNotFound } +import scala.annotation.elidable.ASSERTION +import scala.language.{implicitConversions, existentials} /** The `Predef` object provides definitions that are accessible in all Scala * compilation units without explicit qualification. @@ -301,7 +301,7 @@ object Predef extends LowPriorityImplicits { implicit def exceptionWrapper(exc: Throwable) = new runtime.RichException(exc) implicit def tuple2ToZippedOps[T1, T2](x: (T1, T2)) = new runtime.Tuple2Zipped.Ops(x) implicit def tuple3ToZippedOps[T1, T2, T3](x: (T1, T2, T3)) = new runtime.Tuple3Zipped.Ops(x) - implicit def seqToCharSequence(xs: collection.IndexedSeq[Char]): CharSequence = new runtime.SeqCharSequence(xs) + implicit def seqToCharSequence(xs: scala.collection.IndexedSeq[Char]): CharSequence = new runtime.SeqCharSequence(xs) implicit def arrayToCharSequence(xs: Array[Char]): CharSequence = new runtime.ArrayCharSequence(xs, 0, xs.length) implicit def genericArrayOps[T](xs: Array[T]): ArrayOps[T] = (xs match { diff --git a/src/library/scala/SerialVersionUID.scala b/src/library/scala/SerialVersionUID.scala index 0cb924c3d4..f59aa94bd7 100644 --- a/src/library/scala/SerialVersionUID.scala +++ b/src/library/scala/SerialVersionUID.scala @@ -12,4 +12,4 @@ package scala * Annotation for specifying the `static SerialVersionUID` field * of a serializable class. */ -class SerialVersionUID(uid: Long) extends annotation.StaticAnnotation +class SerialVersionUID(uid: Long) extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/Short.scala b/src/library/scala/Short.scala index af7eb699d8..aef8608d2e 100644 --- a/src/library/scala/Short.scala +++ b/src/library/scala/Short.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Short`, a 16-bit signed integer (equivalent to Java's `short` primitive type) is a * subtype of [[scala.AnyVal]]. Instances of `Short` are not diff --git a/src/library/scala/Unit.scala b/src/library/scala/Unit.scala index 4156071f29..dc67e60314 100644 --- a/src/library/scala/Unit.scala +++ b/src/library/scala/Unit.scala @@ -10,7 +10,7 @@ package scala -import language.implicitConversions +import scala.language.implicitConversions /** `Unit` is a subtype of [[scala.AnyVal]]. There is only one value of type diff --git a/src/library/scala/annotation/bridge.scala b/src/library/scala/annotation/bridge.scala index a56129fb96..c3a7f47e62 100644 --- a/src/library/scala/annotation/bridge.scala +++ b/src/library/scala/annotation/bridge.scala @@ -11,4 +11,4 @@ package scala.annotation /** If this annotation is present on a method, it will be treated as a bridge method. */ @deprecated("Reconsider whether using this annotation will accomplish anything", "2.10.0") -private[scala] class bridge extends annotation.StaticAnnotation +private[scala] class bridge extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/cloneable.scala b/src/library/scala/annotation/cloneable.scala index aa45e8325f..dc2031ba8d 100644 --- a/src/library/scala/annotation/cloneable.scala +++ b/src/library/scala/annotation/cloneable.scala @@ -12,4 +12,4 @@ package scala.annotation * An annotation that designates the class to which it is applied as cloneable */ @deprecated("instead of `@cloneable class C`, use `class C extends Cloneable`", "2.10.0") -class cloneable extends annotation.StaticAnnotation +class cloneable extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/elidable.scala b/src/library/scala/annotation/elidable.scala index 18be2450f5..0b4f5ac4b2 100644 --- a/src/library/scala/annotation/elidable.scala +++ b/src/library/scala/annotation/elidable.scala @@ -22,7 +22,7 @@ import java.util.logging.Level * @elidable(123) // annotation priority * scalac -Xelide-below 456 // command line priority * }}} - * + * * The method call will be replaced with an expression which depends on * the type of the elided expression. In decreasing order of precedence: * @@ -33,10 +33,10 @@ import java.util.logging.Level * T >: Null null * T >: Nothing Predef.??? * }}} - * + * * Complete example: {{{ - import annotation._, elidable._ + import scala.annotation._, elidable._ object Test extends App { def expensiveComputation(): Int = { Thread.sleep(1000) ; 172 } @@ -62,7 +62,7 @@ import java.util.logging.Level * @author Paul Phillips * @since 2.8 */ -final class elidable(final val level: Int) extends annotation.StaticAnnotation {} +final class elidable(final val level: Int) extends scala.annotation.StaticAnnotation {} /** This useless appearing code was necessary to allow people to use * named constants for the elidable annotation. This is what it takes diff --git a/src/library/scala/annotation/implicitNotFound.scala b/src/library/scala/annotation/implicitNotFound.scala index 0c6a5d610f..993e99d382 100644 --- a/src/library/scala/annotation/implicitNotFound.scala +++ b/src/library/scala/annotation/implicitNotFound.scala @@ -15,4 +15,4 @@ package scala.annotation * @author Adriaan Moors * @since 2.8.1 */ -final class implicitNotFound(msg: String) extends annotation.StaticAnnotation {}
\ No newline at end of file +final class implicitNotFound(msg: String) extends scala.annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/meta/beanGetter.scala b/src/library/scala/annotation/meta/beanGetter.scala index 040a3f415a..48eccf9337 100644 --- a/src/library/scala/annotation/meta/beanGetter.scala +++ b/src/library/scala/annotation/meta/beanGetter.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class beanGetter extends annotation.StaticAnnotation +final class beanGetter extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/beanSetter.scala b/src/library/scala/annotation/meta/beanSetter.scala index 45ea063169..c9f68449fc 100644 --- a/src/library/scala/annotation/meta/beanSetter.scala +++ b/src/library/scala/annotation/meta/beanSetter.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class beanSetter extends annotation.StaticAnnotation +final class beanSetter extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/companionClass.scala b/src/library/scala/annotation/meta/companionClass.scala index 8e53f6caf9..d165f37bad 100644 --- a/src/library/scala/annotation/meta/companionClass.scala +++ b/src/library/scala/annotation/meta/companionClass.scala @@ -12,6 +12,6 @@ package scala.annotation.meta * conversion method for it. Annotations `@companionClass` and `@companionMethod` * control where an annotation on the implicit class will go. By default, annotations * on an implicit class end up only on the class. - * + * */ -final class companionClass extends annotation.StaticAnnotation +final class companionClass extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/companionMethod.scala b/src/library/scala/annotation/meta/companionMethod.scala index 379c4f3385..c069b47f04 100644 --- a/src/library/scala/annotation/meta/companionMethod.scala +++ b/src/library/scala/annotation/meta/companionMethod.scala @@ -12,6 +12,6 @@ package scala.annotation.meta * conversion method for it. Annotations `@companionClass` and `@companionMethod` * control where an annotation on the implicit class will go. By default, annotations * on an implicit class end up only on the class. - * + * */ -final class companionMethod extends annotation.StaticAnnotation +final class companionMethod extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/companionObject.scala b/src/library/scala/annotation/meta/companionObject.scala index d329df5c42..5bd58f6365 100644 --- a/src/library/scala/annotation/meta/companionObject.scala +++ b/src/library/scala/annotation/meta/companionObject.scala @@ -11,4 +11,4 @@ package scala.annotation.meta * Currently unused; intended as an annotation target for classes such as case classes * that automatically generate a companion object */ -final class companionObject extends annotation.StaticAnnotation +final class companionObject extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/field.scala b/src/library/scala/annotation/meta/field.scala index 78f4a98544..96ed13abc4 100644 --- a/src/library/scala/annotation/meta/field.scala +++ b/src/library/scala/annotation/meta/field.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class field extends annotation.StaticAnnotation +final class field extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/getter.scala b/src/library/scala/annotation/meta/getter.scala index 07e4512f00..0a28a5bb52 100644 --- a/src/library/scala/annotation/meta/getter.scala +++ b/src/library/scala/annotation/meta/getter.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class getter extends annotation.StaticAnnotation +final class getter extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/languageFeature.scala b/src/library/scala/annotation/meta/languageFeature.scala index 23acc01b51..2e0ddb91cf 100644 --- a/src/library/scala/annotation/meta/languageFeature.scala +++ b/src/library/scala/annotation/meta/languageFeature.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * An annotation giving particulars for a language feature in object `scala.language`. */ -final class languageFeature(feature: String, enableRequired: Boolean) extends annotation.StaticAnnotation +final class languageFeature(feature: String, enableRequired: Boolean) extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/param.scala b/src/library/scala/annotation/meta/param.scala index d9ebcc76d3..ef535d79c6 100644 --- a/src/library/scala/annotation/meta/param.scala +++ b/src/library/scala/annotation/meta/param.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class param extends annotation.StaticAnnotation +final class param extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/setter.scala b/src/library/scala/annotation/meta/setter.scala index c27cee2985..87ee2e28f4 100644 --- a/src/library/scala/annotation/meta/setter.scala +++ b/src/library/scala/annotation/meta/setter.scala @@ -10,4 +10,4 @@ package scala.annotation.meta /** * Consult the documentation in package [[scala.annotation.meta]]. */ -final class setter extends annotation.StaticAnnotation +final class setter extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/migration.scala b/src/library/scala/annotation/migration.scala index 8ab12a7c8e..f60c827620 100644 --- a/src/library/scala/annotation/migration.scala +++ b/src/library/scala/annotation/migration.scala @@ -24,7 +24,7 @@ package scala.annotation * * @since 2.8 */ - private[scala] final class migration(message: String, changedIn: String) extends annotation.StaticAnnotation { + private[scala] final class migration(message: String, changedIn: String) extends scala.annotation.StaticAnnotation { @deprecated("Use the constructor taking two Strings instead.", "2.10") def this(majorVersion: Int, minorVersion: Int, message: String) = this(message, majorVersion + "." + minorVersion) - }
\ No newline at end of file + } diff --git a/src/library/scala/annotation/serializable.scala b/src/library/scala/annotation/serializable.scala index 5a0d1261d6..e300ae9010 100644 --- a/src/library/scala/annotation/serializable.scala +++ b/src/library/scala/annotation/serializable.scala @@ -12,4 +12,4 @@ package scala.annotation * An annotation that designates the class to which it is applied as serializable */ @deprecated("instead of `@serializable class C`, use `class C extends Serializable`", "2.9.0") -class serializable extends annotation.StaticAnnotation +class serializable extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/strictfp.scala b/src/library/scala/annotation/strictfp.scala index e4efa6e663..4c33ea9678 100644 --- a/src/library/scala/annotation/strictfp.scala +++ b/src/library/scala/annotation/strictfp.scala @@ -15,4 +15,4 @@ package scala.annotation * @version 2.9 * @since 2.9 */ -class strictfp extends annotation.StaticAnnotation +class strictfp extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/switch.scala b/src/library/scala/annotation/switch.scala index ee068f50d4..a867783455 100644 --- a/src/library/scala/annotation/switch.scala +++ b/src/library/scala/annotation/switch.scala @@ -26,4 +26,4 @@ package scala.annotation * @author Paul Phillips * @since 2.8 */ -final class switch extends annotation.StaticAnnotation +final class switch extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/tailrec.scala b/src/library/scala/annotation/tailrec.scala index 14775535e8..020f0c4325 100644 --- a/src/library/scala/annotation/tailrec.scala +++ b/src/library/scala/annotation/tailrec.scala @@ -16,4 +16,4 @@ package scala.annotation * * @since 2.8 */ -final class tailrec extends annotation.StaticAnnotation +final class tailrec extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/unchecked/uncheckedStable.scala b/src/library/scala/annotation/unchecked/uncheckedStable.scala index 13b500fe44..8162a3ab11 100644 --- a/src/library/scala/annotation/unchecked/uncheckedStable.scala +++ b/src/library/scala/annotation/unchecked/uncheckedStable.scala @@ -12,4 +12,4 @@ package scala.annotation.unchecked * * @since 2.7 */ -final class uncheckedStable extends annotation.StaticAnnotation {} +final class uncheckedStable extends scala.annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/unchecked/uncheckedVariance.scala b/src/library/scala/annotation/unchecked/uncheckedVariance.scala index 51433be79f..61a0ebc6b8 100644 --- a/src/library/scala/annotation/unchecked/uncheckedVariance.scala +++ b/src/library/scala/annotation/unchecked/uncheckedVariance.scala @@ -12,4 +12,4 @@ package scala.annotation.unchecked * * @since 2.7 */ -final class uncheckedVariance extends annotation.StaticAnnotation {} +final class uncheckedVariance extends scala.annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/unspecialized.scala b/src/library/scala/annotation/unspecialized.scala index 28d9aa169c..717ca1597d 100644 --- a/src/library/scala/annotation/unspecialized.scala +++ b/src/library/scala/annotation/unspecialized.scala @@ -14,4 +14,4 @@ package scala.annotation * * @since 2.10 */ -class unspecialized extends annotation.StaticAnnotation +class unspecialized extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/annotation/varargs.scala b/src/library/scala/annotation/varargs.scala index 1d7a2f7183..b44f8c505e 100644 --- a/src/library/scala/annotation/varargs.scala +++ b/src/library/scala/annotation/varargs.scala @@ -14,4 +14,4 @@ package scala.annotation * * @since 2.9 */ -final class varargs extends annotation.StaticAnnotation +final class varargs extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/beans/BeanDescription.scala b/src/library/scala/beans/BeanDescription.scala index d6c9b0c736..5e1d3b873e 100644 --- a/src/library/scala/beans/BeanDescription.scala +++ b/src/library/scala/beans/BeanDescription.scala @@ -15,5 +15,5 @@ package scala.beans * * @author Ross Judson (rjudson@managedobjects.com) */ -class BeanDescription(val description: String) extends annotation.Annotation +class BeanDescription(val description: String) extends scala.annotation.Annotation diff --git a/src/library/scala/beans/BeanDisplayName.scala b/src/library/scala/beans/BeanDisplayName.scala index fbbfa08ffc..2c862e3700 100644 --- a/src/library/scala/beans/BeanDisplayName.scala +++ b/src/library/scala/beans/BeanDisplayName.scala @@ -14,5 +14,5 @@ package scala.beans * * @author Ross Judson (rjudson@managedobjects.com) */ -class BeanDisplayName(val name: String) extends annotation.Annotation +class BeanDisplayName(val name: String) extends scala.annotation.Annotation diff --git a/src/library/scala/beans/BeanInfo.scala b/src/library/scala/beans/BeanInfo.scala index 1a1d8defa4..23a55edfc5 100644 --- a/src/library/scala/beans/BeanInfo.scala +++ b/src/library/scala/beans/BeanInfo.scala @@ -17,4 +17,4 @@ package scala.beans * * @author Ross Judson (rjudson@managedobjects.com) */ -class BeanInfo extends annotation.Annotation +class BeanInfo extends scala.annotation.Annotation diff --git a/src/library/scala/beans/BeanInfoSkip.scala b/src/library/scala/beans/BeanInfoSkip.scala index 23adf74924..f08dde99d9 100644 --- a/src/library/scala/beans/BeanInfoSkip.scala +++ b/src/library/scala/beans/BeanInfoSkip.scala @@ -15,4 +15,4 @@ package scala.beans * * @author Ross Judson (rjudson@managedobjects.com) */ -class BeanInfoSkip extends annotation.Annotation +class BeanInfoSkip extends scala.annotation.Annotation diff --git a/src/library/scala/beans/BeanProperty.scala b/src/library/scala/beans/BeanProperty.scala index 4a2fb716c7..ab63e92c6f 100644 --- a/src/library/scala/beans/BeanProperty.scala +++ b/src/library/scala/beans/BeanProperty.scala @@ -23,4 +23,4 @@ package scala.beans * use the `scala.beans.BooleanBeanProperty` annotation instead. */ @scala.annotation.meta.field -class BeanProperty extends annotation.StaticAnnotation +class BeanProperty extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/beans/BooleanBeanProperty.scala b/src/library/scala/beans/BooleanBeanProperty.scala index 1c85a88c84..972d8fb77e 100644 --- a/src/library/scala/beans/BooleanBeanProperty.scala +++ b/src/library/scala/beans/BooleanBeanProperty.scala @@ -13,4 +13,4 @@ package scala.beans * named `isFieldName` instead of `getFieldName`. */ @scala.annotation.meta.field -class BooleanBeanProperty extends annotation.StaticAnnotation +class BooleanBeanProperty extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/collection/GenTraversableLike.scala b/src/library/scala/collection/GenTraversableLike.scala index 9b04256c8d..987f124f55 100644 --- a/src/library/scala/collection/GenTraversableLike.scala +++ b/src/library/scala/collection/GenTraversableLike.scala @@ -10,7 +10,7 @@ package scala.collection import generic._ -import annotation.migration +import scala.annotation.migration /** A template trait for all traversable collections upon which operations diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala index 4e0f71ee8b..a872bc0948 100644 --- a/src/library/scala/collection/GenTraversableOnce.scala +++ b/src/library/scala/collection/GenTraversableOnce.scala @@ -11,7 +11,7 @@ package scala.collection import scala.reflect.ClassTag import scala.collection.generic.CanBuildFrom import scala.annotation.unchecked.{ uncheckedVariance => uV } -import language.higherKinds +import scala.language.higherKinds /** A template trait for all traversable-once objects which may be * traversed in parallel. @@ -507,7 +507,7 @@ trait GenTraversableOnce[+A] extends Any { * $willNotTerminateInf * @return a buffer containing all elements of this $coll. */ - def toBuffer[A1 >: A]: collection.mutable.Buffer[A1] + def toBuffer[A1 >: A]: scala.collection.mutable.Buffer[A1] /** Converts this $coll to an unspecified Traversable. Will return * the same collection if this instance is already Traversable. @@ -565,7 +565,7 @@ trait GenTraversableOnce[+A] extends Any { /** Converts this $coll into another by copying all elements. * @tparam Col The collection type to build. * @return a new collection containing all elements of this $coll. - * + * * @usecase def to[Col[_]]: Col[A] * @inheritdoc * $willNotTerminateInf diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index ac6d754f9e..7ef3b39576 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -11,7 +11,7 @@ package scala.collection import generic._ import immutable.{ List, Stream } -import annotation.unchecked.uncheckedVariance +import scala.annotation.unchecked.uncheckedVariance /** A template trait for iterable collections of type `Iterable[A]`. * $iterableInfo diff --git a/src/library/scala/collection/IterableViewLike.scala b/src/library/scala/collection/IterableViewLike.scala index e0c8b21d09..d9ccb3f011 100644 --- a/src/library/scala/collection/IterableViewLike.scala +++ b/src/library/scala/collection/IterableViewLike.scala @@ -11,7 +11,7 @@ package scala.collection import generic._ import TraversableView.NoBuilder import immutable.Stream -import language.implicitConversions +import scala.language.implicitConversions /** A template trait for non-strict views of iterable collections. * $iterableViewInfo diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index 5f369de3b7..9989a8d9e8 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -9,7 +9,7 @@ package scala.collection import mutable.ArrayBuffer -import annotation.migration +import scala.annotation.migration import immutable.Stream import scala.collection.generic.CanBuildFrom import scala.annotation.unchecked.{ uncheckedVariance => uV } @@ -393,7 +393,7 @@ trait Iterator[+A] extends TraversableOnce[A] { def next() = if (hasNext) { hdDefined = false; hd } else empty.next() } - + /** Tests whether every element of this iterator relates to the * corresponding element of another collection by satisfying a test predicate. * @@ -1140,7 +1140,7 @@ trait Iterator[+A] extends TraversableOnce[A] { def toStream: Stream[A] = if (self.hasNext) Stream.cons(self.next, self.toStream) else Stream.empty[A] - + /** Converts this iterator to a string. * diff --git a/src/library/scala/collection/LinearSeqLike.scala b/src/library/scala/collection/LinearSeqLike.scala index bfe27ef94a..8e72c5618c 100644 --- a/src/library/scala/collection/LinearSeqLike.scala +++ b/src/library/scala/collection/LinearSeqLike.scala @@ -13,7 +13,7 @@ import generic._ import mutable.ListBuffer import immutable.List import scala.util.control.Breaks._ -import annotation.tailrec +import scala.annotation.tailrec /** A template trait for linear sequences of type `LinearSeq[A]`. * diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala index ed2a877631..3877f07089 100644 --- a/src/library/scala/collection/MapLike.scala +++ b/src/library/scala/collection/MapLike.scala @@ -11,7 +11,7 @@ package scala.collection import generic._ import mutable.{ Builder, MapBuilder } -import annotation.{migration, bridge} +import scala.annotation.{migration, bridge} import parallel.ParMap /** A template trait for maps, which associate keys with values. @@ -226,21 +226,21 @@ self => */ def default(key: A): B = throw new NoSuchElementException("key not found: " + key) - + protected class FilteredKeys(p: A => Boolean) extends AbstractMap[A, B] with DefaultMap[A, B] { override def foreach[C](f: ((A, B)) => C): Unit = for (kv <- self) if (p(kv._1)) f(kv) def iterator = self.iterator.filter(kv => p(kv._1)) override def contains(key: A) = self.contains(key) && p(key) def get(key: A) = if (!p(key)) None else self.get(key) } - + /** Filters this map by retaining only keys satisfying a predicate. * @param p the predicate used to test keys * @return an immutable map consisting only of those key value pairs of this map where the key satisfies * the predicate `p`. The resulting map wraps the original map without copying any elements. */ def filterKeys(p: A => Boolean): Map[A, B] = new FilteredKeys(p) - + protected class MappedValues[C](f: B => C) extends AbstractMap[A, C] with DefaultMap[A, C] { override def foreach[D](g: ((A, C)) => D): Unit = for ((k, v) <- self) g((k, f(v))) def iterator = for ((k, v) <- self.iterator) yield (k, f(v)) @@ -248,7 +248,7 @@ self => override def contains(key: A) = self.contains(key) def get(key: A) = self.get(key).map(f) } - + /** Transforms this map by applying a function to every retrieved value. * @param f the function used to transform values of this map. * @return a map view which maps every key of this map diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala index 04ec4af830..b359044f0d 100644 --- a/src/library/scala/collection/SetLike.scala +++ b/src/library/scala/collection/SetLike.scala @@ -11,7 +11,7 @@ package scala.collection import generic._ import mutable.{ Builder, SetBuilder } -import annotation.{migration, bridge} +import scala.annotation.{migration, bridge} import parallel.ParSet /** A template trait for sets. diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala index b2051bf209..411d17e935 100644 --- a/src/library/scala/collection/TraversableLike.scala +++ b/src/library/scala/collection/TraversableLike.scala @@ -10,10 +10,10 @@ package scala.collection import generic._ import mutable.{ Builder } -import annotation.{tailrec, migration, bridge} -import annotation.unchecked.{ uncheckedVariance => uV } +import scala.annotation.{tailrec, migration, bridge} +import scala.annotation.unchecked.{ uncheckedVariance => uV } import parallel.ParIterable -import language.higherKinds +import scala.language.higherKinds /** A template trait for traversable collections of type `Traversable[A]`. * diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index fb73805cc5..d77d278fca 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -10,9 +10,9 @@ package scala.collection import mutable.{ Buffer, Builder, ListBuffer, ArrayBuffer } import generic.CanBuildFrom -import annotation.unchecked.{ uncheckedVariance => uV } -import language.{implicitConversions, higherKinds} -import reflect.ClassTag +import scala.annotation.unchecked.{ uncheckedVariance => uV } +import scala.language.{implicitConversions, higherKinds} +import scala.reflect.ClassTag /** A template trait for collections which can be traversed either once only * or one or more times. @@ -374,12 +374,12 @@ object TraversableOnce { implicit def alternateImplicit[A](trav: TraversableOnce[A]) = new ForceImplicitAmbiguity implicit def flattenTraversableOnce[A, CC[_]](travs: TraversableOnce[CC[A]])(implicit ev: CC[A] => TraversableOnce[A]) = new FlattenOps[A](travs map ev) - + /* Functionality reused in Iterator.CanBuildFrom */ private[collection] abstract class BufferedCanBuildFrom[A, Coll[X] <: TraversableOnce[X]] extends generic.CanBuildFrom[Coll[_], A, Coll[A]] { def bufferToColl[B](buff: ArrayBuffer[B]): Coll[B] def traversableToColl[B](t: GenTraversable[B]): Coll[B] - + def newIterator: Builder[A, Coll[A]] = new ArrayBuffer[A] mapResult bufferToColl /** Creates a new builder on request of a collection. @@ -398,7 +398,7 @@ object TraversableOnce { */ def apply() = newIterator } - + /** With the advent of `TraversableOnce`, it can be useful to have a builder which * operates on `Iterator`s so they can be treated uniformly along with the collections. * See `scala.util.Random.shuffle` or `scala.concurrent.Future.sequence` for an example. @@ -407,10 +407,10 @@ object TraversableOnce { def bufferToColl[B](buff: ArrayBuffer[B]) = buff.iterator def traversableToColl[B](t: GenTraversable[B]) = t.seq } - + /** Evidence for building collections from `TraversableOnce` collections */ implicit def OnceCanBuildFrom[A] = new OnceCanBuildFrom[A] - + class FlattenOps[A](travs: TraversableOnce[TraversableOnce[A]]) { def flatten: Iterator[A] = new AbstractIterator[A] { val its = travs.toIterator diff --git a/src/library/scala/collection/TraversableProxyLike.scala b/src/library/scala/collection/TraversableProxyLike.scala index 74b30e0faf..b7be87b125 100644 --- a/src/library/scala/collection/TraversableProxyLike.scala +++ b/src/library/scala/collection/TraversableProxyLike.scala @@ -12,7 +12,7 @@ package scala.collection import generic._ import mutable.{Buffer, StringBuilder} -import reflect.ClassTag +import scala.reflect.ClassTag // Methods could be printed by cat TraversableLike.scala | egrep '^ (override )?def' diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala index 7fbcf1374b..5ee32e90b2 100644 --- a/src/library/scala/collection/TraversableViewLike.scala +++ b/src/library/scala/collection/TraversableViewLike.scala @@ -11,8 +11,8 @@ package scala.collection import generic._ import mutable.{ Builder, ArrayBuffer } import TraversableView.NoBuilder -import annotation.migration -import language.implicitConversions +import scala.annotation.migration +import scala.language.implicitConversions trait ViewMkString[+A] { self: Traversable[A] => diff --git a/src/library/scala/collection/concurrent/TrieMap.scala b/src/library/scala/collection/concurrent/TrieMap.scala index 3d0aa6fd07..7609910b65 100644 --- a/src/library/scala/collection/concurrent/TrieMap.scala +++ b/src/library/scala/collection/concurrent/TrieMap.scala @@ -9,17 +9,14 @@ package scala.collection package concurrent - - import java.util.concurrent.atomic._ -import collection.immutable.{ ListMap => ImmutableListMap } -import collection.parallel.mutable.ParTrieMap -import util.hashing.Hashing +import scala.collection.immutable.{ ListMap => ImmutableListMap } +import scala.collection.parallel.mutable.ParTrieMap +import scala.util.hashing.Hashing +import scala.util.control.ControlThrowable import generic._ -import annotation.tailrec -import annotation.switch - - +import scala.annotation.tailrec +import scala.annotation.switch private[collection] final class INode[K, V](bn: MainNode[K, V], g: Gen) extends INodeBase[K, V](g) { import INodeBase._ @@ -647,22 +644,22 @@ extends scala.collection.concurrent.Map[K, V] def hashing = hashingobj def equality = equalityobj @volatile var root = r - + def this(hashf: Hashing[K], ef: Equiv[K]) = this( INode.newRootNode, AtomicReferenceFieldUpdater.newUpdater(classOf[TrieMap[K, V]], classOf[AnyRef], "root"), hashf, ef ) - + def this() = this(Hashing.default, Equiv.universal) - + /* internal methods */ private def writeObject(out: java.io.ObjectOutputStream) { out.writeObject(hashf) out.writeObject(ef) - + val it = iterator while (it.hasNext) { val (k, v) = it.next() @@ -678,7 +675,7 @@ extends scala.collection.concurrent.Map[K, V] hashingobj = in.readObject().asInstanceOf[Hashing[K]] equalityobj = in.readObject().asInstanceOf[Equiv[K]] - + var obj: AnyRef = null do { obj = in.readObject() @@ -816,7 +813,7 @@ extends scala.collection.concurrent.Map[K, V] * * This method is used by other methods such as `size` and `iterator`. */ - @tailrec final def readOnlySnapshot(): collection.Map[K, V] = { + @tailrec final def readOnlySnapshot(): scala.collection.Map[K, V] = { val r = RDCSS_READ_ROOT() val expmain = r.gcasRead(this) if (RDCSS_ROOT(r, expmain, r.copyToGen(new Gen, this))) new TrieMap(r, null, hashing, equality) @@ -827,10 +824,10 @@ extends scala.collection.concurrent.Map[K, V] val r = RDCSS_READ_ROOT() if (!RDCSS_ROOT(r, r.gcasRead(this), INode.newRootNode[K, V])) clear() } - + @inline def computeHash(k: K) = hashingobj.hash(k) - + final def lookup(k: K): V = { val hc = computeHash(k) lookuphc(k, hc).asInstanceOf[V] @@ -917,11 +914,11 @@ object TrieMap extends MutableMapFactory[TrieMap] { implicit def canBuildFrom[K, V]: CanBuildFrom[Coll, (K, V), TrieMap[K, V]] = new MapCanBuildFrom[K, V] def empty[K, V]: TrieMap[K, V] = new TrieMap[K, V] - + class MangledHashing[K] extends Hashing[K] { def hash(k: K) = util.hashing.byteswap32(k.##) } - + } @@ -1058,7 +1055,7 @@ private[collection] class TrieMapIterator[K, V](var level: Int, private var ct: } -private[concurrent] object RestartException extends util.control.ControlThrowable +private[concurrent] object RestartException extends ControlThrowable /** Only used for ctrie serialization. */ @@ -1067,7 +1064,7 @@ private[concurrent] case object TrieMapSerializationEnd private[concurrent] object Debug { - import collection._ + import scala.collection._ lazy val logbuffer = new java.util.concurrent.ConcurrentLinkedQueue[AnyRef] @@ -1083,13 +1080,3 @@ private[concurrent] object Debug { } } - - - - - - - - - - diff --git a/src/library/scala/collection/convert/DecorateAsJava.scala b/src/library/scala/collection/convert/DecorateAsJava.scala index bde13f2830..e14769739d 100644 --- a/src/library/scala/collection/convert/DecorateAsJava.scala +++ b/src/library/scala/collection/convert/DecorateAsJava.scala @@ -12,7 +12,7 @@ package convert import java.{ lang => jl, util => ju }, java.util.{ concurrent => juc } import Decorators._ import WrapAsJava._ -import language.implicitConversions +import scala.language.implicitConversions /** A collection of decorators that allow to convert between diff --git a/src/library/scala/collection/convert/DecorateAsScala.scala b/src/library/scala/collection/convert/DecorateAsScala.scala index 539584b148..4ee7e2d1c7 100644 --- a/src/library/scala/collection/convert/DecorateAsScala.scala +++ b/src/library/scala/collection/convert/DecorateAsScala.scala @@ -12,7 +12,7 @@ package convert import java.{ lang => jl, util => ju }, java.util.{ concurrent => juc } import Decorators._ import WrapAsScala._ -import language.implicitConversions +import scala.language.implicitConversions trait DecorateAsScala { /** diff --git a/src/library/scala/collection/convert/WrapAsJava.scala b/src/library/scala/collection/convert/WrapAsJava.scala index fcfe402a68..c79c651e96 100644 --- a/src/library/scala/collection/convert/WrapAsJava.scala +++ b/src/library/scala/collection/convert/WrapAsJava.scala @@ -11,7 +11,7 @@ package convert import java.{ lang => jl, util => ju }, java.util.{ concurrent => juc } import Wrappers._ -import language.implicitConversions +import scala.language.implicitConversions trait WrapAsJava { /** @@ -253,7 +253,7 @@ trait WrapAsJava { case JConcurrentMapDeprecatedWrapper(wrapped) => wrapped case _ => new ConcurrentMapDeprecatedWrapper(m) } - + /** * Implicitly converts a Scala mutable `concurrent.Map` to a Java * `ConcurrentMap`. diff --git a/src/library/scala/collection/convert/WrapAsScala.scala b/src/library/scala/collection/convert/WrapAsScala.scala index c2994a0986..6ef4243d0d 100644 --- a/src/library/scala/collection/convert/WrapAsScala.scala +++ b/src/library/scala/collection/convert/WrapAsScala.scala @@ -11,7 +11,7 @@ package convert import java.{ lang => jl, util => ju }, java.util.{ concurrent => juc } import Wrappers._ -import language.implicitConversions +import scala.language.implicitConversions trait LowPriorityWrapAsScala { this: WrapAsScala => diff --git a/src/library/scala/collection/convert/Wrappers.scala b/src/library/scala/collection/convert/Wrappers.scala index 7c97972c48..a459aa15be 100644 --- a/src/library/scala/collection/convert/Wrappers.scala +++ b/src/library/scala/collection/convert/Wrappers.scala @@ -178,12 +178,12 @@ private[collection] trait Wrappers { var prev : Option[A] = None def hasNext = ui.hasNext - + def next() = { val (k, v) = ui.next prev = Some(k) new ju.Map.Entry[A, B] { - import util.hashing.byteswap32 + import scala.util.hashing.byteswap32 def getKey = k def getValue = v def setValue(v1 : B) = self.put(k, v1) diff --git a/src/library/scala/collection/generic/ClassTagTraversableFactory.scala b/src/library/scala/collection/generic/ClassTagTraversableFactory.scala index 95835d3e90..c9c75a5f23 100644 --- a/src/library/scala/collection/generic/ClassTagTraversableFactory.scala +++ b/src/library/scala/collection/generic/ClassTagTraversableFactory.scala @@ -9,8 +9,8 @@ package scala.collection package generic -import language.higherKinds -import reflect.ClassTag +import scala.language.higherKinds +import scala.reflect.ClassTag /** A template for companion objects of `ClassTagTraversable` and * subclasses thereof. diff --git a/src/library/scala/collection/generic/GenMapFactory.scala b/src/library/scala/collection/generic/GenMapFactory.scala index 31fe4e100d..6ce99646e8 100644 --- a/src/library/scala/collection/generic/GenMapFactory.scala +++ b/src/library/scala/collection/generic/GenMapFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic import mutable.{Builder, MapBuilder} -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `Map` and subclasses thereof. * diff --git a/src/library/scala/collection/generic/GenSeqFactory.scala b/src/library/scala/collection/generic/GenSeqFactory.scala index 19eeba9b1d..bb352f707c 100644 --- a/src/library/scala/collection/generic/GenSeqFactory.scala +++ b/src/library/scala/collection/generic/GenSeqFactory.scala @@ -11,7 +11,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of Seq and subclasses thereof. * diff --git a/src/library/scala/collection/generic/GenSetFactory.scala b/src/library/scala/collection/generic/GenSetFactory.scala index 4f812b337c..526927ce26 100644 --- a/src/library/scala/collection/generic/GenSetFactory.scala +++ b/src/library/scala/collection/generic/GenSetFactory.scala @@ -12,7 +12,7 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `Set` and subclasses thereof. * diff --git a/src/library/scala/collection/generic/GenTraversableFactory.scala b/src/library/scala/collection/generic/GenTraversableFactory.scala index 2aaf93de05..6b347db7a0 100644 --- a/src/library/scala/collection/generic/GenTraversableFactory.scala +++ b/src/library/scala/collection/generic/GenTraversableFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `Traversable` and subclasses thereof. * This class provides a set of operations to create `$Coll` objects. diff --git a/src/library/scala/collection/generic/GenericClassTagCompanion.scala b/src/library/scala/collection/generic/GenericClassTagCompanion.scala index 8cce592627..fd5a3bae4c 100644 --- a/src/library/scala/collection/generic/GenericClassTagCompanion.scala +++ b/src/library/scala/collection/generic/GenericClassTagCompanion.scala @@ -10,8 +10,8 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds -import reflect.ClassTag +import scala.language.higherKinds +import scala.reflect.ClassTag /** This class represents companions of classes which require ClassTags * for their element types. diff --git a/src/library/scala/collection/generic/GenericClassTagTraversableTemplate.scala b/src/library/scala/collection/generic/GenericClassTagTraversableTemplate.scala index d368d0007b..d5d6c53c1e 100644 --- a/src/library/scala/collection/generic/GenericClassTagTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericClassTagTraversableTemplate.scala @@ -10,9 +10,9 @@ package scala.collection package generic import mutable.Builder -import annotation.unchecked.uncheckedVariance -import language.higherKinds -import reflect.ClassTag +import scala.annotation.unchecked.uncheckedVariance +import scala.language.higherKinds +import scala.reflect.ClassTag /** This trait represents collections classes which require class * tags for their element types. diff --git a/src/library/scala/collection/generic/GenericCompanion.scala b/src/library/scala/collection/generic/GenericCompanion.scala index 1844542315..d4e77f68f5 100644 --- a/src/library/scala/collection/generic/GenericCompanion.scala +++ b/src/library/scala/collection/generic/GenericCompanion.scala @@ -10,7 +10,7 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds +import scala.language.higherKinds /** A template class for companion objects of "regular" collection classes * represent an unconstrained higher-kinded type. Typically diff --git a/src/library/scala/collection/generic/GenericOrderedCompanion.scala b/src/library/scala/collection/generic/GenericOrderedCompanion.scala index 290dc435c8..ba432f012a 100644 --- a/src/library/scala/collection/generic/GenericOrderedCompanion.scala +++ b/src/library/scala/collection/generic/GenericOrderedCompanion.scala @@ -10,7 +10,7 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds +import scala.language.higherKinds /** This class represents companions of classes which require the ordered trait * for their element types. diff --git a/src/library/scala/collection/generic/GenericOrderedTraversableTemplate.scala b/src/library/scala/collection/generic/GenericOrderedTraversableTemplate.scala index 6e04420315..b041670161 100644 --- a/src/library/scala/collection/generic/GenericOrderedTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericOrderedTraversableTemplate.scala @@ -12,8 +12,8 @@ package scala.collection package generic import mutable.Builder -import annotation.unchecked.uncheckedVariance -import language.higherKinds +import scala.annotation.unchecked.uncheckedVariance +import scala.language.higherKinds /** This trait represents collections classes which require * ordered element types. diff --git a/src/library/scala/collection/generic/GenericParCompanion.scala b/src/library/scala/collection/generic/GenericParCompanion.scala index 484da5c6d9..aea7d8f25a 100644 --- a/src/library/scala/collection/generic/GenericParCompanion.scala +++ b/src/library/scala/collection/generic/GenericParCompanion.scala @@ -11,7 +11,7 @@ package scala.collection.generic import scala.collection.parallel.Combiner import scala.collection.parallel.ParIterable import scala.collection.parallel.ParMap -import language.higherKinds +import scala.language.higherKinds /** A template class for companion objects of parallel collection classes. * They should be mixed in together with `GenericCompanion` type. diff --git a/src/library/scala/collection/generic/GenericParTemplate.scala b/src/library/scala/collection/generic/GenericParTemplate.scala index fc1c3f5eaa..3dfdc98133 100644 --- a/src/library/scala/collection/generic/GenericParTemplate.scala +++ b/src/library/scala/collection/generic/GenericParTemplate.scala @@ -13,8 +13,8 @@ import scala.collection.parallel.ParIterable import scala.collection.parallel.ParMap import scala.collection.parallel.TaskSupport -import annotation.unchecked.uncheckedVariance -import language.higherKinds +import scala.annotation.unchecked.uncheckedVariance +import scala.language.higherKinds /** A template trait for collections having a companion. * @@ -29,7 +29,7 @@ extends GenericTraversableTemplate[A, CC] { def companion: GenericCompanion[CC] with GenericParCompanion[CC] - protected[this] override def newBuilder: collection.mutable.Builder[A, CC[A]] = newCombiner + protected[this] override def newBuilder: scala.collection.mutable.Builder[A, CC[A]] = newCombiner protected[this] override def newCombiner: Combiner[A, CC[A]] = { val cb = companion.newCombiner[A] diff --git a/src/library/scala/collection/generic/GenericSeqCompanion.scala b/src/library/scala/collection/generic/GenericSeqCompanion.scala index 90063c1ca2..63fca78a98 100644 --- a/src/library/scala/collection/generic/GenericSeqCompanion.scala +++ b/src/library/scala/collection/generic/GenericSeqCompanion.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds trait GenericSeqCompanion[CC[X] <: Traversable[X]] - extends GenericCompanion[CC]
\ No newline at end of file + extends GenericCompanion[CC] diff --git a/src/library/scala/collection/generic/GenericSetTemplate.scala b/src/library/scala/collection/generic/GenericSetTemplate.scala index 221bcfb379..cf7259100d 100644 --- a/src/library/scala/collection/generic/GenericSetTemplate.scala +++ b/src/library/scala/collection/generic/GenericSetTemplate.scala @@ -8,7 +8,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** * @since 2.8 */ diff --git a/src/library/scala/collection/generic/GenericTraversableTemplate.scala b/src/library/scala/collection/generic/GenericTraversableTemplate.scala index 7cb0e812d8..62e7061237 100644 --- a/src/library/scala/collection/generic/GenericTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericTraversableTemplate.scala @@ -12,9 +12,9 @@ package scala.collection package generic import mutable.Builder -import annotation.migration -import annotation.unchecked.uncheckedVariance -import language.higherKinds +import scala.annotation.migration +import scala.annotation.unchecked.uncheckedVariance +import scala.language.higherKinds /** A template class for companion objects of ``regular`` collection classes * that represent an unconstrained higher-kinded type. @@ -128,7 +128,7 @@ trait GenericTraversableTemplate[+A, +CC[X] <: GenTraversable[X]] extends HasNew * @usecase def flatten[B]: $Coll[B] * * @inheritdoc - * + * * The resulting collection's type will be guided by the * static type of $coll. For example: * @@ -138,7 +138,7 @@ trait GenericTraversableTemplate[+A, +CC[X] <: GenTraversable[X]] extends HasNew * * val ys = Set(List(1, 2, 3), List(3, 2, 1)) * // ys == Set(1, 2, 3) - * }}} + * }}} */ def flatten[B](implicit asTraversable: A => /*<:<!!!*/ GenTraversableOnce[B]): CC[B] = { val b = genericBuilder[B] diff --git a/src/library/scala/collection/generic/ImmutableMapFactory.scala b/src/library/scala/collection/generic/ImmutableMapFactory.scala index d893188e92..9448222568 100644 --- a/src/library/scala/collection/generic/ImmutableMapFactory.scala +++ b/src/library/scala/collection/generic/ImmutableMapFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `immutable.Map` and subclasses thereof. * @author Martin Odersky diff --git a/src/library/scala/collection/generic/ImmutableSetFactory.scala b/src/library/scala/collection/generic/ImmutableSetFactory.scala index 7bd5bf2ef8..b6dc85470f 100644 --- a/src/library/scala/collection/generic/ImmutableSetFactory.scala +++ b/src/library/scala/collection/generic/ImmutableSetFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic import mutable.{ Builder, SetBuilder } -import language.higherKinds +import scala.language.higherKinds abstract class ImmutableSetFactory[CC[X] <: immutable.Set[X] with SetLike[X, CC[X]]] extends SetFactory[CC] { diff --git a/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala b/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala index f415a52b4d..19c52b77ed 100644 --- a/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala +++ b/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala @@ -11,7 +11,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `SortedMap` and subclasses thereof. * diff --git a/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala b/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala index 1317bb4796..64f35c35c4 100644 --- a/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala +++ b/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala @@ -11,7 +11,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `SortedSet` and subclasses thereof. * diff --git a/src/library/scala/collection/generic/IsTraversableLike.scala b/src/library/scala/collection/generic/IsTraversableLike.scala index 7288322903..efa9178740 100644 --- a/src/library/scala/collection/generic/IsTraversableLike.scala +++ b/src/library/scala/collection/generic/IsTraversableLike.scala @@ -42,7 +42,7 @@ trait IsTraversableLike[Repr] { } object IsTraversableLike { - import language.higherKinds + import scala.language.higherKinds implicit val stringRepr: IsTraversableLike[String] { type A = Char } = new IsTraversableLike[String] { @@ -50,7 +50,7 @@ object IsTraversableLike { val conversion = implicitly[String => GenTraversableLike[Char, String]] } - implicit def genTraversableLikeRepr[C[_], A0](implicit conv: C[A0] => GenTraversableLike[A0,C[A0]]): IsTraversableLike[C[A0]] { type A = A0 } = + implicit def genTraversableLikeRepr[C[_], A0](implicit conv: C[A0] => GenTraversableLike[A0,C[A0]]): IsTraversableLike[C[A0]] { type A = A0 } = new IsTraversableLike[C[A0]] { type A = A0 val conversion = conv diff --git a/src/library/scala/collection/generic/IsTraversableOnce.scala b/src/library/scala/collection/generic/IsTraversableOnce.scala index b336553231..49675b4d5e 100644 --- a/src/library/scala/collection/generic/IsTraversableOnce.scala +++ b/src/library/scala/collection/generic/IsTraversableOnce.scala @@ -45,7 +45,7 @@ trait IsTraversableOnce[Repr] { } object IsTraversableOnce { - import language.higherKinds + import scala.language.higherKinds implicit val stringRepr: IsTraversableOnce[String] { type A = Char } = new IsTraversableOnce[String] { @@ -53,7 +53,7 @@ object IsTraversableOnce { val conversion = implicitly[String => GenTraversableOnce[Char]] } - implicit def genTraversableLikeRepr[C[_], A0](implicit conv: C[A0] => GenTraversableOnce[A0]): IsTraversableOnce[C[A0]] { type A = A0 } = + implicit def genTraversableLikeRepr[C[_], A0](implicit conv: C[A0] => GenTraversableOnce[A0]): IsTraversableOnce[C[A0]] { type A = A0 } = new IsTraversableOnce[C[A0]] { type A = A0 val conversion = conv diff --git a/src/library/scala/collection/generic/IterableForwarder.scala b/src/library/scala/collection/generic/IterableForwarder.scala index 89b67a6c18..d1ba252ba7 100644 --- a/src/library/scala/collection/generic/IterableForwarder.scala +++ b/src/library/scala/collection/generic/IterableForwarder.scala @@ -11,7 +11,7 @@ package scala.collection.generic import scala.collection._ -import collection.mutable.Buffer +import scala.collection.mutable.Buffer /** This trait implements a forwarder for iterable objects. It forwards * all calls to a different iterable object, except for diff --git a/src/library/scala/collection/generic/MapFactory.scala b/src/library/scala/collection/generic/MapFactory.scala index ce44ae9bf4..cbf5e06202 100644 --- a/src/library/scala/collection/generic/MapFactory.scala +++ b/src/library/scala/collection/generic/MapFactory.scala @@ -11,7 +11,7 @@ package generic import mutable.{Builder, MapBuilder} -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `Map` and subclasses thereof. * diff --git a/src/library/scala/collection/generic/MutableMapFactory.scala b/src/library/scala/collection/generic/MutableMapFactory.scala index 8b38b4ddd5..3b3d6d1946 100644 --- a/src/library/scala/collection/generic/MutableMapFactory.scala +++ b/src/library/scala/collection/generic/MutableMapFactory.scala @@ -12,7 +12,7 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `mutable.Map` and subclasses thereof. * @author Martin Odersky diff --git a/src/library/scala/collection/generic/MutableSetFactory.scala b/src/library/scala/collection/generic/MutableSetFactory.scala index f130489814..516cbd722d 100644 --- a/src/library/scala/collection/generic/MutableSetFactory.scala +++ b/src/library/scala/collection/generic/MutableSetFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic import mutable.{ Builder, GrowingBuilder } -import language.higherKinds +import scala.language.higherKinds abstract class MutableSetFactory[CC[X] <: mutable.Set[X] with mutable.SetLike[X, CC[X]]] extends SetFactory[CC] { diff --git a/src/library/scala/collection/generic/MutableSortedSetFactory.scala b/src/library/scala/collection/generic/MutableSortedSetFactory.scala index 0e90ed999c..e5a69779f3 100644 --- a/src/library/scala/collection/generic/MutableSortedSetFactory.scala +++ b/src/library/scala/collection/generic/MutableSortedSetFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic import scala.collection.mutable.{ Builder, GrowingBuilder } -import language.higherKinds +import scala.language.higherKinds /** * @define Coll `mutable.SortedSet` diff --git a/src/library/scala/collection/generic/OrderedTraversableFactory.scala b/src/library/scala/collection/generic/OrderedTraversableFactory.scala index 92f166ae08..b3d096ccd2 100644 --- a/src/library/scala/collection/generic/OrderedTraversableFactory.scala +++ b/src/library/scala/collection/generic/OrderedTraversableFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds abstract class OrderedTraversableFactory[CC[X] <: Traversable[X] with GenericOrderedTraversableTemplate[X, CC]] extends GenericOrderedCompanion[CC] { diff --git a/src/library/scala/collection/generic/ParFactory.scala b/src/library/scala/collection/generic/ParFactory.scala index 41dca8fbe9..9624aafd06 100644 --- a/src/library/scala/collection/generic/ParFactory.scala +++ b/src/library/scala/collection/generic/ParFactory.scala @@ -10,7 +10,7 @@ package scala.collection.generic import scala.collection.parallel.ParIterable import scala.collection.parallel.Combiner -import language.higherKinds +import scala.language.higherKinds /** A template class for companion objects of `ParIterable` and subclasses * thereof. This class extends `TraversableFactory` and provides a set of diff --git a/src/library/scala/collection/generic/ParMapFactory.scala b/src/library/scala/collection/generic/ParMapFactory.scala index 5aedf67924..fdf23581f7 100644 --- a/src/library/scala/collection/generic/ParMapFactory.scala +++ b/src/library/scala/collection/generic/ParMapFactory.scala @@ -12,7 +12,7 @@ import scala.collection.parallel.ParMap import scala.collection.parallel.ParMapLike import scala.collection.parallel.Combiner import scala.collection.mutable.Builder -import language.higherKinds +import scala.language.higherKinds /** A template class for companion objects of `ParMap` and subclasses thereof. * This class extends `TraversableFactory` and provides a set of operations diff --git a/src/library/scala/collection/generic/ParSetFactory.scala b/src/library/scala/collection/generic/ParSetFactory.scala index 30a36a734a..e6db6f4721 100644 --- a/src/library/scala/collection/generic/ParSetFactory.scala +++ b/src/library/scala/collection/generic/ParSetFactory.scala @@ -8,11 +8,11 @@ package scala.collection.generic -import collection.mutable.Builder -import collection.parallel.Combiner -import collection.parallel.ParSet -import collection.parallel.ParSetLike -import language.higherKinds +import scala.collection.mutable.Builder +import scala.collection.parallel.Combiner +import scala.collection.parallel.ParSet +import scala.collection.parallel.ParSetLike +import scala.language.higherKinds /** * @author Aleksandar Prokopec diff --git a/src/library/scala/collection/generic/SeqFactory.scala b/src/library/scala/collection/generic/SeqFactory.scala index 3f61de6ceb..e943b93ef0 100644 --- a/src/library/scala/collection/generic/SeqFactory.scala +++ b/src/library/scala/collection/generic/SeqFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of Seq and subclasses thereof. * diff --git a/src/library/scala/collection/generic/SetFactory.scala b/src/library/scala/collection/generic/SetFactory.scala index 646e99dd1e..f386596c26 100644 --- a/src/library/scala/collection/generic/SetFactory.scala +++ b/src/library/scala/collection/generic/SetFactory.scala @@ -12,7 +12,7 @@ package scala.collection package generic import mutable.Builder -import language.higherKinds +import scala.language.higherKinds abstract class SetFactory[CC[X] <: Set[X] with SetLike[X, CC[X]]] - extends GenSetFactory[CC] with GenericSeqCompanion[CC]
\ No newline at end of file + extends GenSetFactory[CC] with GenericSeqCompanion[CC] diff --git a/src/library/scala/collection/generic/SortedMapFactory.scala b/src/library/scala/collection/generic/SortedMapFactory.scala index f038c8b09b..2781cbcc15 100644 --- a/src/library/scala/collection/generic/SortedMapFactory.scala +++ b/src/library/scala/collection/generic/SortedMapFactory.scala @@ -12,7 +12,7 @@ package scala.collection package generic import mutable.{Builder, MapBuilder} -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of mutable.Map and subclasses thereof. * diff --git a/src/library/scala/collection/generic/SortedSetFactory.scala b/src/library/scala/collection/generic/SortedSetFactory.scala index bb261803a9..4abccd3827 100644 --- a/src/library/scala/collection/generic/SortedSetFactory.scala +++ b/src/library/scala/collection/generic/SortedSetFactory.scala @@ -12,7 +12,7 @@ package scala.collection package generic import mutable.{Builder, SetBuilder} -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of Set and subclasses thereof. * diff --git a/src/library/scala/collection/generic/TraversableFactory.scala b/src/library/scala/collection/generic/TraversableFactory.scala index 254a6a224f..a09b92a75b 100644 --- a/src/library/scala/collection/generic/TraversableFactory.scala +++ b/src/library/scala/collection/generic/TraversableFactory.scala @@ -10,7 +10,7 @@ package scala.collection package generic -import language.higherKinds +import scala.language.higherKinds /** A template for companion objects of `Traversable` and subclasses thereof. * This class provides a set of operations to create `$Coll` objects. diff --git a/src/library/scala/collection/generic/TraversableForwarder.scala b/src/library/scala/collection/generic/TraversableForwarder.scala index 5c55c27983..62c1dc095b 100644 --- a/src/library/scala/collection/generic/TraversableForwarder.scala +++ b/src/library/scala/collection/generic/TraversableForwarder.scala @@ -11,7 +11,7 @@ package scala.collection.generic import scala.collection._ import mutable.{ Buffer, StringBuilder } import immutable.{ List, Stream } -import reflect.ClassTag +import scala.reflect.ClassTag /** This trait implements a forwarder for traversable objects. It forwards * all calls to a different traversable, except for: diff --git a/src/library/scala/collection/generic/package.scala b/src/library/scala/collection/generic/package.scala index 6eecb5e3ff..dd47b7ace6 100644 --- a/src/library/scala/collection/generic/package.scala +++ b/src/library/scala/collection/generic/package.scala @@ -1,7 +1,7 @@ package scala.collection import generic.CanBuildFrom -import language.higherKinds +import scala.language.higherKinds package object generic { type CanBuild[-Elem, +To] = CanBuildFrom[Nothing, Elem, To] diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala index b41327ed95..01372aa618 100644 --- a/src/library/scala/collection/immutable/HashMap.scala +++ b/src/library/scala/collection/immutable/HashMap.scala @@ -10,7 +10,7 @@ package scala.collection package immutable import generic._ -import annotation.unchecked.{ uncheckedVariance=> uV } +import scala.annotation.unchecked.{ uncheckedVariance=> uV } import parallel.immutable.ParHashMap /** This class implements immutable maps using a hash trie. @@ -72,7 +72,7 @@ class HashMap[A, +B] extends AbstractMap[A, B] } private[collection] def computeHash(key: A) = improve(elemHashCode(key)) - + import HashMap.{Merger, MergeFunction, liftMerger} private[collection] def get0(key: A, hash: Int, level: Int): Option[B] = None @@ -88,22 +88,22 @@ class HashMap[A, +B] extends AbstractMap[A, B] @deprecated("Use the `merged` method instead.", "2.10.0") def merge[B1 >: B](that: HashMap[A, B1], mergef: MergeFunction[A, B1] = null): HashMap[A, B1] = merge0(that, 0, liftMerger(mergef)) - + /** Creates a new map which is the merge of this and the argument hash map. - * + * * Uses the specified collision resolution function if two keys are the same. * The collision resolution function will always take the first argument from * `this` hash map and the second from `that`. - * + * * The `merged` method is on average more performant than doing a traversal and reconstructing a * new immutable hash map from scratch, or `++`. - * + * * @tparam B1 the value type of the other hash map * @param that the other hash map * @param mergef the merge function or null if the first key-value pair is to be picked */ def merged[B1 >: B](that: HashMap[A, B1])(mergef: MergeFunction[A, B1]): HashMap[A, B1] = merge0(that, 0, liftMerger(mergef)) - + protected def merge0[B1 >: B](that: HashMap[A, B1], level: Int, merger: Merger[A, B1]): HashMap[A, B1] = that override def par = ParHashMap.fromTrie(this) @@ -118,7 +118,7 @@ class HashMap[A, +B] extends AbstractMap[A, B] * @since 2.3 */ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { - + private abstract class Merger[A, B] { def apply(kv1: (A, B), kv2: (A, B)): (A, B) def invert: Merger[A, B] @@ -139,7 +139,7 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { def invert: Merger[A1, B1] = self } } - + /** $mapCanBuildFromInfo */ implicit def canBuildFrom[A, B]: CanBuildFrom[Coll, (A, B), HashMap[A, B]] = new MapCanBuildFrom[A, B] def empty[A, B]: HashMap[A, B] = EmptyHashMap.asInstanceOf[HashMap[A, B]] diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala index d9ce7a68f7..03af4deaae 100644 --- a/src/library/scala/collection/immutable/HashSet.scala +++ b/src/library/scala/collection/immutable/HashSet.scala @@ -11,9 +11,9 @@ package scala.collection package immutable -import annotation.unchecked.{ uncheckedVariance => uV } +import scala.annotation.unchecked.{ uncheckedVariance => uV } import generic._ -import collection.parallel.immutable.ParHashSet +import scala.collection.parallel.immutable.ParHashSet /** This class implements immutable sets using a hash trie. * diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 87b58005cf..b77e8b4c7c 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -13,7 +13,7 @@ package immutable import generic._ import mutable.{Builder, ListBuffer} -import annotation.tailrec +import scala.annotation.tailrec import java.io._ /** A class for immutable linked lists representing ordered collections @@ -330,7 +330,7 @@ case object Nil extends List[Nothing] { throw new UnsupportedOperationException("tail of empty list") // Removal of equals method here might lead to an infinite recursion similar to IntMap.equals. override def equals(that: Any) = that match { - case that1: collection.GenSeq[_] => that1.isEmpty + case that1: scala.collection.GenSeq[_] => that1.isEmpty case _ => false } } diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala index c21032603f..13282101b3 100644 --- a/src/library/scala/collection/immutable/ListMap.scala +++ b/src/library/scala/collection/immutable/ListMap.scala @@ -12,7 +12,7 @@ package scala.collection package immutable import generic._ -import annotation.{tailrec, bridge} +import scala.annotation.{tailrec, bridge} /** $factoryInfo * @since 1 diff --git a/src/library/scala/collection/immutable/ListSet.scala b/src/library/scala/collection/immutable/ListSet.scala index 4dd0d62fc0..6dcdee8938 100644 --- a/src/library/scala/collection/immutable/ListSet.scala +++ b/src/library/scala/collection/immutable/ListSet.scala @@ -10,7 +10,7 @@ package scala.collection package immutable import generic._ -import annotation.{tailrec, bridge} +import scala.annotation.{tailrec, bridge} import mutable.{ ListBuffer, Builder } /** $factoryInfo diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala index e73da01ac4..17951e73fd 100644 --- a/src/library/scala/collection/immutable/Map.scala +++ b/src/library/scala/collection/immutable/Map.scala @@ -76,7 +76,7 @@ object Map extends ImmutableMapFactory[Map] { def empty[A, B]: Map[A, B] = EmptyMap.asInstanceOf[Map[A, B]] - class WithDefault[A, +B](underlying: Map[A, B], d: A => B) extends collection.Map.WithDefault[A, B](underlying, d) with Map[A, B] { + class WithDefault[A, +B](underlying: Map[A, B], d: A => B) extends scala.collection.Map.WithDefault[A, B](underlying, d) with Map[A, B] { override def empty = new WithDefault(underlying.empty, d) override def updated[B1 >: B](key: A, value: B1): WithDefault[A, B1] = new WithDefault[A, B1](underlying.updated[B1](key, value), d) override def + [B1 >: B](kv: (A, B1)): WithDefault[A, B1] = updated(kv._1, kv._2) diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala index 7d373b7b39..8975b440d2 100644 --- a/src/library/scala/collection/immutable/PagedSeq.scala +++ b/src/library/scala/collection/immutable/PagedSeq.scala @@ -13,7 +13,7 @@ package immutable import java.io._ import scala.util.matching.Regex -import reflect.ClassTag +import scala.reflect.ClassTag /** The `PagedSeq` object defines a lazy implementations of * a random access sequence. diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala index e980dda847..8d82f4932f 100644 --- a/src/library/scala/collection/immutable/Queue.scala +++ b/src/library/scala/collection/immutable/Queue.scala @@ -11,7 +11,7 @@ package immutable import generic._ import mutable.{ Builder, ListBuffer } -import annotation.tailrec +import scala.annotation.tailrec /** `Queue` objects implement data structures that allow to * insert and retrieve elements in a first-in-first-out (FIFO) manner. diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala index 7607837491..a2875ec3fb 100644 --- a/src/library/scala/collection/immutable/Range.scala +++ b/src/library/scala/collection/immutable/Range.scala @@ -43,9 +43,9 @@ import scala.collection.parallel.immutable.ParRange */ @SerialVersionUID(7618862778670199309L) class Range(val start: Int, val end: Int, val step: Int) -extends collection.AbstractSeq[Int] +extends scala.collection.AbstractSeq[Int] with IndexedSeq[Int] - with collection.CustomParallelizable[Int, ParRange] + with scala.collection.CustomParallelizable[Int, ParRange] with Serializable { override def par = new ParRange(this) @@ -78,19 +78,19 @@ extends collection.AbstractSeq[Int] final val terminalElement = start + numRangeElements * step override def last = if (isEmpty) Nil.last else lastElement - + override def min[A1 >: Int](implicit ord: Ordering[A1]): Int = if (ord eq Ordering.Int) { if (step > 0) start else last } else super.min(ord) - - override def max[A1 >: Int](implicit ord: Ordering[A1]): Int = + + override def max[A1 >: Int](implicit ord: Ordering[A1]): Int = if (ord eq Ordering.Int) { if (step > 0) last else start } else super.max(ord) - + protected def copy(start: Int, end: Int, step: Int): Range = new Range(start, end, step) /** Create a new range with the `start` and `end` values of this range and diff --git a/src/library/scala/collection/immutable/RedBlackTree.scala b/src/library/scala/collection/immutable/RedBlackTree.scala index 4b573511d1..9eeebb641e 100644 --- a/src/library/scala/collection/immutable/RedBlackTree.scala +++ b/src/library/scala/collection/immutable/RedBlackTree.scala @@ -11,8 +11,8 @@ package scala.collection package immutable -import annotation.tailrec -import annotation.meta.getter +import scala.annotation.tailrec +import scala.annotation.meta.getter /** An object containing the RedBlack tree implementation used by for `TreeMaps` and `TreeSets`. * diff --git a/src/library/scala/collection/immutable/SortedMap.scala b/src/library/scala/collection/immutable/SortedMap.scala index f147b673f7..c0a1e0fec9 100644 --- a/src/library/scala/collection/immutable/SortedMap.scala +++ b/src/library/scala/collection/immutable/SortedMap.scala @@ -13,7 +13,7 @@ package immutable import generic._ import mutable.Builder -import annotation.unchecked.uncheckedVariance +import scala.annotation.unchecked.uncheckedVariance /** A map whose keys are sorted. * @@ -78,17 +78,17 @@ self => */ override def ++[B1 >: B](xs: GenTraversableOnce[(A, B1)]): SortedMap[A, B1] = ((repr: SortedMap[A, B1]) /: xs.seq) (_ + _) - + override def filterKeys(p: A => Boolean): SortedMap[A, B] = new FilteredKeys(p) with SortedMap.Default[A, B] { implicit def ordering: Ordering[A] = self.ordering override def rangeImpl(from : Option[A], until : Option[A]): SortedMap[A, B] = self.rangeImpl(from, until).filterKeys(p) } - + override def mapValues[C](f: B => C): SortedMap[A, C] = new MappedValues(f) with SortedMap.Default[A, C] { implicit def ordering: Ordering[A] = self.ordering override def rangeImpl(from : Option[A], until : Option[A]): SortedMap[A, C] = self.rangeImpl(from, until).mapValues(f) } - + } /** $factoryInfo @@ -99,8 +99,8 @@ object SortedMap extends ImmutableSortedMapFactory[SortedMap] { /** $sortedMapCanBuildFromInfo */ implicit def canBuildFrom[A, B](implicit ord: Ordering[A]): CanBuildFrom[Coll, (A, B), SortedMap[A, B]] = new SortedMapCanBuildFrom[A, B] def empty[A, B](implicit ord: Ordering[A]): SortedMap[A, B] = TreeMap.empty[A, B] - - private[collection] trait Default[A, +B] extends SortedMap[A, B] with collection.SortedMap.Default[A, B] { + + private[collection] trait Default[A, +B] extends SortedMap[A, B] with scala.collection.SortedMap.Default[A, B] { self => override def +[B1 >: B](kv: (A, B1)): SortedMap[A, B1] = { val b = SortedMap.newBuilder[A, B1] @@ -108,7 +108,7 @@ object SortedMap extends ImmutableSortedMapFactory[SortedMap] { b += ((kv._1, kv._2)) b.result } - + override def - (key: A): SortedMap[A, B] = { val b = newBuilder for (kv <- this; if kv._1 != key) b += kv diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index 97707d4f7c..bac90341ec 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -13,7 +13,7 @@ import generic._ import mutable.{Builder, StringBuilder, LazyBuilder, ListBuffer} import scala.annotation.tailrec import Stream.cons -import language.implicitConversions +import scala.language.implicitConversions /** The class `Stream` implements lazy lists where elements * are only evaluated when they are needed. Here is an example: @@ -631,7 +631,7 @@ self => * // (5,6) * }}} */ - override final def zip[A1 >: A, B, That](that: collection.GenIterable[B])(implicit bf: CanBuildFrom[Stream[A], (A1, B), That]): That = + override final def zip[A1 >: A, B, That](that: scala.collection.GenIterable[B])(implicit bf: CanBuildFrom[Stream[A], (A1, B), That]): That = // we assume there is no other builder factory on streams and therefore know that That = Stream[(A1, B)] if (isStreamBuilder(bf)) asThat( if (this.isEmpty || that.isEmpty) Stream.Empty diff --git a/src/library/scala/collection/immutable/StreamViewLike.scala b/src/library/scala/collection/immutable/StreamViewLike.scala index 3fd92aaff9..bb378bc337 100644 --- a/src/library/scala/collection/immutable/StreamViewLike.scala +++ b/src/library/scala/collection/immutable/StreamViewLike.scala @@ -51,19 +51,19 @@ extends SeqView[A, Coll] /** boilerplate */ protected override def newForced[B](xs: => collection.GenSeq[B]): Transformed[B] = new { val forced = xs } with AbstractTransformed[B] with Forced[B] - protected override def newAppended[B >: A](that: collection.GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B] + protected override def newAppended[B >: A](that: scala.collection.GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B] protected override def newMapped[B](f: A => B): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with Mapped[B] protected override def newFlatMapped[B](f: A => collection.GenTraversableOnce[B]): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with FlatMapped[B] protected override def newFiltered(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with Filtered protected override def newSliced(_endpoints: SliceInterval): Transformed[A] = new { val endpoints = _endpoints } with AbstractTransformed[A] with Sliced protected override def newDroppedWhile(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with DroppedWhile protected override def newTakenWhile(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with TakenWhile - protected override def newZipped[B](that: collection.GenIterable[B]): Transformed[(A, B)] = new { val other = that } with AbstractTransformed[(A, B)] with Zipped[B] - protected override def newZippedAll[A1 >: A, B](that: collection.GenIterable[B], _thisElem: A1, _thatElem: B): Transformed[(A1, B)] = { + protected override def newZipped[B](that: scala.collection.GenIterable[B]): Transformed[(A, B)] = new { val other = that } with AbstractTransformed[(A, B)] with Zipped[B] + protected override def newZippedAll[A1 >: A, B](that: scala.collection.GenIterable[B], _thisElem: A1, _thatElem: B): Transformed[(A1, B)] = { new { val other = that; val thisElem = _thisElem; val thatElem = _thatElem } with AbstractTransformed[(A1, B)] with ZippedAll[A1, B] } protected override def newReversed: Transformed[A] = new Reversed { } - protected override def newPatched[B >: A](_from: Int, _patch: collection.GenSeq[B], _replaced: Int): Transformed[B] = { + protected override def newPatched[B >: A](_from: Int, _patch: scala.collection.GenSeq[B], _replaced: Int): Transformed[B] = { new { val from = _from; val patch = _patch; val replaced = _replaced } with AbstractTransformed[B] with Patched[B] } protected override def newPrepended[B >: A](elem: B): Transformed[B] = new { protected[this] val fst = elem } with AbstractTransformed[B] with Prepended[B] diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala index af7662d2e0..4d28bf9518 100644 --- a/src/library/scala/collection/immutable/StringLike.scala +++ b/src/library/scala/collection/immutable/StringLike.scala @@ -13,7 +13,7 @@ import generic._ import mutable.Builder import scala.util.matching.Regex import scala.math.ScalaNumber -import reflect.ClassTag +import scala.reflect.ClassTag /** A companion object for the `StringLike` containing some constants. * @since 2.8 @@ -41,7 +41,7 @@ import StringLike._ * @define mayNotTerminateInf * @define willNotTerminateInf */ -trait StringLike[+Repr] extends Any with collection.IndexedSeqOptimized[Char, Repr] with Ordered[String] { +trait StringLike[+Repr] extends Any with scala.collection.IndexedSeqOptimized[Char, Repr] with Ordered[String] { self => /** Creates a string builder buffer as builder for this class */ diff --git a/src/library/scala/collection/immutable/TrieIterator.scala b/src/library/scala/collection/immutable/TrieIterator.scala index ead1a8c744..e8e904f1f9 100644 --- a/src/library/scala/collection/immutable/TrieIterator.scala +++ b/src/library/scala/collection/immutable/TrieIterator.scala @@ -11,7 +11,7 @@ package immutable import HashMap.{ HashTrieMap, HashMapCollision1, HashMap1 } import HashSet.{ HashTrieSet, HashSetCollision1, HashSet1 } -import annotation.unchecked.{ uncheckedVariance => uV } +import scala.annotation.unchecked.{ uncheckedVariance => uV } import scala.annotation.tailrec /** Abandons any pretense of type safety for speed. You can't say I diff --git a/src/library/scala/collection/immutable/Vector.scala b/src/library/scala/collection/immutable/Vector.scala index 4dfe147a65..82acf4ebbb 100644 --- a/src/library/scala/collection/immutable/Vector.scala +++ b/src/library/scala/collection/immutable/Vector.scala @@ -10,7 +10,7 @@ package scala.collection package immutable import scala.annotation.unchecked.uncheckedVariance -import compat.Platform +import scala.compat.Platform import scala.collection.generic._ import scala.collection.mutable.Builder import scala.collection.parallel.immutable.ParVector @@ -21,9 +21,9 @@ object Vector extends SeqFactory[Vector] { private[collection] class VectorReusableCBF extends GenericCanBuildFrom[Nothing] { override def apply() = newBuilder[Nothing] } - + private val VectorReusableCBF: GenericCanBuildFrom[Nothing] = new VectorReusableCBF - + @inline implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Vector[A]] = VectorReusableCBF.asInstanceOf[CanBuildFrom[Coll, A, Vector[A]]] def newBuilder[A]: Builder[A, Vector[A]] = new VectorBuilder[A] diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala index d5308c3b1a..90b7ca03de 100644 --- a/src/library/scala/collection/mutable/ArrayBuffer.scala +++ b/src/library/scala/collection/mutable/ArrayBuffer.scala @@ -66,7 +66,7 @@ class ArrayBuffer[A](override protected val initialSize: Int) override def sizeHint(len: Int) { if (len > size && len >= 1) { val newarray = new Array[AnyRef](len) - compat.Platform.arraycopy(array, 0, newarray, 0, size0) + scala.compat.Platform.arraycopy(array, 0, newarray, 0, size0) array = newarray } } @@ -93,7 +93,7 @@ class ArrayBuffer[A](override protected val initialSize: Int) * @return the updated buffer. */ override def ++=(xs: TraversableOnce[A]): this.type = xs match { - case v: collection.IndexedSeqLike[_, _] => + case v: scala.collection.IndexedSeqLike[_, _] => val n = v.length ensureSize(size0 + n) v.copyToArray(array.asInstanceOf[scala.Array[Any]], size0, n) diff --git a/src/library/scala/collection/mutable/ArrayOps.scala b/src/library/scala/collection/mutable/ArrayOps.scala index b3cd6a95c5..c87feaddc5 100644 --- a/src/library/scala/collection/mutable/ArrayOps.scala +++ b/src/library/scala/collection/mutable/ArrayOps.scala @@ -9,7 +9,7 @@ package scala.collection package mutable -import compat.Platform.arraycopy +import scala.compat.Platform.arraycopy import scala.reflect.ClassTag import scala.runtime.ScalaRunTime._ import parallel.mutable.ParArray @@ -62,7 +62,7 @@ trait ArrayOps[T] extends Any with ArrayLike[T, Array[T]] with CustomParalleliza */ def flatten[U](implicit asTrav: T => collection.Traversable[U], m: ClassTag[U]): Array[U] = { val b = Array.newBuilder[U] - b.sizeHint(map{case is: collection.IndexedSeq[_] => is.size case _ => 0}.sum) + b.sizeHint(map{case is: scala.collection.IndexedSeq[_] => is.size case _ => 0}.sum) for (xs <- this) b ++= asTrav(xs) b.result diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala index 8f834d265b..e408d74353 100644 --- a/src/library/scala/collection/mutable/ArrayStack.scala +++ b/src/library/scala/collection/mutable/ArrayStack.scala @@ -10,7 +10,7 @@ package scala.collection package mutable import generic._ -import reflect.ClassTag +import scala.reflect.ClassTag /** Factory object for the `ArrayStack` class. * diff --git a/src/library/scala/collection/mutable/BufferLike.scala b/src/library/scala/collection/mutable/BufferLike.scala index e77c1256a0..91983ba0d2 100644 --- a/src/library/scala/collection/mutable/BufferLike.scala +++ b/src/library/scala/collection/mutable/BufferLike.scala @@ -13,7 +13,7 @@ package mutable import generic._ import script._ -import annotation.{migration, bridge} +import scala.annotation.{migration, bridge} /** A template trait for buffers of type `Buffer[A]`. * @@ -93,7 +93,7 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] * @throws IndexOutOfBoundsException if the index `n` is not in the valid range * `0 <= n <= length`. */ - def insertAll(n: Int, elems: collection.Traversable[A]) + def insertAll(n: Int, elems: scala.collection.Traversable[A]) /** Removes the element at a given index from this buffer. * diff --git a/src/library/scala/collection/mutable/DoubleLinkedListLike.scala b/src/library/scala/collection/mutable/DoubleLinkedListLike.scala index ebccacf976..feff48cca3 100644 --- a/src/library/scala/collection/mutable/DoubleLinkedListLike.scala +++ b/src/library/scala/collection/mutable/DoubleLinkedListLike.scala @@ -11,7 +11,7 @@ package scala.collection package mutable -import annotation.migration +import scala.annotation.migration /** This extensible class may be used as a basis for implementing double * linked lists. Type variable `A` refers to the element type diff --git a/src/library/scala/collection/mutable/HashMap.scala b/src/library/scala/collection/mutable/HashMap.scala index bf640cdb90..da486f4042 100644 --- a/src/library/scala/collection/mutable/HashMap.scala +++ b/src/library/scala/collection/mutable/HashMap.scala @@ -98,12 +98,12 @@ extends AbstractMap[A, B] override def foreach[C](f: ((A, B)) => C): Unit = foreachEntry(e => f(e.key, e.value)) /* Override to avoid tuple allocation in foreach */ - override def keySet: collection.Set[A] = new DefaultKeySet { + override def keySet: scala.collection.Set[A] = new DefaultKeySet { override def foreach[C](f: A => C) = foreachEntry(e => f(e.key)) } /* Override to avoid tuple allocation in foreach */ - override def values: collection.Iterable[B] = new DefaultValuesIterable { + override def values: scala.collection.Iterable[B] = new DefaultValuesIterable { override def foreach[C](f: B => C) = foreachEntry(e => f(e.value)) } diff --git a/src/library/scala/collection/mutable/HashSet.scala b/src/library/scala/collection/mutable/HashSet.scala index e040d1e421..b263b46d36 100644 --- a/src/library/scala/collection/mutable/HashSet.scala +++ b/src/library/scala/collection/mutable/HashSet.scala @@ -12,7 +12,7 @@ package scala.collection package mutable import generic._ -import collection.parallel.mutable.ParHashSet +import scala.collection.parallel.mutable.ParHashSet /** This class implements mutable sets using a hashtable. * diff --git a/src/library/scala/collection/mutable/HashTable.scala b/src/library/scala/collection/mutable/HashTable.scala index 97e794f06e..67e7348672 100644 --- a/src/library/scala/collection/mutable/HashTable.scala +++ b/src/library/scala/collection/mutable/HashTable.scala @@ -452,7 +452,7 @@ private[collection] object HashTable { val seedvalue: Int, val sizemap: Array[Int] ) { - import collection.DebugUtils._ + import scala.collection.DebugUtils._ private[collection] def debugInformation = buildString { append => append("Hash table contents") diff --git a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala index 3232179dbb..1a3b7119a9 100644 --- a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala +++ b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala @@ -11,7 +11,7 @@ package scala.collection package mutable -import annotation.migration +import scala.annotation.migration /** This class can be used as an adaptor to create mutable maps from * immutable map implementations. Only method `empty` has @@ -42,17 +42,17 @@ extends AbstractMap[A, B] override def isDefinedAt(key: A) = imap.isDefinedAt(key) - override def keySet: collection.Set[A] = imap.keySet + override def keySet: scala.collection.Set[A] = imap.keySet override def keysIterator: Iterator[A] = imap.keysIterator @migration("`keys` returns Iterable[A] rather than Iterator[A].", "2.8.0") - override def keys: collection.Iterable[A] = imap.keys + override def keys: scala.collection.Iterable[A] = imap.keys override def valuesIterator: Iterator[B] = imap.valuesIterator @migration("`values` returns Iterable[B] rather than Iterator[B].", "2.8.0") - override def values: collection.Iterable[B] = imap.values + override def values: scala.collection.Iterable[B] = imap.values def iterator: Iterator[(A, B)] = imap.iterator diff --git a/src/library/scala/collection/mutable/IndexedSeqView.scala b/src/library/scala/collection/mutable/IndexedSeqView.scala index a0de2ec8ad..ab3d0ec312 100644 --- a/src/library/scala/collection/mutable/IndexedSeqView.scala +++ b/src/library/scala/collection/mutable/IndexedSeqView.scala @@ -14,7 +14,7 @@ package mutable import generic._ import TraversableView.NoBuilder -import language.implicitConversions +import scala.language.implicitConversions /** A non-strict view of a mutable `IndexedSeq`. * $viewInfo diff --git a/src/library/scala/collection/mutable/LinkedListLike.scala b/src/library/scala/collection/mutable/LinkedListLike.scala index 59004a3de6..307836907c 100644 --- a/src/library/scala/collection/mutable/LinkedListLike.scala +++ b/src/library/scala/collection/mutable/LinkedListLike.scala @@ -12,7 +12,7 @@ package scala.collection package mutable import generic._ -import annotation.tailrec +import scala.annotation.tailrec /** This extensible class may be used as a basis for implementing linked * list. Type variable `A` refers to the element type of the diff --git a/src/library/scala/collection/mutable/Map.scala b/src/library/scala/collection/mutable/Map.scala index 207b3f3324..8ae3f20cc8 100644 --- a/src/library/scala/collection/mutable/Map.scala +++ b/src/library/scala/collection/mutable/Map.scala @@ -71,7 +71,7 @@ object Map extends MutableMapFactory[Map] { def empty[A, B]: Map[A, B] = new HashMap[A, B] - class WithDefault[A, B](underlying: Map[A, B], d: A => B) extends collection.Map.WithDefault(underlying, d) with Map[A, B] { + class WithDefault[A, B](underlying: Map[A, B], d: A => B) extends scala.collection.Map.WithDefault(underlying, d) with Map[A, B] { override def += (kv: (A, B)) = {underlying += kv; this} def -= (key: A) = {underlying -= key; this} override def empty = new WithDefault(underlying.empty, d) diff --git a/src/library/scala/collection/mutable/MapLike.scala b/src/library/scala/collection/mutable/MapLike.scala index 3046207533..56be5adcca 100644 --- a/src/library/scala/collection/mutable/MapLike.scala +++ b/src/library/scala/collection/mutable/MapLike.scala @@ -11,7 +11,7 @@ package scala.collection package mutable import generic._ -import annotation.{migration, bridge} +import scala.annotation.{migration, bridge} import parallel.mutable.ParMap /** A template trait for mutable maps. diff --git a/src/library/scala/collection/mutable/ObservableBuffer.scala b/src/library/scala/collection/mutable/ObservableBuffer.scala index 6b5079e402..aaf26327b2 100644 --- a/src/library/scala/collection/mutable/ObservableBuffer.scala +++ b/src/library/scala/collection/mutable/ObservableBuffer.scala @@ -70,8 +70,8 @@ trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoa def undo() { throw new UnsupportedOperationException("cannot undo") } }) } - - abstract override def insertAll(n: Int, elems: collection.Traversable[A]) { + + abstract override def insertAll(n: Int, elems: scala.collection.Traversable[A]) { super.insertAll(n, elems) var curr = n - 1 val msg = elems.foldLeft(new Script[A]() with Undoable { @@ -83,5 +83,5 @@ trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoa } publish(msg) } - + } diff --git a/src/library/scala/collection/mutable/ResizableArray.scala b/src/library/scala/collection/mutable/ResizableArray.scala index c7d10573c9..54bf93252f 100644 --- a/src/library/scala/collection/mutable/ResizableArray.scala +++ b/src/library/scala/collection/mutable/ResizableArray.scala @@ -96,7 +96,7 @@ trait ResizableArray[A] extends IndexedSeq[A] newsize = newsize * 2 val newar: Array[AnyRef] = new Array(newsize) - compat.Platform.arraycopy(array, 0, newar, 0, size0) + scala.compat.Platform.arraycopy(array, 0, newar, 0, size0) array = newar } } @@ -112,7 +112,7 @@ trait ResizableArray[A] extends IndexedSeq[A] /** Move parts of the array. */ protected def copy(m: Int, n: Int, len: Int) { - compat.Platform.arraycopy(array, m, array, n, len) + scala.compat.Platform.arraycopy(array, m, array, n, len) } } diff --git a/src/library/scala/collection/mutable/SetBuilder.scala b/src/library/scala/collection/mutable/SetBuilder.scala index 582ca898c7..0a95a18392 100644 --- a/src/library/scala/collection/mutable/SetBuilder.scala +++ b/src/library/scala/collection/mutable/SetBuilder.scala @@ -19,7 +19,7 @@ import generic._ * @param empty The empty element of the collection. * @since 2.8 */ -class SetBuilder[A, Coll <: collection.Set[A] with collection.SetLike[A, Coll]](empty: Coll) extends Builder[A, Coll] { +class SetBuilder[A, Coll <: scala.collection.Set[A] with scala.collection.SetLike[A, Coll]](empty: Coll) extends Builder[A, Coll] { protected var elems: Coll = empty def +=(x: A): this.type = { elems = elems + x; this } def clear() { elems = empty } diff --git a/src/library/scala/collection/mutable/SetLike.scala b/src/library/scala/collection/mutable/SetLike.scala index 37313c8ca3..38342d4454 100644 --- a/src/library/scala/collection/mutable/SetLike.scala +++ b/src/library/scala/collection/mutable/SetLike.scala @@ -11,7 +11,7 @@ package mutable import generic._ import script._ -import annotation.{ migration, bridge } +import scala.annotation.{ migration, bridge } import parallel.mutable.ParSet /** A template trait for mutable sets of type `mutable.Set[A]`. diff --git a/src/library/scala/collection/mutable/SortedSet.scala b/src/library/scala/collection/mutable/SortedSet.scala index 78d12f3d64..809f584f4d 100644 --- a/src/library/scala/collection/mutable/SortedSet.scala +++ b/src/library/scala/collection/mutable/SortedSet.scala @@ -20,7 +20,7 @@ import generic._ * @author Lucien Pereira * */ -trait SortedSet[A] extends collection.SortedSet[A] with collection.SortedSetLike[A,SortedSet[A]] +trait SortedSet[A] extends scala.collection.SortedSet[A] with scala.collection.SortedSetLike[A,SortedSet[A]] with mutable.Set[A] with mutable.SetLike[A, SortedSet[A]] { /** Needs to be overridden in subclasses. */ diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala index db9e48d1cf..1ba531ac82 100644 --- a/src/library/scala/collection/mutable/Stack.scala +++ b/src/library/scala/collection/mutable/Stack.scala @@ -12,9 +12,9 @@ package scala.collection package mutable import generic._ -import collection.immutable.{List, Nil} -import collection.Iterator -import annotation.migration +import scala.collection.immutable.{List, Nil} +import scala.collection.Iterator +import scala.annotation.migration /** Factory object for the `mutable.Stack` class. * diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala index 08c881dbb8..92506548e9 100644 --- a/src/library/scala/collection/mutable/StringBuilder.scala +++ b/src/library/scala/collection/mutable/StringBuilder.scala @@ -10,7 +10,7 @@ package scala.collection package mutable import java.lang.{ StringBuilder => JavaStringBuilder } -import annotation.migration +import scala.annotation.migration import immutable.StringLike /** A builder for mutable sequence of characters. This class provides an API diff --git a/src/library/scala/collection/mutable/SynchronizedMap.scala b/src/library/scala/collection/mutable/SynchronizedMap.scala index 037b8ec5f5..6b3264a66d 100644 --- a/src/library/scala/collection/mutable/SynchronizedMap.scala +++ b/src/library/scala/collection/mutable/SynchronizedMap.scala @@ -11,7 +11,7 @@ package scala.collection package mutable -import annotation.migration +import scala.annotation.migration /** This class should be used as a mixin. It synchronizes the `Map` * functions of the class into which it is mixed in. @@ -41,14 +41,14 @@ trait SynchronizedMap[A, B] extends Map[A, B] { override def transform(f: (A, B) => B): this.type = synchronized[this.type] { super.transform(f) } override def retain(p: (A, B) => Boolean): this.type = synchronized[this.type] { super.retain(p) } @migration("`values` returns `Iterable[B]` rather than `Iterator[B]`.", "2.8.0") - override def values: collection.Iterable[B] = synchronized { super.values } + override def values: scala.collection.Iterable[B] = synchronized { super.values } override def valuesIterator: Iterator[B] = synchronized { super.valuesIterator } override def clone(): Self = synchronized { super.clone() } override def foreach[U](f: ((A, B)) => U) = synchronized { super.foreach(f) } override def apply(key: A): B = synchronized { super.apply(key) } - override def keySet: collection.Set[A] = synchronized { super.keySet } + override def keySet: scala.collection.Set[A] = synchronized { super.keySet } @migration("`keys` returns `Iterable[A]` rather than `Iterator[A]`.", "2.8.0") - override def keys: collection.Iterable[A] = synchronized { super.keys } + override def keys: scala.collection.Iterable[A] = synchronized { super.keys } override def keysIterator: Iterator[A] = synchronized { super.keysIterator } override def isEmpty: Boolean = synchronized { super.isEmpty } override def contains(key: A): Boolean = synchronized {super.contains(key) } diff --git a/src/library/scala/collection/mutable/UnrolledBuffer.scala b/src/library/scala/collection/mutable/UnrolledBuffer.scala index 6785aba10d..1c913c7ce7 100644 --- a/src/library/scala/collection/mutable/UnrolledBuffer.scala +++ b/src/library/scala/collection/mutable/UnrolledBuffer.scala @@ -8,11 +8,11 @@ package scala.collection.mutable -import collection.AbstractIterator -import collection.Iterator -import collection.generic._ -import annotation.tailrec -import reflect.ClassTag +import scala.collection.AbstractIterator +import scala.collection.Iterator +import scala.collection.generic._ +import scala.annotation.tailrec +import scala.reflect.ClassTag /** A buffer that stores elements in an unrolled linked list. * @@ -43,11 +43,11 @@ import reflect.ClassTag */ @SerialVersionUID(1L) class UnrolledBuffer[T](implicit val tag: ClassTag[T]) -extends collection.mutable.AbstractBuffer[T] - with collection.mutable.Buffer[T] - with collection.mutable.BufferLike[T, UnrolledBuffer[T]] +extends scala.collection.mutable.AbstractBuffer[T] + with scala.collection.mutable.Buffer[T] + with scala.collection.mutable.BufferLike[T, UnrolledBuffer[T]] with GenericClassTagTraversableTemplate[T, UnrolledBuffer] - with collection.mutable.Builder[T, UnrolledBuffer[T]] + with scala.collection.mutable.Builder[T, UnrolledBuffer[T]] with Serializable { import UnrolledBuffer.Unrolled @@ -153,7 +153,7 @@ extends collection.mutable.AbstractBuffer[T] this } - def insertAll(idx: Int, elems: collection.Traversable[T]) = + def insertAll(idx: Int, elems: scala.collection.Traversable[T]) = if (idx >= 0 && idx <= sz) { headptr.insertAll(idx, elems, this) sz += elems.size @@ -181,7 +181,7 @@ extends collection.mutable.AbstractBuffer[T] } override def clone(): UnrolledBuffer[T] = new UnrolledBuffer[T] ++= this - + override def stringPrefix = "UnrolledBuffer" } @@ -285,7 +285,7 @@ object UnrolledBuffer extends ClassTagTraversableFactory[UnrolledBuffer] { if (next eq null) true else false // checks if last node was thrown out } else false - @tailrec final def insertAll(idx: Int, t: collection.Traversable[T], buffer: UnrolledBuffer[T]): Unit = if (idx < size) { + @tailrec final def insertAll(idx: Int, t: scala.collection.Traversable[T], buffer: UnrolledBuffer[T]): Unit = if (idx < size) { // divide this node at the appropriate position and insert all into head // update new next val newnextnode = new Unrolled[T](0, new Array(array.length), null, buff) diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index ef693ab7ca..1959aab056 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -24,13 +24,13 @@ import scala.collection.GenIterable import scala.collection.GenTraversableOnce import scala.collection.GenTraversable import immutable.HashMapCombiner -import reflect.{ClassTag, classTag} +import scala.reflect.{ClassTag, classTag} import java.util.concurrent.atomic.AtomicBoolean -import annotation.unchecked.uncheckedVariance -import annotation.unchecked.uncheckedStable -import language.{ higherKinds, implicitConversions } +import scala.annotation.unchecked.uncheckedVariance +import scala.annotation.unchecked.uncheckedStable +import scala.language.{ higherKinds, implicitConversions } /** A template trait for parallel collections of type `ParIterable[T]`. @@ -263,7 +263,7 @@ self: ParIterableLike[T, Repr, Sequential] => /** The `newBuilder` operation returns a parallel builder assigned to this collection's fork/join pool. * This method forwards the call to `newCombiner`. */ - //protected[this] def newBuilder: collection.mutable.Builder[T, Repr] = newCombiner + //protected[this] def newBuilder: scala.collection.mutable.Builder[T, Repr] = newCombiner /** Optionally reuses an existing combiner for better performance. By default it doesn't - subclasses may override this behaviour. * The provided combiner `oldc` that can potentially be reused will be either some combiner from the previous computational task, or `None` if there @@ -859,7 +859,7 @@ self: ParIterableLike[T, Repr, Sequential] => override def toList: List[T] = seq.toList - override def toIndexedSeq: collection.immutable.IndexedSeq[T] = seq.toIndexedSeq + override def toIndexedSeq: scala.collection.immutable.IndexedSeq[T] = seq.toIndexedSeq override def toStream: Stream[T] = seq.toStream @@ -867,7 +867,7 @@ self: ParIterableLike[T, Repr, Sequential] => // the methods below are overridden - override def toBuffer[U >: T]: collection.mutable.Buffer[U] = seq.toBuffer // have additional, parallel buffers? + override def toBuffer[U >: T]: scala.collection.mutable.Buffer[U] = seq.toBuffer // have additional, parallel buffers? override def toTraversable: GenTraversable[T] = this.asInstanceOf[GenTraversable[T]] @@ -1496,7 +1496,7 @@ self: ParIterableLike[T, Repr, Sequential] => debugBuffer += s } - import collection.DebugUtils._ + import scala.collection.DebugUtils._ private[parallel] def printDebugBuffer() = println(buildString { append => for (s <- debugBuffer) { diff --git a/src/library/scala/collection/parallel/ParIterableViewLike.scala b/src/library/scala/collection/parallel/ParIterableViewLike.scala index 91eefc2aa5..4f6962ff05 100644 --- a/src/library/scala/collection/parallel/ParIterableViewLike.scala +++ b/src/library/scala/collection/parallel/ParIterableViewLike.scala @@ -18,7 +18,7 @@ import scala.collection.GenSeq import scala.collection.generic.{ CanBuildFrom, SliceInterval } import scala.collection.generic.CanCombineFrom import scala.collection.parallel.immutable.ParRange -import language.implicitConversions +import scala.language.implicitConversions diff --git a/src/library/scala/collection/parallel/ParMapLike.scala b/src/library/scala/collection/parallel/ParMapLike.scala index afd1f30903..8bf7334c5f 100644 --- a/src/library/scala/collection/parallel/ParMapLike.scala +++ b/src/library/scala/collection/parallel/ParMapLike.scala @@ -16,7 +16,7 @@ import scala.collection.MapLike import scala.collection.GenMapLike import scala.collection.Map import scala.collection.mutable.Builder -import annotation.unchecked.uncheckedVariance +import scala.annotation.unchecked.uncheckedVariance import scala.collection.generic.IdleSignalling import scala.collection.generic.Signalling diff --git a/src/library/scala/collection/parallel/Tasks.scala b/src/library/scala/collection/parallel/Tasks.scala index 7a0116b3b3..67552e1c89 100644 --- a/src/library/scala/collection/parallel/Tasks.scala +++ b/src/library/scala/collection/parallel/Tasks.scala @@ -16,7 +16,7 @@ import scala.concurrent.forkjoin._ import scala.concurrent.ExecutionContext import scala.util.control.Breaks._ -import annotation.unchecked.uncheckedVariance +import scala.annotation.unchecked.uncheckedVariance @@ -534,11 +534,11 @@ trait AdaptiveWorkStealingThreadPoolTasks extends ThreadPoolTasks with AdaptiveW trait ExecutionContextTasks extends Tasks { - + def executionContext = environment - + val environment: ExecutionContext - + // this part is a hack which allows switching val driver: Tasks = executionContext match { case eci: scala.concurrent.impl.ExecutionContextImpl => eci.executor match { @@ -548,13 +548,13 @@ trait ExecutionContextTasks extends Tasks { } case _ => ??? } - + def execute[R, Tp](task: Task[R, Tp]): () => R = driver execute task - + def executeAndWaitResult[R, Tp](task: Task[R, Tp]): R = driver executeAndWaitResult task - + def parallelismLevel = driver.parallelismLevel - + } diff --git a/src/library/scala/collection/parallel/immutable/ParHashMap.scala b/src/library/scala/collection/parallel/immutable/ParHashMap.scala index c9876c4d74..7f5255f5a3 100644 --- a/src/library/scala/collection/parallel/immutable/ParHashMap.scala +++ b/src/library/scala/collection/parallel/immutable/ParHashMap.scala @@ -20,8 +20,8 @@ import scala.collection.generic.CanCombineFrom import scala.collection.generic.GenericParMapTemplate import scala.collection.generic.GenericParMapCompanion import scala.collection.immutable.{ HashMap, TrieIterator } -import annotation.unchecked.uncheckedVariance -import collection.parallel.Task +import scala.annotation.unchecked.uncheckedVariance +import scala.collection.parallel.Task @@ -118,9 +118,9 @@ self => def remaining = sz - i override def toString = "HashTrieIterator(" + sz + ")" } - + /* debug */ - + private[parallel] def printDebugInfo() { println("Parallel hash trie") println("Top level inner trie type: " + trie.getClass) @@ -159,7 +159,7 @@ object ParHashMap extends ParMapFactory[ParHashMap] { private[parallel] abstract class HashMapCombiner[K, V] -extends collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V), HashMapCombiner[K, V]](HashMapCombiner.rootsize) { +extends scala.collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V), HashMapCombiner[K, V]](HashMapCombiner.rootsize) { //self: EnvironmentPassingCombiner[(K, V), ParHashMap[K, V]] => import HashMapCombiner._ val emptyTrie = HashMap.empty[K, V] @@ -202,7 +202,7 @@ extends collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V), Has def groupByKey[Repr](cbf: () => Combiner[V, Repr]): ParHashMap[K, Repr] = { val bucks = buckets.filter(_ != null).map(_.headPtr) val root = new Array[HashMap[K, AnyRef]](bucks.length) - + combinerTaskSupport.executeAndWaitResult(new CreateGroupedTrie(cbf, bucks, root, 0, bucks.length)) var bitmap = 0 diff --git a/src/library/scala/collection/parallel/immutable/ParHashSet.scala b/src/library/scala/collection/parallel/immutable/ParHashSet.scala index d1899601d7..42d00623ab 100644 --- a/src/library/scala/collection/parallel/immutable/ParHashSet.scala +++ b/src/library/scala/collection/parallel/immutable/ParHashSet.scala @@ -21,7 +21,7 @@ import scala.collection.generic.GenericParTemplate import scala.collection.generic.GenericParCompanion import scala.collection.generic.GenericCompanion import scala.collection.immutable.{ HashSet, TrieIterator } -import collection.parallel.Task +import scala.collection.parallel.Task @@ -132,7 +132,7 @@ object ParHashSet extends ParSetFactory[ParHashSet] { private[immutable] abstract class HashSetCombiner[T] -extends collection.parallel.BucketCombiner[T, ParHashSet[T], Any, HashSetCombiner[T]](HashSetCombiner.rootsize) { +extends scala.collection.parallel.BucketCombiner[T, ParHashSet[T], Any, HashSetCombiner[T]](HashSetCombiner.rootsize) { //self: EnvironmentPassingCombiner[T, ParHashSet[T]] => import HashSetCombiner._ val emptyTrie = HashSet.empty[T] diff --git a/src/library/scala/collection/parallel/immutable/ParIterable.scala b/src/library/scala/collection/parallel/immutable/ParIterable.scala index 349f4fa44c..4b0773ce7b 100644 --- a/src/library/scala/collection/parallel/immutable/ParIterable.scala +++ b/src/library/scala/collection/parallel/immutable/ParIterable.scala @@ -31,7 +31,7 @@ import scala.collection.GenIterable */ trait ParIterable[+T] extends collection/*.immutable*/.GenIterable[T] - with collection.parallel.ParIterable[T] + with scala.collection.parallel.ParIterable[T] with GenericParTemplate[T, ParIterable] with ParIterableLike[T, ParIterable[T], collection.immutable.Iterable[T]] with Immutable diff --git a/src/library/scala/collection/parallel/immutable/ParMap.scala b/src/library/scala/collection/parallel/immutable/ParMap.scala index 5060b36e7a..74b2672e67 100644 --- a/src/library/scala/collection/parallel/immutable/ParMap.scala +++ b/src/library/scala/collection/parallel/immutable/ParMap.scala @@ -56,7 +56,7 @@ self => * @param d the function mapping keys to values, used for non-present keys * @return a wrapper of the map with a default value */ - def withDefault[U >: V](d: K => U): collection.parallel.immutable.ParMap[K, U] = new ParMap.WithDefault[K, U](this, d) + def withDefault[U >: V](d: K => U): scala.collection.parallel.immutable.ParMap[K, U] = new ParMap.WithDefault[K, U](this, d) /** The same map with a given default value. * @@ -65,7 +65,7 @@ self => * @param d the function mapping keys to values, used for non-present keys * @return a wrapper of the map with a default value */ - def withDefaultValue[U >: V](d: U): collection.parallel.immutable.ParMap[K, U] = new ParMap.WithDefault[K, U](this, x => d) + def withDefaultValue[U >: V](d: U): scala.collection.parallel.immutable.ParMap[K, U] = new ParMap.WithDefault[K, U](this, x => d) } @@ -79,7 +79,7 @@ object ParMap extends ParMapFactory[ParMap] { implicit def canBuildFrom[K, V]: CanCombineFrom[Coll, (K, V), ParMap[K, V]] = new CanCombineFromMap[K, V] class WithDefault[K, +V](underlying: ParMap[K, V], d: K => V) - extends collection.parallel.ParMap.WithDefault[K, V](underlying, d) with ParMap[K, V] { + extends scala.collection.parallel.ParMap.WithDefault[K, V](underlying, d) with ParMap[K, V] { override def empty = new WithDefault(underlying.empty, d) override def updated[U >: V](key: K, value: U): WithDefault[K, U] = new WithDefault[K, U](underlying.updated[U](key, value), d) override def + [U >: V](kv: (K, U)): WithDefault[K, U] = updated(kv._1, kv._2) diff --git a/src/library/scala/collection/parallel/immutable/ParSeq.scala b/src/library/scala/collection/parallel/immutable/ParSeq.scala index dde6533c82..300efe9a58 100644 --- a/src/library/scala/collection/parallel/immutable/ParSeq.scala +++ b/src/library/scala/collection/parallel/immutable/ParSeq.scala @@ -29,7 +29,7 @@ import scala.collection.GenSeq */ trait ParSeq[+T] extends collection/*.immutable*/.GenSeq[T] - with collection.parallel.ParSeq[T] + with scala.collection.parallel.ParSeq[T] with ParIterable[T] with GenericParTemplate[T, ParSeq] with ParSeqLike[T, ParSeq[T], collection.immutable.Seq[T]] diff --git a/src/library/scala/collection/parallel/mutable/LazyCombiner.scala b/src/library/scala/collection/parallel/mutable/LazyCombiner.scala index 3694f40477..44ae7e2ce9 100644 --- a/src/library/scala/collection/parallel/mutable/LazyCombiner.scala +++ b/src/library/scala/collection/parallel/mutable/LazyCombiner.scala @@ -22,7 +22,7 @@ import scala.collection.parallel.Combiner * @tparam Buff the type of the buffers that contain leaf results and this combiner chains together */ trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] extends Combiner[Elem, To] { -//self: collection.parallel.EnvironmentPassingCombiner[Elem, To] => +//self: scala.collection.parallel.EnvironmentPassingCombiner[Elem, To] => val chain: ArrayBuffer[Buff] val lastbuff = chain.last def +=(elem: Elem) = { lastbuff += elem; this } diff --git a/src/library/scala/collection/parallel/mutable/ParFlatHashTable.scala b/src/library/scala/collection/parallel/mutable/ParFlatHashTable.scala index d0c7f6050e..c7f025207c 100644 --- a/src/library/scala/collection/parallel/mutable/ParFlatHashTable.scala +++ b/src/library/scala/collection/parallel/mutable/ParFlatHashTable.scala @@ -9,7 +9,7 @@ package scala.collection package parallel.mutable -import collection.parallel.IterableSplitter +import scala.collection.parallel.IterableSplitter /** Parallel flat hash table. * @@ -19,13 +19,13 @@ import collection.parallel.IterableSplitter * * @author Aleksandar Prokopec */ -trait ParFlatHashTable[T] extends collection.mutable.FlatHashTable[T] { +trait ParFlatHashTable[T] extends scala.collection.mutable.FlatHashTable[T] { override def alwaysInitSizeMap = true abstract class ParFlatHashTableIterator(var idx: Int, val until: Int, val totalsize: Int) extends IterableSplitter[T] with SizeMapUtils { - import collection.DebugUtils._ + import scala.collection.DebugUtils._ private var traversed = 0 private val itertable = table diff --git a/src/library/scala/collection/parallel/mutable/ParHashMap.scala b/src/library/scala/collection/parallel/mutable/ParHashMap.scala index 8d39d6e0de..33a39e6038 100644 --- a/src/library/scala/collection/parallel/mutable/ParHashMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParHashMap.scala @@ -12,12 +12,12 @@ package mutable -import collection.generic._ -import collection.mutable.DefaultEntry -import collection.mutable.HashEntry -import collection.mutable.HashTable -import collection.mutable.UnrolledBuffer -import collection.parallel.Task +import scala.collection.generic._ +import scala.collection.mutable.DefaultEntry +import scala.collection.mutable.HashEntry +import scala.collection.mutable.HashTable +import scala.collection.mutable.UnrolledBuffer +import scala.collection.parallel.Task @@ -157,8 +157,8 @@ object ParHashMap extends ParMapFactory[ParHashMap] { private[mutable] abstract class ParHashMapCombiner[K, V](private val tableLoadFactor: Int) -extends collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], DefaultEntry[K, V], ParHashMapCombiner[K, V]](ParHashMapCombiner.numblocks) - with collection.mutable.HashTable.HashUtils[K] +extends scala.collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], DefaultEntry[K, V], ParHashMapCombiner[K, V]](ParHashMapCombiner.numblocks) + with scala.collection.mutable.HashTable.HashUtils[K] { private var mask = ParHashMapCombiner.discriminantmask private var nonmasklen = ParHashMapCombiner.nonmasklength diff --git a/src/library/scala/collection/parallel/mutable/ParHashSet.scala b/src/library/scala/collection/parallel/mutable/ParHashSet.scala index 783f8dce77..870cae75de 100644 --- a/src/library/scala/collection/parallel/mutable/ParHashSet.scala +++ b/src/library/scala/collection/parallel/mutable/ParHashSet.scala @@ -10,11 +10,11 @@ package scala.collection.parallel.mutable -import collection.generic._ -import collection.mutable.FlatHashTable -import collection.parallel.Combiner -import collection.mutable.UnrolledBuffer -import collection.parallel.Task +import scala.collection.generic._ +import scala.collection.mutable.FlatHashTable +import scala.collection.parallel.Combiner +import scala.collection.mutable.UnrolledBuffer +import scala.collection.parallel.Task @@ -88,7 +88,7 @@ extends ParSet[T] init(in, x => x) } - import collection.DebugUtils._ + import scala.collection.DebugUtils._ override def debugInformation = buildString { append => append("Parallel flat hash table set") @@ -117,8 +117,8 @@ object ParHashSet extends ParSetFactory[ParHashSet] { private[mutable] abstract class ParHashSetCombiner[T](private val tableLoadFactor: Int) -extends collection.parallel.BucketCombiner[T, ParHashSet[T], Any, ParHashSetCombiner[T]](ParHashSetCombiner.numblocks) -with collection.mutable.FlatHashTable.HashUtils[T] { +extends scala.collection.parallel.BucketCombiner[T, ParHashSet[T], Any, ParHashSetCombiner[T]](ParHashSetCombiner.numblocks) +with scala.collection.mutable.FlatHashTable.HashUtils[T] { //self: EnvironmentPassingCombiner[T, ParHashSet[T]] => private var mask = ParHashSetCombiner.discriminantmask private var nonmasklen = ParHashSetCombiner.nonmasklength diff --git a/src/library/scala/collection/parallel/mutable/ParHashTable.scala b/src/library/scala/collection/parallel/mutable/ParHashTable.scala index 8c93732427..7cf464c287 100644 --- a/src/library/scala/collection/parallel/mutable/ParHashTable.scala +++ b/src/library/scala/collection/parallel/mutable/ParHashTable.scala @@ -13,8 +13,8 @@ package parallel.mutable -import collection.mutable.HashEntry -import collection.parallel.IterableSplitter +import scala.collection.mutable.HashEntry +import scala.collection.parallel.IterableSplitter @@ -22,7 +22,7 @@ import collection.parallel.IterableSplitter * enriching the data structure by fulfilling certain requirements * for their parallel construction and iteration. */ -trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends collection.mutable.HashTable[K, Entry] { +trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends scala.collection.mutable.HashTable[K, Entry] { override def alwaysInitSizeMap = true diff --git a/src/library/scala/collection/parallel/mutable/ParIterable.scala b/src/library/scala/collection/parallel/mutable/ParIterable.scala index b5747a31cf..a2847c3beb 100644 --- a/src/library/scala/collection/parallel/mutable/ParIterable.scala +++ b/src/library/scala/collection/parallel/mutable/ParIterable.scala @@ -27,7 +27,7 @@ import scala.collection.GenIterable * @since 2.9 */ trait ParIterable[T] extends collection/*.mutable*/.GenIterable[T] - with collection.parallel.ParIterable[T] + with scala.collection.parallel.ParIterable[T] with GenericParTemplate[T, ParIterable] with ParIterableLike[T, ParIterable[T], Iterable[T]] with Mutable { @@ -39,7 +39,7 @@ trait ParIterable[T] extends collection/*.mutable*/.GenIterable[T] override def toSeq: ParSeq[T] = toParCollection[T, ParSeq[T]](() => ParSeq.newCombiner[T]) - def seq: collection.mutable.Iterable[T] + def seq: scala.collection.mutable.Iterable[T] } /** $factoryInfo diff --git a/src/library/scala/collection/parallel/mutable/ParMap.scala b/src/library/scala/collection/parallel/mutable/ParMap.scala index 4b3eae4ad1..9ad14f15f8 100644 --- a/src/library/scala/collection/parallel/mutable/ParMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParMap.scala @@ -12,8 +12,8 @@ package scala.collection.parallel.mutable -import collection.generic._ -import collection.parallel.Combiner +import scala.collection.generic._ +import scala.collection.parallel.Combiner @@ -29,7 +29,7 @@ import collection.parallel.Combiner */ trait ParMap[K, V] extends collection/*.mutable*/.GenMap[K, V] - with collection.parallel.ParMap[K, V] + with scala.collection.parallel.ParMap[K, V] with /* mutable */ ParIterable[(K, V)] with GenericParMapTemplate[K, V, ParMap] with /* mutable */ ParMapLike[K, V, ParMap[K, V], collection.mutable.Map[K, V]] @@ -41,7 +41,7 @@ extends collection/*.mutable*/.GenMap[K, V] override def empty: ParMap[K, V] = new ParHashMap[K, V] - def seq: collection.mutable.Map[K, V] + def seq: scala.collection.mutable.Map[K, V] override def updated [U >: V](key: K, value: U): ParMap[K, U] = this + ((key, value)) @@ -53,7 +53,7 @@ extends collection/*.mutable*/.GenMap[K, V] * @param d the function mapping keys to values, used for non-present keys * @return a wrapper of the map with a default value */ - def withDefault(d: K => V): collection.parallel.mutable.ParMap[K, V] = new ParMap.WithDefault[K, V](this, d) + def withDefault(d: K => V): scala.collection.parallel.mutable.ParMap[K, V] = new ParMap.WithDefault[K, V](this, d) /** The same map with a given default value. * @@ -62,7 +62,7 @@ extends collection/*.mutable*/.GenMap[K, V] * @param d the function mapping keys to values, used for non-present keys * @return a wrapper of the map with a default value */ - def withDefaultValue(d: V): collection.parallel.mutable.ParMap[K, V] = new ParMap.WithDefault[K, V](this, x => d) + def withDefaultValue(d: V): scala.collection.parallel.mutable.ParMap[K, V] = new ParMap.WithDefault[K, V](this, x => d) } @@ -76,7 +76,7 @@ object ParMap extends ParMapFactory[ParMap] { implicit def canBuildFrom[K, V]: CanCombineFrom[Coll, (K, V), ParMap[K, V]] = new CanCombineFromMap[K, V] class WithDefault[K, V](underlying: ParMap[K, V], d: K => V) - extends collection.parallel.ParMap.WithDefault(underlying, d) with ParMap[K, V] { + extends scala.collection.parallel.ParMap.WithDefault(underlying, d) with ParMap[K, V] { override def += (kv: (K, V)) = {underlying += kv; this} def -= (key: K) = {underlying -= key; this} override def empty = new WithDefault(underlying.empty, d) diff --git a/src/library/scala/collection/parallel/mutable/ParMapLike.scala b/src/library/scala/collection/parallel/mutable/ParMapLike.scala index 5c69c2e045..675b20949f 100644 --- a/src/library/scala/collection/parallel/mutable/ParMapLike.scala +++ b/src/library/scala/collection/parallel/mutable/ParMapLike.scala @@ -11,11 +11,11 @@ package mutable -import collection.generic._ -import collection.mutable.Builder -import collection.mutable.Cloneable -import collection.generic.Growable -import collection.generic.Shrinkable +import scala.collection.generic._ +import scala.collection.mutable.Builder +import scala.collection.mutable.Cloneable +import scala.collection.generic.Growable +import scala.collection.generic.Shrinkable @@ -33,9 +33,9 @@ import collection.generic.Shrinkable trait ParMapLike[K, V, +Repr <: ParMapLike[K, V, Repr, Sequential] with ParMap[K, V], - +Sequential <: collection.mutable.Map[K, V] with collection.mutable.MapLike[K, V, Sequential]] -extends collection.GenMapLike[K, V, Repr] - with collection.parallel.ParMapLike[K, V, Repr, Sequential] + +Sequential <: scala.collection.mutable.Map[K, V] with scala.collection.mutable.MapLike[K, V, Sequential]] +extends scala.collection.GenMapLike[K, V, Repr] + with scala.collection.parallel.ParMapLike[K, V, Repr, Sequential] with Growable[(K, V)] with Shrinkable[K] with Cloneable[Repr] diff --git a/src/library/scala/collection/parallel/mutable/ParSeq.scala b/src/library/scala/collection/parallel/mutable/ParSeq.scala index f46b369494..15f8d1d0b5 100644 --- a/src/library/scala/collection/parallel/mutable/ParSeq.scala +++ b/src/library/scala/collection/parallel/mutable/ParSeq.scala @@ -29,9 +29,9 @@ import scala.collection.GenSeq * @define Coll `mutable.ParSeq` * @define coll mutable parallel sequence */ -trait ParSeq[T] extends collection/*.mutable*/.GenSeq[T] // was: collection.mutable.Seq[T] +trait ParSeq[T] extends collection/*.mutable*/.GenSeq[T] // was: scala.collection.mutable.Seq[T] with ParIterable[T] - with collection.parallel.ParSeq[T] + with scala.collection.parallel.ParSeq[T] with GenericParTemplate[T, ParSeq] with ParSeqLike[T, ParSeq[T], collection.mutable.Seq[T]] { self => @@ -40,7 +40,7 @@ self => def update(i: Int, elem: T): Unit - def seq: collection.mutable.Seq[T] + def seq: scala.collection.mutable.Seq[T] override def toSeq: ParSeq[T] = this } diff --git a/src/library/scala/collection/parallel/mutable/ParSet.scala b/src/library/scala/collection/parallel/mutable/ParSet.scala index 6da4c8a7bc..689ce3436f 100644 --- a/src/library/scala/collection/parallel/mutable/ParSet.scala +++ b/src/library/scala/collection/parallel/mutable/ParSet.scala @@ -29,14 +29,14 @@ import scala.collection.GenSet trait ParSet[T] extends collection/*.mutable*/.GenSet[T] with ParIterable[T] - with collection.parallel.ParSet[T] + with scala.collection.parallel.ParSet[T] with GenericParTemplate[T, ParSet] with ParSetLike[T, ParSet[T], collection.mutable.Set[T]] { self => override def companion: GenericCompanion[ParSet] with GenericParCompanion[ParSet] = ParSet override def empty: ParSet[T] = ParHashSet() - def seq: collection.mutable.Set[T] + def seq: scala.collection.mutable.Set[T] } diff --git a/src/library/scala/collection/parallel/mutable/ParSetLike.scala b/src/library/scala/collection/parallel/mutable/ParSetLike.scala index 969fc2a405..e41d779a4d 100644 --- a/src/library/scala/collection/parallel/mutable/ParSetLike.scala +++ b/src/library/scala/collection/parallel/mutable/ParSetLike.scala @@ -35,8 +35,8 @@ trait ParSetLike[T, +Repr <: ParSetLike[T, Repr, Sequential] with ParSet[T], +Sequential <: mutable.Set[T] with mutable.SetLike[T, Sequential]] extends GenSetLike[T, Repr] - with collection.parallel.ParIterableLike[T, Repr, Sequential] - with collection.parallel.ParSetLike[T, Repr, Sequential] + with scala.collection.parallel.ParIterableLike[T, Repr, Sequential] + with scala.collection.parallel.ParSetLike[T, Repr, Sequential] with Growable[T] with Shrinkable[T] with Cloneable[Repr] diff --git a/src/library/scala/collection/parallel/mutable/ParTrieMap.scala b/src/library/scala/collection/parallel/mutable/ParTrieMap.scala index 359c35f1dd..5c452f628c 100644 --- a/src/library/scala/collection/parallel/mutable/ParTrieMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParTrieMap.scala @@ -34,7 +34,7 @@ import scala.collection.concurrent.TrieMapIterator * @author Aleksandar Prokopec * @since 2.10 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_concurrent_tries Scala's Parallel Collections Library overview]] - * section on `ParTrieMap` for more information. + * section on `ParTrieMap` for more information. */ final class ParTrieMap[K, V] private[collection] (private val ctrie: TrieMap[K, V]) extends ParMap[K, V] @@ -130,7 +130,7 @@ extends TrieMapIterator[K, V](lev, ct, mustInit) protected override def newIterator(_lev: Int, _ct: TrieMap[K, V], _mustInit: Boolean) = new ParTrieMapSplitter[K, V](_lev, _ct, _mustInit) - override def shouldSplitFurther[S](coll: collection.parallel.ParIterable[S], parallelismLevel: Int) = { + override def shouldSplitFurther[S](coll: scala.collection.parallel.ParIterable[S], parallelismLevel: Int) = { val maxsplits = 3 + Integer.highestOneBit(parallelismLevel) level < maxsplits } diff --git a/src/library/scala/collection/parallel/package.scala b/src/library/scala/collection/parallel/package.scala index e3124af12e..30b4c0c914 100644 --- a/src/library/scala/collection/parallel/package.scala +++ b/src/library/scala/collection/parallel/package.scala @@ -12,8 +12,8 @@ import scala.collection.generic.CanBuildFrom import scala.collection.generic.CanCombineFrom import scala.collection.parallel.mutable.ParArray import scala.collection.mutable.UnrolledBuffer -import annotation.unchecked.uncheckedVariance -import language.implicitConversions +import scala.annotation.unchecked.uncheckedVariance +import scala.language.implicitConversions /** Package object for parallel collections. */ @@ -48,7 +48,7 @@ package object parallel { } else new ThreadPoolTaskSupport val defaultTaskSupport: TaskSupport = getTaskSupport - + def setTaskSupport[Coll](c: Coll, t: TaskSupport): Coll = { c match { case pc: ParIterableLike[_, _, _] => pc.tasksupport = t @@ -56,7 +56,7 @@ package object parallel { } c } - + /* implicit conversions */ implicit def factory2ops[From, Elem, To](bf: CanBuildFrom[From, Elem, To]) = new FactoryOps[From, Elem, To] { @@ -66,7 +66,7 @@ package object parallel { def otherwise(notbody: => R) = if (isParallel) isbody(asParallel) else notbody } } - implicit def traversable2ops[T](t: collection.GenTraversableOnce[T]) = new TraversableOps[T] { + implicit def traversable2ops[T](t: scala.collection.GenTraversableOnce[T]) = new TraversableOps[T] { def isParallel = t.isInstanceOf[Parallel] def isParIterable = t.isInstanceOf[ParIterable[_]] def asParIterable = t.asInstanceOf[ParIterable[T]] @@ -149,7 +149,7 @@ package parallel { * Automatically forwards the signal delegate when splitting. */ private[parallel] class BufferSplitter[T] - (private val buffer: collection.mutable.ArrayBuffer[T], private var index: Int, private val until: Int, _sigdel: collection.generic.Signalling) + (private val buffer: scala.collection.mutable.ArrayBuffer[T], private var index: Int, private val until: Int, _sigdel: scala.collection.generic.Signalling) extends IterableSplitter[T] { signalDelegate = _sigdel def hasNext = index < until diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala index a5d9cdd5d1..111900e7bc 100644 --- a/src/library/scala/concurrent/Future.scala +++ b/src/library/scala/concurrent/Future.scala @@ -8,7 +8,7 @@ package scala.concurrent -import language.higherKinds +import scala.language.higherKinds import java.util.concurrent.{ ConcurrentLinkedQueue, TimeUnit, Callable } import java.util.concurrent.TimeUnit.{ NANOSECONDS => NANOS, MILLISECONDS ⇒ MILLIS } @@ -212,7 +212,7 @@ trait Future[+T] extends Awaitable[T] { * this future, or the 'f' function to the failed result. If there is any non-fatal * exception thrown when 's' or 'f' is applied, that exception will be propagated * to the resulting future. - * + * * @param s function that transforms a successful result of the receiver into a * successful result of the returned future * @param f function that transforms a failure of the receiver into a failure of @@ -428,7 +428,7 @@ trait Future[+T] extends Awaitable[T] { */ def zip[U](that: Future[U]): Future[(T, U)] = { val p = Promise[(T, U)]() - + this onComplete { case f: Failure[_] => p complete f.asInstanceOf[Failure[(T, U)]] case Success(r) => @@ -439,7 +439,7 @@ trait Future[+T] extends Awaitable[T] { case f => p failure f } } - + p.future } @@ -555,7 +555,7 @@ trait Future[+T] extends Awaitable[T] { * Note: using this method yields nondeterministic dataflow programs. */ object Future { - + private[concurrent] val toBoxed = Map[Class[_], Class[_]]( classOf[Boolean] -> classOf[java.lang.Boolean], classOf[Byte] -> classOf[java.lang.Byte], @@ -569,19 +569,19 @@ object Future { ) /** Creates an already completed Future with the specified exception. - * + * * @tparam T the type of the value in the future * @return the newly created `Future` object */ def failed[T](exception: Throwable): Future[T] = Promise.failed(exception).future /** Creates an already completed Future with the specified result. - * + * * @tparam T the type of the value in the future * @return the newly created `Future` object */ def successful[T](result: T): Future[T] = Promise.successful(result).future - + /** Starts an asynchronous computation and returns a `Future` object with the result of that computation. * * The result becomes available once the asynchronous computation is completed. diff --git a/src/library/scala/concurrent/FutureTaskRunner.scala b/src/library/scala/concurrent/FutureTaskRunner.scala index d7f1e1c2f9..eeadaddb5e 100644 --- a/src/library/scala/concurrent/FutureTaskRunner.scala +++ b/src/library/scala/concurrent/FutureTaskRunner.scala @@ -8,7 +8,7 @@ package scala.concurrent -import language.{implicitConversions, higherKinds} +import scala.language.{implicitConversions, higherKinds} /** The `FutureTaskRunner</code> trait is a base trait of task runners * that provide some sort of future abstraction. diff --git a/src/library/scala/concurrent/JavaConversions.scala b/src/library/scala/concurrent/JavaConversions.scala index ffb9926fef..f66d64bc3b 100644 --- a/src/library/scala/concurrent/JavaConversions.scala +++ b/src/library/scala/concurrent/JavaConversions.scala @@ -9,7 +9,7 @@ package scala.concurrent import java.util.concurrent.{ExecutorService, Executor} -import language.implicitConversions +import scala.language.implicitConversions /** The `JavaConversions` object provides implicit converstions supporting * interoperability between Scala and Java concurrency classes. diff --git a/src/library/scala/concurrent/TaskRunner.scala b/src/library/scala/concurrent/TaskRunner.scala index 2e11ac42b0..2037c43cf8 100644 --- a/src/library/scala/concurrent/TaskRunner.scala +++ b/src/library/scala/concurrent/TaskRunner.scala @@ -8,7 +8,7 @@ package scala.concurrent -import language.{higherKinds, implicitConversions} +import scala.language.{higherKinds, implicitConversions} /** The `TaskRunner` trait... * diff --git a/src/library/scala/concurrent/ThreadPoolRunner.scala b/src/library/scala/concurrent/ThreadPoolRunner.scala index 594555d49b..4b777ba069 100644 --- a/src/library/scala/concurrent/ThreadPoolRunner.scala +++ b/src/library/scala/concurrent/ThreadPoolRunner.scala @@ -9,7 +9,7 @@ package scala.concurrent import java.util.concurrent.{ExecutorService, Callable, TimeUnit} -import language.implicitConversions +import scala.language.implicitConversions /** The `ThreadPoolRunner` trait uses a `java.util.concurrent.ExecutorService` * to run submitted tasks. diff --git a/src/library/scala/concurrent/ThreadRunner.scala b/src/library/scala/concurrent/ThreadRunner.scala index ab709e0210..067269a911 100644 --- a/src/library/scala/concurrent/ThreadRunner.scala +++ b/src/library/scala/concurrent/ThreadRunner.scala @@ -9,7 +9,7 @@ package scala.concurrent import java.lang.Thread -import language.implicitConversions +import scala.language.implicitConversions /** The `ThreadRunner` trait... * diff --git a/src/library/scala/concurrent/util/Duration.scala b/src/library/scala/concurrent/util/Duration.scala index 1a4bc1323d..3f8b98831e 100644 --- a/src/library/scala/concurrent/util/Duration.scala +++ b/src/library/scala/concurrent/util/Duration.scala @@ -11,7 +11,7 @@ package scala.concurrent.util import java.util.concurrent.TimeUnit import TimeUnit._ import java.lang.{ Double => JDouble, Long => JLong } -import language.implicitConversions +import scala.language.implicitConversions /** * This class stores a deadline, as obtained via `Deadline.now` or the @@ -100,7 +100,7 @@ object Duration { * Infinite inputs (and NaN) are converted into [[Duration.Inf]], [[Duration.MinusInf]] and [[Duration.Undefined]], respectively. * * @throws IllegalArgumentException if the length was finite but the resulting duration cannot be expressed as a [[FiniteDuration]] - */ + */ def apply(length: Double, unit: TimeUnit): Duration = fromNanos(unit.toNanos(1) * length) /** * Construct a finite duration from the given length and time unit. The unit given is retained @@ -117,7 +117,7 @@ object Duration { def apply(length: Long, unit: String): FiniteDuration = new FiniteDuration(length, Duration.timeUnit(unit)) // Double stores 52 bits mantissa, but there is an implied '1' in front, making the limit 2^53 - final val maxPreciseDouble = 9007199254740992d + final val maxPreciseDouble = 9007199254740992d /** * Parse String into Duration. Format is `"<length><unit>"`, where @@ -183,13 +183,13 @@ object Duration { /** * Construct a possibly infinite or undefined Duration from the given number of nanoseconds. - * + * * - `Double.PositiveInfinity` is mapped to [[Duration.Inf]] * - `Double.NegativeInfinity` is mapped to [[Duration.MinusInf]] * - `Double.NaN` is mapped to [[Duration.Undefined]] * - `-0d` is mapped to [[Duration.Zero]] (exactly like `0d`) * - * The semantics of the resulting Duration objects matches the semantics of their Double + * The semantics of the resulting Duration objects matches the semantics of their Double * counterparts with respect to arithmetic operations. * * @throws IllegalArgumentException if the length was finite but the resulting duration cannot be expressed as a [[FiniteDuration]] @@ -300,7 +300,7 @@ object Duration { /** * Infinite duration: greater than any other (apart from Undefined) and not equal to any other - * but itself. This value closely corresponds to Double.PositiveInfinity, + * but itself. This value closely corresponds to Double.PositiveInfinity, * matching its semantics in arithmetic operations. */ val Inf: Infinite = new Infinite { @@ -316,7 +316,7 @@ object Duration { /** * Infinite duration: less than any other and not equal to any other - * but itself. This value closely corresponds to Double.NegativeInfinity, + * but itself. This value closely corresponds to Double.NegativeInfinity, * matching its semantics in arithmetic operations. */ val MinusInf: Infinite = new Infinite { @@ -342,7 +342,7 @@ object Duration { * Infinite inputs (and NaN) are converted into [[Duration.Inf]], [[Duration.MinusInf]] and [[Duration.Undefined]], respectively. * * @throws IllegalArgumentException if the length was finite but the resulting duration cannot be expressed as a [[FiniteDuration]] - */ + */ def create(length: Double, unit: TimeUnit): Duration = apply(length, unit) /** * Construct a finite duration from the given length and time unit, where the latter is @@ -390,7 +390,7 @@ object Duration { * duration < 1.second * duration <= Duration.Inf * }}} - * + * * '''''Invoking inexpressible conversions (like calling `toSeconds` on an infinite duration) will throw an IllegalArgumentException.''''' * * <p/> @@ -425,7 +425,7 @@ object Duration { * - exact addition/subtraction with nanosecond resolution for finite durations, independent of the summands' magnitude * - isomorphic to `java.lang.Double` when it comes to infinite or undefined values * - * The conversion between Duration and Double is done using [[Duration.toUnit]] (with unit NANOSECONDS) + * The conversion between Duration and Double is done using [[Duration.toUnit]] (with unit NANOSECONDS) * and [[Duration$.fromNanos(Double):Duration Duration.fromNanos(Double)]]. * * <h2>Ordering</h2> @@ -531,7 +531,7 @@ sealed abstract class Duration extends Serializable with Ordered[Duration] { */ def /(factor: Double): Duration /** - * Return the quotient of this and that duration as floating-point number. The semantics are + * Return the quotient of this and that duration as floating-point number. The semantics are * determined by Double as if calculating the quotient of the nanosecond lengths of both factors. */ def /(other: Duration): Double @@ -540,7 +540,7 @@ sealed abstract class Duration extends Serializable with Ordered[Duration] { */ def unary_- : Duration /** - * This method returns whether this duration is finite, which is not the same as + * This method returns whether this duration is finite, which is not the same as * `!isInfinite` for Double because this method also returns `false` for [[Duration.Undefined]]. */ def isFinite(): Boolean @@ -563,7 +563,7 @@ sealed abstract class Duration extends Serializable with Ordered[Duration] { */ def div(factor: Double) = this / factor /** - * Return the quotient of this and that duration as floating-point number. The semantics are + * Return the quotient of this and that duration as floating-point number. The semantics are * determined by Double as if calculating the quotient of the nanosecond lengths of both factors. */ def div(other: Duration) = this / other @@ -685,7 +685,7 @@ final class FiniteDuration(val length: Long, val unit: TimeUnit) extends Duratio case _ => other } - def *(factor: Double) = + def *(factor: Double) = if (!factor.isInfinite) fromNanos(toNanos * factor) else if (factor.isNaN) Undefined else if ((factor > 0) ^ (this < Zero)) Inf diff --git a/src/library/scala/concurrent/util/duration/package.scala b/src/library/scala/concurrent/util/duration/package.scala index e3cf229c61..d5ae3f1544 100644 --- a/src/library/scala/concurrent/util/duration/package.scala +++ b/src/library/scala/concurrent/util/duration/package.scala @@ -1,7 +1,7 @@ package scala.concurrent.util import java.util.concurrent.TimeUnit -import language.implicitConversions +import scala.language.implicitConversions package object duration { diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala index 111affc904..5ad61b811a 100644 --- a/src/library/scala/deprecated.scala +++ b/src/library/scala/deprecated.scala @@ -8,7 +8,7 @@ package scala -import annotation.meta._ +import scala.annotation.meta._ /** An annotation that designates that a definition is deprecated. * Access to the member then generates a deprecated warning. @@ -18,4 +18,4 @@ import annotation.meta._ * @since 2.3 */ @getter @setter @beanGetter @beanSetter -class deprecated(message: String = "", since: String = "") extends annotation.StaticAnnotation +class deprecated(message: String = "", since: String = "") extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/deprecatedInheritance.scala b/src/library/scala/deprecatedInheritance.scala index ca1b586223..eb241d0d04 100644 --- a/src/library/scala/deprecatedInheritance.scala +++ b/src/library/scala/deprecatedInheritance.scala @@ -19,4 +19,4 @@ package scala * @see [[scala.deprecatedOverriding]] */ private[scala] // for now, this needs to be generalized to communicate other modifier deltas -class deprecatedInheritance(message: String = "", since: String = "") extends annotation.StaticAnnotation +class deprecatedInheritance(message: String = "", since: String = "") extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/deprecatedName.scala b/src/library/scala/deprecatedName.scala index cc36be6775..07b35d1a61 100644 --- a/src/library/scala/deprecatedName.scala +++ b/src/library/scala/deprecatedName.scala @@ -8,7 +8,7 @@ package scala -import annotation.meta._ +import scala.annotation.meta._ /** * An annotation that designates the name of the parameter to which it is @@ -29,4 +29,4 @@ import annotation.meta._ * @since 2.8.1 */ @param -class deprecatedName(name: Symbol) extends annotation.StaticAnnotation +class deprecatedName(name: Symbol) extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/deprecatedOverriding.scala b/src/library/scala/deprecatedOverriding.scala index 566cb59431..c9fd3af91b 100644 --- a/src/library/scala/deprecatedOverriding.scala +++ b/src/library/scala/deprecatedOverriding.scala @@ -18,4 +18,4 @@ package scala * @see [[scala.deprecatedInheritance]] */ private[scala] // for the same reasons as deprecatedInheritance -class deprecatedOverriding(message: String = "", since: String = "") extends annotation.StaticAnnotation +class deprecatedOverriding(message: String = "", since: String = "") extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/inline.scala b/src/library/scala/inline.scala index a182fdf9ca..42ae28a347 100644 --- a/src/library/scala/inline.scala +++ b/src/library/scala/inline.scala @@ -17,4 +17,4 @@ package scala * @author Lex Spoon * @version 1.0, 2007-5-21 */ -class inline extends annotation.StaticAnnotation +class inline extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/io/Codec.scala b/src/library/scala/io/Codec.scala index 84cac88dcc..fa74be0f98 100644 --- a/src/library/scala/io/Codec.scala +++ b/src/library/scala/io/Codec.scala @@ -10,8 +10,8 @@ package scala.io import java.nio.charset.{ Charset, CharsetDecoder, CharsetEncoder, CharacterCodingException, CodingErrorAction => Action } -import annotation.migration -import language.implicitConversions +import scala.annotation.migration +import scala.language.implicitConversions // Some notes about encodings for use in refining this implementation. // diff --git a/src/library/scala/languageFeature.scala b/src/library/scala/languageFeature.scala index 39540b4f49..1f411c412a 100644 --- a/src/library/scala/languageFeature.scala +++ b/src/library/scala/languageFeature.scala @@ -1,6 +1,6 @@ package scala -import annotation.meta +import scala.annotation.meta object languageFeature { diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala index a475d663f4..eb73d58d1c 100644 --- a/src/library/scala/math/BigDecimal.scala +++ b/src/library/scala/math/BigDecimal.scala @@ -12,7 +12,7 @@ package scala.math import java.{ lang => jl } import java.math.{ MathContext, BigDecimal => BigDec } import scala.collection.immutable.NumericRange -import language.implicitConversions +import scala.language.implicitConversions /** diff --git a/src/library/scala/math/BigInt.scala b/src/library/scala/math/BigInt.scala index e354117e14..3eb41053f7 100644 --- a/src/library/scala/math/BigInt.scala +++ b/src/library/scala/math/BigInt.scala @@ -9,7 +9,7 @@ package scala.math import java.math.BigInteger -import language.implicitConversions +import scala.language.implicitConversions /** * @author Martin Odersky diff --git a/src/library/scala/math/Fractional.scala b/src/library/scala/math/Fractional.scala index 0686569c16..98fd325980 100644 --- a/src/library/scala/math/Fractional.scala +++ b/src/library/scala/math/Fractional.scala @@ -8,7 +8,7 @@ package scala.math -import language.implicitConversions +import scala.language.implicitConversions /** * @since 2.8 @@ -28,4 +28,4 @@ object Fractional { implicit def infixFractionalOps[T](x: T)(implicit num: Fractional[T]): Fractional[T]#FractionalOps = new num.FractionalOps(x) } object Implicits extends ExtraImplicits -}
\ No newline at end of file +} diff --git a/src/library/scala/math/Integral.scala b/src/library/scala/math/Integral.scala index 4b4de28228..e5bfc8f687 100644 --- a/src/library/scala/math/Integral.scala +++ b/src/library/scala/math/Integral.scala @@ -10,7 +10,7 @@ package scala.math -import language.implicitConversions +import scala.language.implicitConversions /** * @since 2.8 @@ -36,4 +36,4 @@ object Integral { implicit def infixIntegralOps[T](x: T)(implicit num: Integral[T]): Integral[T]#IntegralOps = new num.IntegralOps(x) } object Implicits extends ExtraImplicits -}
\ No newline at end of file +} diff --git a/src/library/scala/math/Numeric.scala b/src/library/scala/math/Numeric.scala index ee62706e49..4428d9c249 100644 --- a/src/library/scala/math/Numeric.scala +++ b/src/library/scala/math/Numeric.scala @@ -8,7 +8,7 @@ package scala.math -import language.implicitConversions +import scala.language.implicitConversions /** * @since 2.8 diff --git a/src/library/scala/math/Ordered.scala b/src/library/scala/math/Ordered.scala index a5efa41b80..53b3ae81cb 100644 --- a/src/library/scala/math/Ordered.scala +++ b/src/library/scala/math/Ordered.scala @@ -8,7 +8,7 @@ package scala.math -import language.implicitConversions +import scala.language.implicitConversions /** A trait for data that have a single, natural ordering. See * [[scala.math.Ordering]] before using this trait for diff --git a/src/library/scala/math/Ordering.scala b/src/library/scala/math/Ordering.scala index 9020bb9edd..3ac255b57f 100644 --- a/src/library/scala/math/Ordering.scala +++ b/src/library/scala/math/Ordering.scala @@ -9,7 +9,7 @@ package scala.math import java.util.Comparator -import language.{implicitConversions, higherKinds} +import scala.language.{implicitConversions, higherKinds} /** Ordering is a trait whose instances each represent a strategy for sorting * instances of a type. @@ -165,7 +165,7 @@ object Ordering extends LowPriorityOrderingImplicits { /** Not in the standard scope due to the potential for divergence: * For instance `implicitly[Ordering[Any]]` diverges in its presence. */ - implicit def seqDerivedOrdering[CC[X] <: collection.Seq[X], T](implicit ord: Ordering[T]): Ordering[CC[T]] = + implicit def seqDerivedOrdering[CC[X] <: scala.collection.Seq[X], T](implicit ord: Ordering[T]): Ordering[CC[T]] = new Ordering[CC[T]] { def compare(x: CC[T], y: CC[T]): Int = { val xe = x.iterator diff --git a/src/library/scala/native.scala b/src/library/scala/native.scala index 28bb9f70fd..798af3a5da 100644 --- a/src/library/scala/native.scala +++ b/src/library/scala/native.scala @@ -20,4 +20,4 @@ package scala * but it is type checked when present. * * @since 2.6 */ -class native extends annotation.StaticAnnotation {} +class native extends scala.annotation.StaticAnnotation {} diff --git a/src/library/scala/noinline.scala b/src/library/scala/noinline.scala index de650ed209..7cb9b3d53c 100644 --- a/src/library/scala/noinline.scala +++ b/src/library/scala/noinline.scala @@ -18,4 +18,4 @@ package scala * @version 1.0, 2007-5-21 * @since 2.5 */ -class noinline extends annotation.StaticAnnotation +class noinline extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/reflect/ClassTag.scala b/src/library/scala/reflect/ClassTag.scala index e42c89d21f..6757a72053 100644 --- a/src/library/scala/reflect/ClassTag.scala +++ b/src/library/scala/reflect/ClassTag.scala @@ -1,7 +1,7 @@ package scala.reflect import java.lang.{ Class => jClass } -import language.{implicitConversions, existentials} +import scala.language.{implicitConversions, existentials} import scala.runtime.ScalaRunTime.{ arrayClass, arrayElementClass } /** A `ClassTag[T]` wraps a runtime class, which can be accessed via the `runtimeClass` method. @@ -126,4 +126,4 @@ object ClassTag { } def unapply[T](ctag: ClassTag[T]): Option[Class[_]] = Some(ctag.runtimeClass) -}
\ No newline at end of file +} diff --git a/src/library/scala/reflect/base/Base.scala b/src/library/scala/reflect/base/Base.scala index 6f90d598f9..33582675bd 100644 --- a/src/library/scala/reflect/base/Base.scala +++ b/src/library/scala/reflect/base/Base.scala @@ -4,7 +4,7 @@ package base import java.io.PrintWriter import scala.annotation.switch import scala.ref.WeakReference -import collection.mutable +import scala.collection.mutable class Base extends Universe { self => diff --git a/src/library/scala/reflect/base/Names.scala b/src/library/scala/reflect/base/Names.scala index 532b780e7e..ad99f54fb3 100644 --- a/src/library/scala/reflect/base/Names.scala +++ b/src/library/scala/reflect/base/Names.scala @@ -1,7 +1,7 @@ package scala.reflect package base -import language.implicitConversions +import scala.language.implicitConversions /** A trait that manages names. * A name is a string in one of two name universes: terms and types. diff --git a/src/library/scala/reflect/base/TypeTags.scala b/src/library/scala/reflect/base/TypeTags.scala index 37e0c4f02f..ec86bbc9be 100644 --- a/src/library/scala/reflect/base/TypeTags.scala +++ b/src/library/scala/reflect/base/TypeTags.scala @@ -7,7 +7,7 @@ package scala.reflect package base import java.lang.{ Class => jClass } -import language.implicitConversions +import scala.language.implicitConversions /** * Type tags encapsulate a representation of type T. @@ -274,4 +274,4 @@ private[scala] class SerializedTypeTag(var tpec: TypeCreator, var concrete: Bool if (concrete) TypeTag(rootMirror, tpec) else WeakTypeTag(rootMirror, tpec) } -}
\ No newline at end of file +} diff --git a/src/library/scala/reflect/macros/internal/macroImpl.scala b/src/library/scala/reflect/macros/internal/macroImpl.scala index a7b2bf482c..b281fb7d12 100644 --- a/src/library/scala/reflect/macros/internal/macroImpl.scala +++ b/src/library/scala/reflect/macros/internal/macroImpl.scala @@ -15,4 +15,4 @@ package internal * To lessen the weirdness we define this annotation as `private[scala]`. * It will not prevent pickling, but it will prevent application developers (and scaladocs) from seeing the annotation. */ -private[scala] class macroImpl(val referenceToMacroImpl: Any) extends annotation.StaticAnnotation +private[scala] class macroImpl(val referenceToMacroImpl: Any) extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/remote.scala b/src/library/scala/remote.scala index bf6b440031..36893da298 100644 --- a/src/library/scala/remote.scala +++ b/src/library/scala/remote.scala @@ -24,4 +24,4 @@ package scala * } * }}} */ -class remote extends annotation.StaticAnnotation {} +class remote extends scala.annotation.StaticAnnotation {} diff --git a/src/library/scala/runtime/RichException.scala b/src/library/scala/runtime/RichException.scala index bb20ec61bb..b9289562f8 100644 --- a/src/library/scala/runtime/RichException.scala +++ b/src/library/scala/runtime/RichException.scala @@ -8,7 +8,7 @@ package scala.runtime -import compat.Platform.EOL +import scala.compat.Platform.EOL final class RichException(exc: Throwable) { def getStackTraceString = exc.getStackTrace().mkString("", EOL, EOL) diff --git a/src/library/scala/runtime/ScalaNumberProxy.scala b/src/library/scala/runtime/ScalaNumberProxy.scala index 64df4611e3..df2d209e3e 100644 --- a/src/library/scala/runtime/ScalaNumberProxy.scala +++ b/src/library/scala/runtime/ScalaNumberProxy.scala @@ -9,7 +9,7 @@ package scala.runtime import scala.collection.{ mutable, immutable } -import math.ScalaNumericConversions +import scala.math.ScalaNumericConversions import immutable.NumericRange import Proxy.Typed diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala index a8635151ff..045fb5b252 100644 --- a/src/library/scala/runtime/ScalaRunTime.scala +++ b/src/library/scala/runtime/ScalaRunTime.scala @@ -144,7 +144,7 @@ object ScalaRunTime { dest } - def toArray[T](xs: collection.Seq[T]) = { + def toArray[T](xs: scala.collection.Seq[T]) = { val arr = new Array[AnyRef](xs.length) var i = 0 for (x <- xs) { @@ -250,7 +250,7 @@ object ScalaRunTime { * it's performing a series of Any/Any equals comparisons anyway. * See ticket #2867 for specifics. */ - def sameElements(xs1: collection.Seq[Any], xs2: collection.Seq[Any]) = xs1 sameElements xs2 + def sameElements(xs1: scala.collection.Seq[Any], xs2: scala.collection.Seq[Any]) = xs1 sameElements xs2 /** Given any Scala value, convert it to a String. * @@ -317,7 +317,7 @@ object ScalaRunTime { case x: String => if (x.head.isWhitespace || x.last.isWhitespace) "\"" + x + "\"" else x case x if useOwnToString(x) => x.toString case x: AnyRef if isArray(x) => arrayToString(x) - case x: collection.Map[_, _] => x.iterator take maxElements map mapInner mkString (x.stringPrefix + "(", ", ", ")") + case x: scala.collection.Map[_, _] => x.iterator take maxElements map mapInner mkString (x.stringPrefix + "(", ", ", ")") case x: Iterable[_] => x.iterator take maxElements map inner mkString (x.stringPrefix + "(", ", ", ")") case x: Traversable[_] => x take maxElements map inner mkString (x.stringPrefix + "(", ", ", ")") case x: Product1[_] if isTuple(x) => "(" + inner(x._1) + ",)" // that special trailing comma diff --git a/src/library/scala/runtime/SeqCharSequence.scala b/src/library/scala/runtime/SeqCharSequence.scala index 8ef1a9a33e..dc9594d960 100644 --- a/src/library/scala/runtime/SeqCharSequence.scala +++ b/src/library/scala/runtime/SeqCharSequence.scala @@ -10,7 +10,7 @@ package scala.runtime import java.util.Arrays.copyOfRange -final class SeqCharSequence(val xs: collection.IndexedSeq[Char]) extends CharSequence { +final class SeqCharSequence(val xs: scala.collection.IndexedSeq[Char]) extends CharSequence { def length: Int = xs.length def charAt(index: Int): Char = xs(index) def subSequence(start: Int, end: Int): CharSequence = new SeqCharSequence(xs.slice(start, end)) diff --git a/src/library/scala/runtime/Tuple2Zipped.scala b/src/library/scala/runtime/Tuple2Zipped.scala index 182fd77133..bd52c678af 100644 --- a/src/library/scala/runtime/Tuple2Zipped.scala +++ b/src/library/scala/runtime/Tuple2Zipped.scala @@ -10,7 +10,7 @@ package scala.runtime import scala.collection.{ TraversableLike, IterableLike } import scala.collection.generic.{ CanBuildFrom => CBF } -import language.{ higherKinds, implicitConversions } +import scala.language.{ higherKinds, implicitConversions } /** This interface is intended as a minimal interface, not complicated * by the requirement to resolve type constructors, for implicit search (which only @@ -111,7 +111,7 @@ object Tuple2Zipped { def invert[El1, CC1[X] <: TraversableOnce[X], El2, CC2[X] <: TraversableOnce[X], That] (implicit w1: T1 <:< CC1[El1], w2: T2 <:< CC2[El2], - bf: collection.generic.CanBuildFrom[CC1[_], (El1, El2), That] + bf: scala.collection.generic.CanBuildFrom[CC1[_], (El1, El2), That] ): That = { val buf = bf(x._1) val it1 = x._1.toIterator diff --git a/src/library/scala/runtime/Tuple3Zipped.scala b/src/library/scala/runtime/Tuple3Zipped.scala index f6aafe41fb..3b78b6261a 100644 --- a/src/library/scala/runtime/Tuple3Zipped.scala +++ b/src/library/scala/runtime/Tuple3Zipped.scala @@ -10,7 +10,7 @@ package scala.runtime import scala.collection.{ TraversableLike, IterableLike } import scala.collection.generic.{ CanBuildFrom => CBF } -import language.{ higherKinds, implicitConversions } +import scala.language.{ higherKinds, implicitConversions } /** See comment on ZippedTraversable2. */ trait ZippedTraversable3[+El1, +El2, +El3] extends Any { @@ -119,7 +119,7 @@ object Tuple3Zipped { (implicit w1: T1 <:< CC1[El1], w2: T2 <:< CC2[El2], w3: T3 <:< CC3[El3], - bf: collection.generic.CanBuildFrom[CC1[_], (El1, El2, El3), That] + bf: scala.collection.generic.CanBuildFrom[CC1[_], (El1, El2, El3), That] ): That = { val buf = bf(x._1) val it1 = x._1.toIterator diff --git a/src/library/scala/specialized.scala b/src/library/scala/specialized.scala index 761c7cb25e..d349b7e0c2 100644 --- a/src/library/scala/specialized.scala +++ b/src/library/scala/specialized.scala @@ -24,9 +24,9 @@ import Specializable._ * * @since 2.8 */ -// class tspecialized[T](group: Group[T]) extends annotation.StaticAnnotation { +// class tspecialized[T](group: Group[T]) extends scala.annotation.StaticAnnotation { -class specialized(group: SpecializedGroup) extends annotation.StaticAnnotation { +class specialized(group: SpecializedGroup) extends scala.annotation.StaticAnnotation { def this(types: Specializable*) = this(new Group(types.toList)) def this() = this(Primitives) } diff --git a/src/library/scala/sys/BooleanProp.scala b/src/library/scala/sys/BooleanProp.scala index 45fc6f5897..7213fdeb65 100644 --- a/src/library/scala/sys/BooleanProp.scala +++ b/src/library/scala/sys/BooleanProp.scala @@ -8,7 +8,7 @@ package scala.sys -import language.implicitConversions +import scala.language.implicitConversions /** A few additional conveniences for Boolean properties. */ diff --git a/src/library/scala/sys/SystemProperties.scala b/src/library/scala/sys/SystemProperties.scala index d5777922b4..5777c255c3 100644 --- a/src/library/scala/sys/SystemProperties.scala +++ b/src/library/scala/sys/SystemProperties.scala @@ -11,7 +11,7 @@ package scala.sys import scala.collection.{ mutable, Iterator } import scala.collection.JavaConverters._ import java.security.AccessControlException -import language.implicitConversions +import scala.language.implicitConversions /** A bidirectional map wrapping the java System properties. diff --git a/src/library/scala/sys/package.scala b/src/library/scala/sys/package.scala index 119ab59c22..445b30e480 100644 --- a/src/library/scala/sys/package.scala +++ b/src/library/scala/sys/package.scala @@ -9,7 +9,7 @@ package scala import scala.collection.immutable -import collection.JavaConverters._ +import scala.collection.JavaConverters._ /** The package object `scala.sys` contains methods for reading * and altering core aspects of the virtual machine as well as the @@ -85,4 +85,4 @@ package object sys { tarray take got } -}
\ No newline at end of file +} diff --git a/src/library/scala/sys/process/Process.scala b/src/library/scala/sys/process/Process.scala index d56c6f2c9d..4950758a1a 100644 --- a/src/library/scala/sys/process/Process.scala +++ b/src/library/scala/sys/process/Process.scala @@ -11,7 +11,7 @@ package process import processInternal._ import ProcessBuilder._ -import language.implicitConversions +import scala.language.implicitConversions /** Represents a process that is running or has finished running. * It may be a compound process with several underlying native processes (such as `a #&& b`). diff --git a/src/library/scala/sys/process/package.scala b/src/library/scala/sys/process/package.scala index c1bf470831..7c73fd587c 100644 --- a/src/library/scala/sys/process/package.scala +++ b/src/library/scala/sys/process/package.scala @@ -205,7 +205,7 @@ package scala.sys { package object process extends ProcessImplicits { /** The arguments passed to `java` when creating this process */ def javaVmArguments: List[String] = { - import collection.JavaConversions._ + import scala.collection.JavaConversions._ java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().toList } diff --git a/src/library/scala/testing/Benchmark.scala b/src/library/scala/testing/Benchmark.scala index 9c07fcab4f..3794fb3f2b 100644 --- a/src/library/scala/testing/Benchmark.scala +++ b/src/library/scala/testing/Benchmark.scala @@ -8,7 +8,7 @@ package scala.testing -import compat.Platform +import scala.compat.Platform /** `Benchmark` can be used to quickly turn an existing class into a * benchmark. Here is a short example: diff --git a/src/library/scala/throws.scala b/src/library/scala/throws.scala index 4621c789ab..0aa0d31c9f 100644 --- a/src/library/scala/throws.scala +++ b/src/library/scala/throws.scala @@ -23,4 +23,4 @@ package scala * @version 1.0, 19/05/2006 * @since 2.1 */ -class throws(clazz: Class[_]) extends annotation.StaticAnnotation +class throws(clazz: Class[_]) extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/transient.scala b/src/library/scala/transient.scala index 3dcff0664c..36dcb996cf 100644 --- a/src/library/scala/transient.scala +++ b/src/library/scala/transient.scala @@ -10,7 +10,7 @@ package scala -import annotation.meta._ +import scala.annotation.meta._ @field -class transient extends annotation.StaticAnnotation +class transient extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/unchecked.scala b/src/library/scala/unchecked.scala index 5b05792d97..281f2ef4d7 100644 --- a/src/library/scala/unchecked.scala +++ b/src/library/scala/unchecked.scala @@ -33,4 +33,4 @@ package scala * * @since 2.4 */ -class unchecked extends annotation.Annotation {} +class unchecked extends scala.annotation.Annotation {} diff --git a/src/library/scala/util/Either.scala b/src/library/scala/util/Either.scala index dcfdc16d33..f0253eee07 100644 --- a/src/library/scala/util/Either.scala +++ b/src/library/scala/util/Either.scala @@ -10,7 +10,7 @@ package scala.util -import language.implicitConversions +import scala.language.implicitConversions /** Represents a value of one of two possible types (a disjoint union.) * Instances of Either are either an instance of [[scala.util.Left]] or [[scala.util.Right]]. diff --git a/src/library/scala/util/MurmurHash.scala b/src/library/scala/util/MurmurHash.scala index 029fe095af..c087b0d8c8 100644 --- a/src/library/scala/util/MurmurHash.scala +++ b/src/library/scala/util/MurmurHash.scala @@ -178,7 +178,7 @@ object MurmurHash { * where the order of appearance of elements does not matter. * This is useful for hashing sets, for example. */ - def symmetricHash[T](xs: collection.TraversableOnce[T], seed: Int) = { + def symmetricHash[T](xs: scala.collection.TraversableOnce[T], seed: Int) = { var a,b,n = 0 var c = 1 xs.seq.foreach(i => { diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index 65a1b8c685..85ac27e95c 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -8,10 +8,10 @@ package scala.util -import collection.mutable.ArrayBuffer -import collection.generic.CanBuildFrom +import scala.collection.mutable.ArrayBuffer +import scala.collection.generic.CanBuildFrom import scala.collection.immutable.{ List, Stream } -import language.{implicitConversions, higherKinds} +import scala.language.{implicitConversions, higherKinds} /** * @author Stephane Micheloud diff --git a/src/library/scala/util/Try.scala b/src/library/scala/util/Try.scala index 7afbfcdd66..fe409c2d7a 100644 --- a/src/library/scala/util/Try.scala +++ b/src/library/scala/util/Try.scala @@ -8,9 +8,9 @@ package scala.util -import collection.Seq +import scala.collection.Seq import scala.util.control.NonFatal -import language.implicitConversions +import scala.language.implicitConversions /** * The `Try` type represents a computation that may either result in an exception, or return a diff --git a/src/library/scala/util/control/Exception.scala b/src/library/scala/util/control/Exception.scala index 1567e06c22..28e4db2038 100644 --- a/src/library/scala/util/control/Exception.scala +++ b/src/library/scala/util/control/Exception.scala @@ -9,10 +9,10 @@ package scala.util package control -import collection.immutable.List -import reflect.{ ClassTag, classTag } +import scala.collection.immutable.List +import scala.reflect.{ ClassTag, classTag } import java.lang.reflect.InvocationTargetException -import language.implicitConversions +import scala.language.implicitConversions /** Classes representing the components of exception handling. @@ -27,7 +27,7 @@ import language.implicitConversions * }}} * * This class differs from `scala.util.Try` in that it focuses on composing exception handlers rather than - * composing behavior. All behavior should be composed first and fed to a `Catch` object using one of the + * composing behavior. All behavior should be composed first and fed to a `Catch` object using one of the * `opt` or `either` methods. * * @author Paul Phillips @@ -218,7 +218,7 @@ object Exception { } /** Private **/ - private def wouldMatch(x: Throwable, classes: collection.Seq[Class[_]]): Boolean = + private def wouldMatch(x: Throwable, classes: scala.collection.Seq[Class[_]]): Boolean = classes exists (_ isAssignableFrom x.getClass) private def pfFromExceptions(exceptions: Class[_]*): PartialFunction[Throwable, Nothing] = diff --git a/src/library/scala/util/hashing/MurmurHash3.scala b/src/library/scala/util/hashing/MurmurHash3.scala index 1cfb8276fe..8174f09bb2 100644 --- a/src/library/scala/util/hashing/MurmurHash3.scala +++ b/src/library/scala/util/hashing/MurmurHash3.scala @@ -158,7 +158,7 @@ private[hashing] class MurmurHash3 { finalizeHash(h, data.length) } - final def listHash(xs: collection.immutable.List[_], seed: Int): Int = { + final def listHash(xs: scala.collection.immutable.List[_], seed: Int): Int = { var n = 0 var h = seed var elems = xs @@ -213,45 +213,45 @@ object MurmurHash3 extends MurmurHash3 { /** To offer some potential for optimization. */ - def seqHash(xs: collection.Seq[_]): Int = xs match { + def seqHash(xs: scala.collection.Seq[_]): Int = xs match { case xs: List[_] => listHash(xs, seqSeed) case xs => orderedHash(xs, seqSeed) } - def mapHash(xs: collection.Map[_, _]): Int = unorderedHash(xs, mapSeed) - def setHash(xs: collection.Set[_]): Int = unorderedHash(xs, setSeed) + def mapHash(xs: scala.collection.Map[_, _]): Int = unorderedHash(xs, mapSeed) + def setHash(xs: scala.collection.Set[_]): Int = unorderedHash(xs, setSeed) class ArrayHashing[@specialized T] extends Hashing[Array[T]] { def hash(a: Array[T]) = arrayHash(a) } - + def arrayHashing[@specialized T] = new ArrayHashing[T] - + def bytesHashing = new Hashing[Array[Byte]] { def hash(data: Array[Byte]) = bytesHash(data) } - + def orderedHashing = new Hashing[TraversableOnce[Any]] { def hash(xs: TraversableOnce[Any]) = orderedHash(xs) } - + def productHashing = new Hashing[Product] { def hash(x: Product) = productHash(x) } - + def stringHashing = new Hashing[String] { def hash(x: String) = stringHash(x) } - + def unorderedHashing = new Hashing[TraversableOnce[Any]] { def hash(xs: TraversableOnce[Any]) = unorderedHash(xs) } - + /** All this trouble and foreach still appears faster. * Leaving in place in case someone would like to investigate further. */ /** - def linearSeqHash(xs: collection.LinearSeq[_], seed: Int): Int = { + def linearSeqHash(xs: scala.collection.LinearSeq[_], seed: Int): Int = { var n = 0 var h = seed var elems = xs @@ -263,7 +263,7 @@ object MurmurHash3 extends MurmurHash3 { finalizeHash(h, n) } - def indexedSeqHash(xs: collection.IndexedSeq[_], seed: Int): Int = { + def indexedSeqHash(xs: scala.collection.IndexedSeq[_], seed: Int): Int = { var n = 0 var h = seed val len = xs.length @@ -276,10 +276,10 @@ object MurmurHash3 extends MurmurHash3 { */ @deprecated("Use unorderedHash", "2.10.0") - final def symmetricHash[T](xs: collection.GenTraversableOnce[T], seed: Int = symmetricSeed): Int = + final def symmetricHash[T](xs: scala.collection.GenTraversableOnce[T], seed: Int = symmetricSeed): Int = unorderedHash(xs.seq, seed) @deprecated("Use orderedHash", "2.10.0") - final def traversableHash[T](xs: collection.GenTraversableOnce[T], seed: Int = traversableSeed): Int = + final def traversableHash[T](xs: scala.collection.GenTraversableOnce[T], seed: Int = traversableSeed): Int = orderedHash(xs.seq, seed) } diff --git a/src/library/scala/util/parsing/ast/Binders.scala b/src/library/scala/util/parsing/ast/Binders.scala index b93c24fde4..fc3b36a4e0 100644 --- a/src/library/scala/util/parsing/ast/Binders.scala +++ b/src/library/scala/util/parsing/ast/Binders.scala @@ -10,7 +10,7 @@ package scala.util.parsing.ast import scala.collection.AbstractIterable import scala.collection.mutable -import language.implicitConversions +import scala.language.implicitConversions //DISCLAIMER: this code is highly experimental! diff --git a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala index 270ac680a9..5b616e9e13 100644 --- a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala +++ b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala @@ -9,7 +9,7 @@ package scala.util.parsing.combinator -import language.implicitConversions +import scala.language.implicitConversions /** This object contains implicit conversions that come in handy when using the `^^` combinator. * diff --git a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala index 06567ea348..520ac8cc2c 100644 --- a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala @@ -9,7 +9,7 @@ package scala.util.parsing.combinator -import annotation.migration +import scala.annotation.migration /** `JavaTokenParsers` differs from [[scala.util.parsing.combinator.RegexParsers]] * by adding the following definitions: diff --git a/src/library/scala/util/parsing/combinator/PackratParsers.scala b/src/library/scala/util/parsing/combinator/PackratParsers.scala index 9516df0093..91642da229 100644 --- a/src/library/scala/util/parsing/combinator/PackratParsers.scala +++ b/src/library/scala/util/parsing/combinator/PackratParsers.scala @@ -11,7 +11,7 @@ package scala.util.parsing.combinator import scala.util.parsing.combinator._ import scala.util.parsing.input.{ Reader, Position } import scala.collection.mutable -import language.implicitConversions +import scala.language.implicitConversions /** * `PackratParsers` is a component that extends the parser combinators diff --git a/src/library/scala/util/parsing/combinator/Parsers.scala b/src/library/scala/util/parsing/combinator/Parsers.scala index eaaea583ce..e6c9573756 100644 --- a/src/library/scala/util/parsing/combinator/Parsers.scala +++ b/src/library/scala/util/parsing/combinator/Parsers.scala @@ -11,8 +11,8 @@ package scala.util.parsing.combinator import scala.util.parsing.input._ import scala.collection.mutable.ListBuffer import scala.annotation.tailrec -import annotation.migration -import language.implicitConversions +import scala.annotation.migration +import scala.language.implicitConversions import scala.util.DynamicVariable // TODO: better error handling (labelling like parsec's <?>) diff --git a/src/library/scala/util/parsing/combinator/RegexParsers.scala b/src/library/scala/util/parsing/combinator/RegexParsers.scala index d685329ef1..9a2c497eab 100644 --- a/src/library/scala/util/parsing/combinator/RegexParsers.scala +++ b/src/library/scala/util/parsing/combinator/RegexParsers.scala @@ -13,7 +13,7 @@ import java.util.regex.Pattern import scala.util.matching.Regex import scala.util.parsing.input._ import scala.collection.immutable.PagedSeq -import language.implicitConversions +import scala.language.implicitConversions /** The ''most important'' differences between `RegexParsers` and * [[scala.util.parsing.combinator.Parsers]] are: diff --git a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala index 215b8b792f..03979d43b7 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala @@ -13,7 +13,7 @@ package syntactical import token._ import lexical.StdLexical -import language.implicitConversions +import scala.language.implicitConversions /** This component provides primitive parsers for the standard tokens defined in `StdTokens`. * diff --git a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala index 7aa6178df9..a3b94e2562 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala @@ -14,7 +14,7 @@ package syntactical import token._ import scala.collection.mutable -import language.implicitConversions +import scala.language.implicitConversions /** This component provides primitive parsers for the standard tokens defined in `StdTokens`. * diff --git a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala index ff3554a6af..80e9b0df39 100644 --- a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala +++ b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala @@ -3,7 +3,7 @@ package scala.util.parsing.combinator.testing import scala.util.parsing.combinator._ import scala.util.parsing.input._ -import language.postfixOps +import scala.language.postfixOps @deprecated("This class will be removed", "2.10.0") case class Ident(s: String) diff --git a/src/library/scala/util/parsing/input/OffsetPosition.scala b/src/library/scala/util/parsing/input/OffsetPosition.scala index 57a2c9c4c2..3366584ab2 100644 --- a/src/library/scala/util/parsing/input/OffsetPosition.scala +++ b/src/library/scala/util/parsing/input/OffsetPosition.scala @@ -8,7 +8,7 @@ package scala.util.parsing.input -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer /** `OffsetPosition` is a standard class for positions * represented as offsets into a source ``document''. diff --git a/src/library/scala/volatile.scala b/src/library/scala/volatile.scala index 88726d9336..1290e54f3a 100644 --- a/src/library/scala/volatile.scala +++ b/src/library/scala/volatile.scala @@ -10,7 +10,7 @@ package scala -import annotation.meta._ +import scala.annotation.meta._ @field -class volatile extends annotation.StaticAnnotation +class volatile extends scala.annotation.StaticAnnotation diff --git a/src/library/scala/xml/Elem.scala b/src/library/scala/xml/Elem.scala index f140fd1e07..2ca1dbfcd0 100755 --- a/src/library/scala/xml/Elem.scala +++ b/src/library/scala/xml/Elem.scala @@ -73,7 +73,7 @@ extends Node with Serializable throw new IllegalArgumentException("prefix of zero length, use null instead") if (scope == null) - throw new IllegalArgumentException("scope is null, use xml.TopScope for empty scope") + throw new IllegalArgumentException("scope is null, use scala.xml.TopScope for empty scope") //@todo: copy the children, // setting namespace scope if necessary diff --git a/src/library/scala/xml/Equality.scala b/src/library/scala/xml/Equality.scala index 07651adb90..0efbb4c511 100644 --- a/src/library/scala/xml/Equality.scala +++ b/src/library/scala/xml/Equality.scala @@ -13,7 +13,7 @@ package scala.xml * all the `xml` classes go through the `xml.Equality trait`. There are two * forms of `xml` comparison. * - * 1. `'''def''' strict_==(other: xml.Equality)` + * 1. `'''def''' strict_==(other: scala.xml.Equality)` * * This one tries to honor the little things like symmetry and hashCode * contracts. The `equals` method routes all comparisons through this. diff --git a/src/library/scala/xml/MetaData.scala b/src/library/scala/xml/MetaData.scala index e98ec90aca..15b3cb6d4a 100644 --- a/src/library/scala/xml/MetaData.scala +++ b/src/library/scala/xml/MetaData.scala @@ -9,7 +9,7 @@ package scala.xml import Utility.sbToString -import annotation.tailrec +import scala.annotation.tailrec import scala.collection.{ AbstractIterable, Iterator } /** diff --git a/src/library/scala/xml/NodeSeq.scala b/src/library/scala/xml/NodeSeq.scala index 40ddc7d85c..e50e68d4fd 100644 --- a/src/library/scala/xml/NodeSeq.scala +++ b/src/library/scala/xml/NodeSeq.scala @@ -8,10 +8,10 @@ package scala.xml -import collection.{ mutable, immutable, generic, SeqLike, AbstractSeq } +import scala.collection.{ mutable, immutable, generic, SeqLike, AbstractSeq } import mutable.{ Builder, ListBuffer } import generic.{ CanBuildFrom } -import language.implicitConversions +import scala.language.implicitConversions /** This object ... * diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala index bae529c85c..50a284d7cd 100755 --- a/src/library/scala/xml/Utility.scala +++ b/src/library/scala/xml/Utility.scala @@ -10,7 +10,7 @@ package scala.xml import scala.collection.mutable import parsing.XhtmlEntities -import language.implicitConversions +import scala.language.implicitConversions /** * The `Utility` object provides utility functions for processing instances diff --git a/src/library/scala/xml/dtd/ContentModel.scala b/src/library/scala/xml/dtd/ContentModel.scala index a5d2a6bd7e..f98aff5709 100644 --- a/src/library/scala/xml/dtd/ContentModel.scala +++ b/src/library/scala/xml/dtd/ContentModel.scala @@ -11,9 +11,9 @@ package scala.xml package dtd -import util.regexp.WordExp -import util.automata._ -import Utility.sbToString +import scala.util.regexp.WordExp +import scala.util.automata._ +import scala.xml.Utility.sbToString import PartialFunction._ object ContentModel extends WordExp { diff --git a/src/library/scala/xml/pull/XMLEventReader.scala b/src/library/scala/xml/pull/XMLEventReader.scala index c764d042c8..07fab27957 100755 --- a/src/library/scala/xml/pull/XMLEventReader.scala +++ b/src/library/scala/xml/pull/XMLEventReader.scala @@ -24,7 +24,7 @@ import scala.xml.parsing.{ ExternalSources, MarkupHandler, MarkupParser } * @author Paul Phillips */ class XMLEventReader(src: Source) -extends collection.AbstractIterator[XMLEvent] +extends scala.collection.AbstractIterator[XMLEvent] with ProducerConsumerIterator[XMLEvent] { // We implement a pull parser as an iterator, but since we may be operating on diff --git a/src/partest/scala/tools/partest/PartestDefaults.scala b/src/partest/scala/tools/partest/PartestDefaults.scala index 73a7b92778..b27ce6ff75 100644 --- a/src/partest/scala/tools/partest/PartestDefaults.scala +++ b/src/partest/scala/tools/partest/PartestDefaults.scala @@ -2,7 +2,7 @@ package scala.tools package partest import nsc.io.{ File, Path, Directory } -import util.{ PathResolver } +import scala.tools.util.PathResolver import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty } import java.lang.Runtime.getRuntime diff --git a/src/partest/scala/tools/partest/TestUtil.scala b/src/partest/scala/tools/partest/TestUtil.scala index 146e6fc69f..9bfd444180 100644 --- a/src/partest/scala/tools/partest/TestUtil.scala +++ b/src/partest/scala/tools/partest/TestUtil.scala @@ -1,6 +1,6 @@ package scala.tools.partest -import reflect.{ classTag, ClassTag } +import scala.reflect.{ classTag, ClassTag } trait TestUtil { /** Given function and block of code, evaluates code block, diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala index 064b82da85..512c718040 100644 --- a/src/partest/scala/tools/partest/nest/FileManager.scala +++ b/src/partest/scala/tools/partest/nest/FileManager.scala @@ -13,7 +13,7 @@ import java.io.{File, FilenameFilter, IOException, StringWriter, FileReader, PrintWriter, FileWriter} import java.net.URI import scala.tools.nsc.io.{ Path, Directory, File => SFile } -import sys.process._ +import scala.sys.process._ import scala.collection.mutable trait FileUtil { diff --git a/src/partest/scala/tools/partest/nest/SBTRunner.scala b/src/partest/scala/tools/partest/nest/SBTRunner.scala index 6fa31492f3..206ee19c76 100644 --- a/src/partest/scala/tools/partest/nest/SBTRunner.scala +++ b/src/partest/scala/tools/partest/nest/SBTRunner.scala @@ -4,7 +4,7 @@ package nest import java.io.File import scala.tools.nsc.io.{ Directory } import scala.util.Properties.setProp -import collection.JavaConverters._ +import scala.collection.JavaConverters._ object SBTRunner extends DirectRunner { diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala index 16a95c8966..ec1778940f 100644 --- a/src/partest/scala/tools/partest/package.scala +++ b/src/partest/scala/tools/partest/package.scala @@ -6,7 +6,7 @@ package scala.tools import java.io.{ FileNotFoundException, File => JFile } import nsc.io.{ Path, Directory, File => SFile } -import util.{ PathResolver } +import scala.tools.util.PathResolver import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty } import scala.sys.process.javaVmArguments import java.util.concurrent.Callable @@ -62,7 +62,7 @@ package object partest { ) def allPropertiesString = { - import collection.JavaConversions._ + import scala.collection.JavaConversions._ System.getProperties.toList.sorted map { case (k, v) => "%s -> %s\n".format(k, v) } mkString "" } diff --git a/src/reflect/scala/reflect/api/Printers.scala b/src/reflect/scala/reflect/api/Printers.scala index 27d3b8ba7d..65ff2ed9fa 100644 --- a/src/reflect/scala/reflect/api/Printers.scala +++ b/src/reflect/scala/reflect/api/Printers.scala @@ -23,7 +23,7 @@ trait Printers { self: Universe => case class BooleanFlag(val value: Option[Boolean]) object BooleanFlag { - import language.implicitConversions + import scala.language.implicitConversions implicit def booleanToBooleanFlag(value: Boolean): BooleanFlag = BooleanFlag(Some(value)) implicit def optionToBooleanFlag(value: Option[Boolean]): BooleanFlag = BooleanFlag(value) } diff --git a/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala b/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala index 554b3bfca6..539984c67f 100644 --- a/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala +++ b/src/reflect/scala/reflect/internal/BaseTypeSeqs.scala @@ -7,7 +7,7 @@ package internal // todo implement in terms of BitSet import scala.collection.{ mutable, immutable } -import math.max +import scala.math.max import util.Statistics /** A base type sequence (BaseTypeSeq) is an ordered sequence spanning all the base types @@ -99,7 +99,7 @@ trait BaseTypeSeqs { def copy(head: Type, offset: Int): BaseTypeSeq = { val arr = new Array[Type](elems.length + offset) - compat.Platform.arraycopy(elems, 0, arr, offset, elems.length) + scala.compat.Platform.arraycopy(elems, 0, arr, offset, elems.length) arr(0) = head newBaseTypeSeq(parents, arr) } diff --git a/src/reflect/scala/reflect/internal/Chars.scala b/src/reflect/scala/reflect/internal/Chars.scala index 6ece733b06..e5e5325b93 100644 --- a/src/reflect/scala/reflect/internal/Chars.scala +++ b/src/reflect/scala/reflect/internal/Chars.scala @@ -5,9 +5,9 @@ package scala.reflect package internal -import annotation.{ tailrec, switch } +import scala.annotation.{ tailrec, switch } import java.lang.{ Character => JCharacter } -import language.postfixOps +import scala.language.postfixOps /** Contains constants and classifier methods for characters */ trait Chars { diff --git a/src/reflect/scala/reflect/internal/ClassfileConstants.scala b/src/reflect/scala/reflect/internal/ClassfileConstants.scala index 124f1f881d..62ed130232 100644 --- a/src/reflect/scala/reflect/internal/ClassfileConstants.scala +++ b/src/reflect/scala/reflect/internal/ClassfileConstants.scala @@ -6,7 +6,7 @@ package scala.reflect package internal -import annotation.switch +import scala.annotation.switch object ClassfileConstants { diff --git a/src/reflect/scala/reflect/internal/Constants.scala b/src/reflect/scala/reflect/internal/Constants.scala index b434be64a3..61fa553484 100644 --- a/src/reflect/scala/reflect/internal/Constants.scala +++ b/src/reflect/scala/reflect/internal/Constants.scala @@ -7,7 +7,7 @@ package scala.reflect package internal import java.lang.Integer.toOctalString -import annotation.switch +import scala.annotation.switch trait Constants extends api.Constants { self: SymbolTable => diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala index 6d9f68a8a5..6d7aa19738 100644 --- a/src/reflect/scala/reflect/internal/Definitions.scala +++ b/src/reflect/scala/reflect/internal/Definitions.scala @@ -6,7 +6,7 @@ package scala.reflect package internal -import annotation.{ switch, meta } +import scala.annotation.{ switch, meta } import scala.collection.{ mutable, immutable } import Flags._ import PartialFunction._ diff --git a/src/reflect/scala/reflect/internal/FlagSets.scala b/src/reflect/scala/reflect/internal/FlagSets.scala index b03d01c944..6270416d4f 100644 --- a/src/reflect/scala/reflect/internal/FlagSets.scala +++ b/src/reflect/scala/reflect/internal/FlagSets.scala @@ -1,7 +1,7 @@ package scala.reflect package internal -import language.implicitConversions +import scala.language.implicitConversions trait FlagSets extends api.FlagSets { self: SymbolTable => diff --git a/src/reflect/scala/reflect/internal/Names.scala b/src/reflect/scala/reflect/internal/Names.scala index 3f85db0f54..0f42db95e3 100644 --- a/src/reflect/scala/reflect/internal/Names.scala +++ b/src/reflect/scala/reflect/internal/Names.scala @@ -8,7 +8,7 @@ package internal import scala.io.Codec import java.security.MessageDigest -import language.implicitConversions +import scala.language.implicitConversions trait LowPriorityNames { self: Names => @@ -67,7 +67,7 @@ trait Names extends api.Names with LowPriorityNames { while (i < len) { if (nc + i == chrs.length) { val newchrs = new Array[Char](chrs.length * 2) - compat.Platform.arraycopy(chrs, 0, newchrs, 0, chrs.length) + scala.compat.Platform.arraycopy(chrs, 0, newchrs, 0, chrs.length) chrs = newchrs } chrs(nc + i) = cs(offset + i) @@ -183,7 +183,7 @@ trait Names extends api.Names with LowPriorityNames { /** Copy bytes of this name to buffer cs, starting at position `offset`. */ final def copyChars(cs: Array[Char], offset: Int) = - compat.Platform.arraycopy(chrs, index, cs, offset, len) + scala.compat.Platform.arraycopy(chrs, index, cs, offset, len) /** @return the ascii representation of this name */ final def toChars: Array[Char] = { @@ -199,7 +199,7 @@ trait Names extends api.Names with LowPriorityNames { */ final def copyUTF8(bs: Array[Byte], offset: Int): Int = { val bytes = Codec.toUTF8(chrs, index, len) - compat.Platform.arraycopy(bytes, 0, bs, offset, bytes.length) + scala.compat.Platform.arraycopy(bytes, 0, bs, offset, bytes.length) offset + bytes.length } diff --git a/src/reflect/scala/reflect/internal/Printers.scala b/src/reflect/scala/reflect/internal/Printers.scala index 9580ed1f72..c23d22efab 100644 --- a/src/reflect/scala/reflect/internal/Printers.scala +++ b/src/reflect/scala/reflect/internal/Printers.scala @@ -10,7 +10,7 @@ package internal import java.io.{ OutputStream, PrintWriter, StringWriter, Writer } import Flags._ -import compat.Platform.EOL +import scala.compat.Platform.EOL trait Printers extends api.Printers { self: SymbolTable => diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala index 92adc85e25..e70531df6e 100644 --- a/src/reflect/scala/reflect/internal/StdNames.scala +++ b/src/reflect/scala/reflect/internal/StdNames.scala @@ -8,8 +8,8 @@ package internal import java.security.MessageDigest import Chars.isOperatorPart -import annotation.switch -import language.implicitConversions +import scala.annotation.switch +import scala.language.implicitConversions import scala.collection.immutable import scala.io.Codec diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala index 0180ed4c4f..a59f01155a 100644 --- a/src/reflect/scala/reflect/internal/Trees.scala +++ b/src/reflect/scala/reflect/internal/Trees.scala @@ -8,7 +8,7 @@ package internal import Flags._ import base.Attachments -import collection.mutable.{ListBuffer, LinkedHashSet} +import scala.collection.mutable.{ListBuffer, LinkedHashSet} import util.Statistics trait Trees extends api.Trees { self: SymbolTable => diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala index 2e00316d5b..1dae6e70b7 100644 --- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala +++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala @@ -14,13 +14,13 @@ import java.lang.Double.longBitsToDouble import Flags._ import PickleFormat._ import scala.collection.{ mutable, immutable } -import collection.mutable.ListBuffer -import annotation.switch +import scala.collection.mutable.ListBuffer +import scala.annotation.switch /** @author Martin Odersky * @version 1.0 */ -abstract class UnPickler /*extends reflect.generic.UnPickler*/ { +abstract class UnPickler /*extends scala.reflect.generic.UnPickler*/ { val global: SymbolTable import global._ diff --git a/src/reflect/scala/reflect/internal/transform/Transforms.scala b/src/reflect/scala/reflect/internal/transform/Transforms.scala index c4c5dc3a1c..71cc80895d 100644 --- a/src/reflect/scala/reflect/internal/transform/Transforms.scala +++ b/src/reflect/scala/reflect/internal/transform/Transforms.scala @@ -2,7 +2,7 @@ package scala.reflect package internal package transform -import language.existentials +import scala.language.existentials trait Transforms { self: SymbolTable => @@ -38,4 +38,4 @@ trait Transforms { self: SymbolTable => def transformedType(tpe: Type) = erasure.scalaErasure(uncurry.uncurry(tpe)) -}
\ No newline at end of file +} diff --git a/src/reflect/scala/reflect/internal/util/HashSet.scala b/src/reflect/scala/reflect/internal/util/HashSet.scala index 51e540e235..0d0f16372c 100644 --- a/src/reflect/scala/reflect/internal/util/HashSet.scala +++ b/src/reflect/scala/reflect/internal/util/HashSet.scala @@ -13,7 +13,7 @@ object HashSet { new HashSet[T](label, initialCapacity) } -class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] with collection.generic.Clearable { +class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) extends Set[T] with scala.collection.generic.Clearable { private var used = 0 private var table = new Array[AnyRef](initialCapacity) private def index(x: Int): Int = math.abs(x % table.length) diff --git a/src/reflect/scala/reflect/internal/util/Position.scala b/src/reflect/scala/reflect/internal/util/Position.scala index e4c6e4aca1..0268881be7 100644 --- a/src/reflect/scala/reflect/internal/util/Position.scala +++ b/src/reflect/scala/reflect/internal/util/Position.scala @@ -6,9 +6,9 @@ package scala.reflect.internal.util -import reflect.ClassTag -import reflect.base.Attachments -import reflect.api.PositionApi +import scala.reflect.ClassTag +import scala.reflect.base.Attachments +import scala.reflect.api.PositionApi object Position { val tabInc = 8 @@ -274,4 +274,4 @@ class TransparentPosition(source: SourceFile, start: Int, point: Int, end: Int) override def isTransparent = true override def makeTransparent = this override def show = "<"+start+":"+end+">" -}
\ No newline at end of file +} diff --git a/src/reflect/scala/reflect/internal/util/SourceFile.scala b/src/reflect/scala/reflect/internal/util/SourceFile.scala index 747c1ad298..9a71e02e08 100644 --- a/src/reflect/scala/reflect/internal/util/SourceFile.scala +++ b/src/reflect/scala/reflect/internal/util/SourceFile.scala @@ -8,7 +8,7 @@ package scala.reflect.internal.util import scala.tools.nsc.io.{ AbstractFile, VirtualFile } import scala.collection.mutable.ArrayBuffer -import annotation.tailrec +import scala.annotation.tailrec import java.util.regex.Pattern import java.io.IOException import scala.reflect.internal.Chars._ @@ -107,15 +107,15 @@ class BatchSourceFile(val file : AbstractFile, val content0: Array[Char]) extend def this(sourceName: String, cs: Seq[Char]) = this(new VirtualFile(sourceName), cs.toArray) def this(file: AbstractFile, cs: Seq[Char]) = this(file, cs.toArray) - // If non-whitespace tokens run all the way up to EOF, - // positions go wrong because the correct end of the last - // token cannot be used as an index into the char array. - // The least painful way to address this was to add a - // newline to the array. - val content = ( - if (content0.length == 0 || !content0.last.isWhitespace) - content0 :+ '\n' - else content0 + // If non-whitespace tokens run all the way up to EOF, + // positions go wrong because the correct end of the last + // token cannot be used as an index into the char array. + // The least painful way to address this was to add a + // newline to the array. + val content = ( + if (content0.length == 0 || !content0.last.isWhitespace) + content0 :+ '\n' + else content0 ) val length = content.length def start = 0 diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala index f7b81ca252..2c90d2d525 100644 --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -1,6 +1,6 @@ package scala.reflect.internal.util -import collection.mutable +import scala.collection.mutable object Statistics { diff --git a/src/reflect/scala/reflect/internal/util/TableDef.scala b/src/reflect/scala/reflect/internal/util/TableDef.scala index 2e60ce3bcc..8e2bcc2ff7 100644 --- a/src/reflect/scala/reflect/internal/util/TableDef.scala +++ b/src/reflect/scala/reflect/internal/util/TableDef.scala @@ -1,7 +1,7 @@ package scala.reflect.internal.util import TableDef._ -import language.postfixOps +import scala.language.postfixOps /** A class for representing tabular data in a way that preserves * its inner beauty. See Exceptional for an example usage. diff --git a/src/reflect/scala/reflect/internal/util/TraceSymbolActivity.scala b/src/reflect/scala/reflect/internal/util/TraceSymbolActivity.scala index cecf8e4658..fa83f70f3a 100644 --- a/src/reflect/scala/reflect/internal/util/TraceSymbolActivity.scala +++ b/src/reflect/scala/reflect/internal/util/TraceSymbolActivity.scala @@ -2,7 +2,7 @@ package scala.reflect.internal package util import scala.collection.{ mutable, immutable } -import language.postfixOps +import scala.language.postfixOps trait TraceSymbolActivity { val global: SymbolTable @@ -108,12 +108,12 @@ trait TraceSymbolActivity { sym.name.decode + "#" + sym.id } - private def freq[T, U](xs: collection.Traversable[T])(fn: T => U): List[(U, Int)] = { + private def freq[T, U](xs: scala.collection.Traversable[T])(fn: T => U): List[(U, Int)] = { val ys = xs groupBy fn mapValues (_.size) ys.toList sortBy (-_._2) } - private def showMapFreq[T](xs: collection.Map[T, Traversable[_]])(showFn: T => String) { + private def showMapFreq[T](xs: scala.collection.Map[T, Traversable[_]])(showFn: T => String) { xs.mapValues(_.size).toList.sortBy(-_._2) take 100 foreach { case (k, size) => show(size, showFn(k)) } diff --git a/src/reflect/scala/reflect/macros/Infrastructure.scala b/src/reflect/scala/reflect/macros/Infrastructure.scala index a8a8b814b1..f01725cd1d 100644 --- a/src/reflect/scala/reflect/macros/Infrastructure.scala +++ b/src/reflect/scala/reflect/macros/Infrastructure.scala @@ -86,7 +86,7 @@ trait Infrastructure { * Needs to be used with extreme care, since memory leaks here will swiftly crash the presentation compiler. * For example, Scala IDE typically launches a compiler run on every edit action so there might be hundreds of runs per minute. */ - val globalCache: collection.mutable.Map[Any, Any] + val globalCache: scala.collection.mutable.Map[Any, Any] /** A cache shared by all invocations of the same macro within a single compilation run. * @@ -95,5 +95,5 @@ trait Infrastructure { * * To share data between different macros and/or different compilation runs, use ``globalCache''. */ - val cache: collection.mutable.Map[Any, Any] + val cache: scala.collection.mutable.Map[Any, Any] } diff --git a/src/reflect/scala/reflect/macros/Reifiers.scala b/src/reflect/scala/reflect/macros/Reifiers.scala index 1bee17d548..bdc6687edc 100644 --- a/src/reflect/scala/reflect/macros/Reifiers.scala +++ b/src/reflect/scala/reflect/macros/Reifiers.scala @@ -1,6 +1,8 @@ package scala.reflect package macros +import scala.reflect.api.PositionApi + trait Reifiers { self: Context => @@ -86,6 +88,6 @@ trait Reifiers { // made these guys non path-dependent, otherwise exception handling quickly becomes a mess -case class ReificationError(val pos: reflect.api.PositionApi, val msg: String) extends Throwable(msg) +case class ReificationError(val pos: PositionApi, val msg: String) extends Throwable(msg) -case class UnexpectedReificationError(val pos: reflect.api.PositionApi, val msg: String, val cause: Throwable = null) extends Throwable(msg, cause) +case class UnexpectedReificationError(val pos: PositionApi, val msg: String, val cause: Throwable = null) extends Throwable(msg, cause) diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala index f4b68640ae..be2661149a 100644 --- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala +++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala @@ -14,12 +14,12 @@ import internal.MissingRequirementError import internal.pickling.ByteCodecs import internal.ClassfileConstants._ import internal.pickling.UnPickler -import collection.mutable.{ HashMap, ListBuffer } +import scala.collection.mutable.{ HashMap, ListBuffer } import internal.Flags._ //import scala.tools.nsc.util.ScalaClassLoader //import scala.tools.nsc.util.ScalaClassLoader._ import ReflectionUtils.{staticSingletonInstance, innerSingletonInstance} -import language.existentials +import scala.language.existentials import scala.runtime.{ScalaRunTime, BoxesRunTime} import scala.reflect.internal.util.Collections._ diff --git a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala index 0125fa2c53..eaf7d8326f 100644 --- a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala +++ b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala @@ -38,7 +38,7 @@ object ReflectionUtils { ) def show(cl: ClassLoader): String = { - import language.reflectiveCalls + import scala.language.reflectiveCalls def isAbstractFileClassLoader(clazz: Class[_]): Boolean = { if (clazz == null) return false diff --git a/src/reflect/scala/reflect/runtime/SymbolLoaders.scala b/src/reflect/scala/reflect/runtime/SymbolLoaders.scala index 583b9d93f3..f3473d46a7 100644 --- a/src/reflect/scala/reflect/runtime/SymbolLoaders.scala +++ b/src/reflect/scala/reflect/runtime/SymbolLoaders.scala @@ -3,7 +3,7 @@ package runtime import internal.Flags import java.lang.{Class => jClass, Package => jPackage} -import collection.mutable +import scala.collection.mutable trait SymbolLoaders { self: SymbolTable => diff --git a/src/reflect/scala/reflect/runtime/TwoWayCache.scala b/src/reflect/scala/reflect/runtime/TwoWayCache.scala index e2bf5773d2..05debcba65 100644 --- a/src/reflect/scala/reflect/runtime/TwoWayCache.scala +++ b/src/reflect/scala/reflect/runtime/TwoWayCache.scala @@ -1,7 +1,7 @@ package scala.reflect package runtime -import collection.mutable.WeakHashMap +import scala.collection.mutable.WeakHashMap import java.lang.ref.WeakReference /** A cache that maintains a bijection between Java reflection type `J` diff --git a/src/reflect/scala/tools/nsc/io/File.scala b/src/reflect/scala/tools/nsc/io/File.scala index 1f3cac7ee1..fce0e339e0 100644 --- a/src/reflect/scala/tools/nsc/io/File.scala +++ b/src/reflect/scala/tools/nsc/io/File.scala @@ -16,7 +16,7 @@ import java.io.{ import java.io.{ File => JFile } import java.nio.channels.{ Channel, FileChannel } import scala.io.Codec -import language.{reflectiveCalls, implicitConversions} +import scala.language.{reflectiveCalls, implicitConversions} object File { def pathSeparator = java.io.File.pathSeparator diff --git a/src/reflect/scala/tools/nsc/io/Path.scala b/src/reflect/scala/tools/nsc/io/Path.scala index e965c70111..0a27e49686 100644 --- a/src/reflect/scala/tools/nsc/io/Path.scala +++ b/src/reflect/scala/tools/nsc/io/Path.scala @@ -12,7 +12,7 @@ import java.io.{ import java.io.{ File => JFile } import java.net.{ URI, URL } import scala.util.Random.alphanumeric -import language.implicitConversions +import scala.language.implicitConversions /** An abstraction for filesystem paths. The differences between * Path, File, and Directory are primarily to communicate intent. diff --git a/src/reflect/scala/tools/nsc/io/Streamable.scala b/src/reflect/scala/tools/nsc/io/Streamable.scala index ff770bd396..625429bdb3 100644 --- a/src/reflect/scala/tools/nsc/io/Streamable.scala +++ b/src/reflect/scala/tools/nsc/io/Streamable.scala @@ -10,7 +10,7 @@ import java.net.{ URI, URL } import java.io.{ BufferedInputStream, InputStream, PrintStream } import java.io.{ BufferedReader, InputStreamReader, Closeable => JCloseable } import scala.io.{ Codec, BufferedSource, Source } -import collection.mutable.ArrayBuffer +import scala.collection.mutable.ArrayBuffer import Path.fail /** Traits for objects which can be represented as Streams. diff --git a/src/reflect/scala/tools/nsc/io/ZipArchive.scala b/src/reflect/scala/tools/nsc/io/ZipArchive.scala index 8201059ca0..9d9d9a46f2 100644 --- a/src/reflect/scala/tools/nsc/io/ZipArchive.scala +++ b/src/reflect/scala/tools/nsc/io/ZipArchive.scala @@ -11,7 +11,7 @@ import java.io.{ IOException, InputStream, ByteArrayInputStream } import java.io.{ File => JFile } import java.util.zip.{ ZipEntry, ZipFile, ZipInputStream } import scala.collection.{ immutable, mutable } -import annotation.tailrec +import scala.annotation.tailrec /** An abstraction for zip files and streams. Everything is written the way * it is for performance: we come through here a lot on every run. Be careful diff --git a/src/scalap/scala/tools/scalap/CodeWriter.scala b/src/scalap/scala/tools/scalap/CodeWriter.scala index f5db183abb..35de796727 100644 --- a/src/scalap/scala/tools/scalap/CodeWriter.scala +++ b/src/scalap/scala/tools/scalap/CodeWriter.scala @@ -13,7 +13,7 @@ import java.io._ class CodeWriter(writer: Writer) { - private val nl = compat.Platform.EOL + private val nl = scala.compat.Platform.EOL private var step = " " private var level = 0 private var align = false diff --git a/test/files/neg/macro-without-xmacros-a.check b/test/files/neg/macro-without-xmacros-a.check index fd2667dbb8..ae6c6c695a 100644 --- a/test/files/neg/macro-without-xmacros-a.check +++ b/test/files/neg/macro-without-xmacros-a.check @@ -1,17 +1,17 @@ -Macros_2.scala:5: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
-This can be achieved by adding the import clause 'import language.experimental.macros'
-or by setting the compiler option -language:experimental.macros.
-See the Scala docs for value scala.language.experimental.macros for a discussion
-why the feature needs to be explicitly enabled.
- def foo(x: Int): Int = macro foo_impl
- ^
-Macros_2.scala:7: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
- def bar(x: Int): Int = macro bar_impl
- ^
-Macros_2.scala:11: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
- def quux(x: Int): Int = macro quux_impl
- ^
-three errors found
+Macros_2.scala:5: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. +This can be achieved by adding the import clause 'import scala.language.experimental.macros' +or by setting the compiler option -language:experimental.macros. +See the Scala docs for value scala.language.experimental.macros for a discussion +why the feature needs to be explicitly enabled. + def foo(x: Int): Int = macro foo_impl + ^ +Macros_2.scala:7: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. + def bar(x: Int): Int = macro bar_impl + ^ +Macros_2.scala:11: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. + def quux(x: Int): Int = macro quux_impl + ^ +three errors found diff --git a/test/files/neg/macro-without-xmacros-b.check b/test/files/neg/macro-without-xmacros-b.check index 2d675b8319..c3cadcf36a 100644 --- a/test/files/neg/macro-without-xmacros-b.check +++ b/test/files/neg/macro-without-xmacros-b.check @@ -1,17 +1,17 @@ -Macros_2.scala:3: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
-This can be achieved by adding the import clause 'import language.experimental.macros'
-or by setting the compiler option -language:experimental.macros.
-See the Scala docs for value scala.language.experimental.macros for a discussion
-why the feature needs to be explicitly enabled.
- def foo(x: Int): Int = macro Impls.foo_impl
- ^
-Macros_2.scala:5: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
- def bar(x: Int): Int = macro Impls.bar_impl
- ^
-Macros_2.scala:9: error: macro definition needs to be enabled
-by making the implicit value language.experimental.macros visible.
- def quux(x: Int): Int = macro Impls.quux_impl
- ^
-three errors found
+Macros_2.scala:3: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. +This can be achieved by adding the import clause 'import scala.language.experimental.macros' +or by setting the compiler option -language:experimental.macros. +See the Scala docs for value scala.language.experimental.macros for a discussion +why the feature needs to be explicitly enabled. + def foo(x: Int): Int = macro Impls.foo_impl + ^ +Macros_2.scala:5: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. + def bar(x: Int): Int = macro Impls.bar_impl + ^ +Macros_2.scala:9: error: macro definition needs to be enabled +by making the implicit value language.experimental.macros visible. + def quux(x: Int): Int = macro Impls.quux_impl + ^ +three errors found diff --git a/test/files/neg/t6040.check b/test/files/neg/t6040.check index f44a81c471..f6757f97e3 100644 --- a/test/files/neg/t6040.check +++ b/test/files/neg/t6040.check @@ -1,6 +1,6 @@ error: extension of type scala.Dynamic needs to be enabled by making the implicit value language.dynamics visible. -This can be achieved by adding the import clause 'import language.dynamics' +This can be achieved by adding the import clause 'import scala.language.dynamics' or by setting the compiler option -language:dynamics. See the Scala docs for value scala.language.dynamics for a discussion why the feature needs to be explicitly enabled. |