diff options
Diffstat (limited to 'src')
1037 files changed, 1739 insertions, 2379 deletions
diff --git a/src/actors/scala/actors/AbstractActor.scala b/src/actors/scala/actors/AbstractActor.scala index f97a1c3e2a..c25e785d76 100644 --- a/src/actors/scala/actors/AbstractActor.scala +++ b/src/actors/scala/actors/AbstractActor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 4e245f27cf..8caa624f67 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors @@ -623,24 +622,22 @@ trait Actor extends AbstractActor with ReplyReactor with ActorCanReply with Inpu _state == Actor.State.Terminated } - override def start(): Actor = synchronized { - if (_state == Actor.State.New) { - _state = Actor.State.Runnable - - // Reset various flags. - // - // Note that we do *not* reset `trapExit`. The reason is that - // users should be able to set the field in the constructor - // and before `act` is called. - exitReason = 'normal - shouldExit = false + // guarded by this + private[actors] override def dostart() { + // Reset various flags. + // + // Note that we do *not* reset `trapExit`. The reason is that + // users should be able to set the field in the constructor + // and before `act` is called. + exitReason = 'normal + shouldExit = false - scheduler newActor this - scheduler execute (new Reaction(this)) + super.dostart() + } - this - } else - this + override def start(): Actor = synchronized { + super.start() + this } override def getState: Actor.State.Value = synchronized { diff --git a/src/actors/scala/actors/ActorCanReply.scala b/src/actors/scala/actors/ActorCanReply.scala index 0f46c1b9de..9d52081a9d 100644 --- a/src/actors/scala/actors/ActorCanReply.scala +++ b/src/actors/scala/actors/ActorCanReply.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/ActorProxy.scala b/src/actors/scala/actors/ActorProxy.scala index 9a79ff14c5..be54ca98c2 100644 --- a/src/actors/scala/actors/ActorProxy.scala +++ b/src/actors/scala/actors/ActorProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/ActorTask.scala b/src/actors/scala/actors/ActorTask.scala index 249c3784a4..66c47f65a5 100644 --- a/src/actors/scala/actors/ActorTask.scala +++ b/src/actors/scala/actors/ActorTask.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/CanReply.scala b/src/actors/scala/actors/CanReply.scala index 034eea8479..eaaaef1a29 100644 --- a/src/actors/scala/actors/CanReply.scala +++ b/src/actors/scala/actors/CanReply.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Channel.scala b/src/actors/scala/actors/Channel.scala index 25b41e39a4..16f43fbd17 100644 --- a/src/actors/scala/actors/Channel.scala +++ b/src/actors/scala/actors/Channel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Debug.scala b/src/actors/scala/actors/Debug.scala index f28156fc9a..7140e5817a 100644 --- a/src/actors/scala/actors/Debug.scala +++ b/src/actors/scala/actors/Debug.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Future.scala b/src/actors/scala/actors/Future.scala index e34569f36b..5050c84c8a 100644 --- a/src/actors/scala/actors/Future.scala +++ b/src/actors/scala/actors/Future.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors @@ -30,7 +29,7 @@ abstract class Future[+T] extends Responder[T] with Function0[T] { private[actors] def fvalueTyped = fvalue.get.asInstanceOf[T] @deprecated("this member is going to be removed in a future release") - val ch: InputChannel[Any] = inputChannel + def ch: InputChannel[Any] = inputChannel @deprecated("this member is going to be removed in a future release") protected def value: Option[Any] = fvalue diff --git a/src/actors/scala/actors/IScheduler.scala b/src/actors/scala/actors/IScheduler.scala index 1718dab045..2080cd79e5 100644 --- a/src/actors/scala/actors/IScheduler.scala +++ b/src/actors/scala/actors/IScheduler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/InputChannel.scala b/src/actors/scala/actors/InputChannel.scala index dfe26b3462..3f5bd7183f 100644 --- a/src/actors/scala/actors/InputChannel.scala +++ b/src/actors/scala/actors/InputChannel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/MessageQueue.scala b/src/actors/scala/actors/MessageQueue.scala index 2c1c2446e6..6936bf63a8 100644 --- a/src/actors/scala/actors/MessageQueue.scala +++ b/src/actors/scala/actors/MessageQueue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/OutputChannel.scala b/src/actors/scala/actors/OutputChannel.scala index 291117bf71..c86cfbad32 100644 --- a/src/actors/scala/actors/OutputChannel.scala +++ b/src/actors/scala/actors/OutputChannel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/ReactChannel.scala b/src/actors/scala/actors/ReactChannel.scala index dc31e99711..69312e41d6 100644 --- a/src/actors/scala/actors/ReactChannel.scala +++ b/src/actors/scala/actors/ReactChannel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: InputChannel.scala 18844 2009-09-30 20:28:49Z phaller $ package scala.actors diff --git a/src/actors/scala/actors/Reaction.scala b/src/actors/scala/actors/Reaction.scala index 5a6d9b643c..83eedf4730 100644 --- a/src/actors/scala/actors/Reaction.scala +++ b/src/actors/scala/actors/Reaction.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Reactor.scala b/src/actors/scala/actors/Reactor.scala index fe00e216d3..1c1dfdbd7a 100644 --- a/src/actors/scala/actors/Reactor.scala +++ b/src/actors/scala/actors/Reactor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors @@ -216,17 +215,32 @@ trait Reactor[Msg >: Null] extends OutputChannel[Msg] with Combinators { scheduler executeFromActor makeReaction(null, handler, msg) } + // guarded by this + private[actors] def dostart() { + _state = Actor.State.Runnable + scheduler newActor this + scheduler execute makeReaction(() => act(), null, null) + } + /** - * Starts this $actor. + * Starts this $actor. This method is idempotent. */ def start(): Reactor[Msg] = synchronized { - if (_state == Actor.State.New) { - _state = Actor.State.Runnable - scheduler newActor this - scheduler execute makeReaction(() => act()) - this - } else - this + if (_state == Actor.State.New) + dostart() + this + } + + /** + * Restarts this $actor. + * + * @throws java.lang.IllegalStateException if the $actor is not in state `Actor.State.Terminated` + */ + def restart(): Unit = synchronized { + if (_state == Actor.State.Terminated) + dostart() + else + throw new IllegalStateException("restart only in state "+Actor.State.Terminated) } /** Returns the execution state of this $actor. diff --git a/src/actors/scala/actors/ReactorCanReply.scala b/src/actors/scala/actors/ReactorCanReply.scala index 14cb423cf6..884c0ceecc 100644 --- a/src/actors/scala/actors/ReactorCanReply.scala +++ b/src/actors/scala/actors/ReactorCanReply.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/ReactorTask.scala b/src/actors/scala/actors/ReactorTask.scala index c379334f2f..c4eab2a65a 100644 --- a/src/actors/scala/actors/ReactorTask.scala +++ b/src/actors/scala/actors/ReactorTask.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/ReplyReactor.scala b/src/actors/scala/actors/ReplyReactor.scala index 665ed3091f..af97e286d1 100644 --- a/src/actors/scala/actors/ReplyReactor.scala +++ b/src/actors/scala/actors/ReplyReactor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/Scheduler.scala b/src/actors/scala/actors/Scheduler.scala index 6792b65abe..ad5d83e911 100644 --- a/src/actors/scala/actors/Scheduler.scala +++ b/src/actors/scala/actors/Scheduler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/SchedulerAdapter.scala b/src/actors/scala/actors/SchedulerAdapter.scala index 698096c556..75c8405c4b 100644 --- a/src/actors/scala/actors/SchedulerAdapter.scala +++ b/src/actors/scala/actors/SchedulerAdapter.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/remote/FreshNameCreator.scala b/src/actors/scala/actors/remote/FreshNameCreator.scala index 298dd3ac6c..f7cfcab687 100644 --- a/src/actors/scala/actors/remote/FreshNameCreator.scala +++ b/src/actors/scala/actors/remote/FreshNameCreator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package remote diff --git a/src/actors/scala/actors/remote/JavaSerializer.scala b/src/actors/scala/actors/remote/JavaSerializer.scala index f349e80a2e..5d9f9816d1 100644 --- a/src/actors/scala/actors/remote/JavaSerializer.scala +++ b/src/actors/scala/actors/remote/JavaSerializer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package remote diff --git a/src/actors/scala/actors/remote/NetKernel.scala b/src/actors/scala/actors/remote/NetKernel.scala index fc79fdec54..a5ec3e3999 100644 --- a/src/actors/scala/actors/remote/NetKernel.scala +++ b/src/actors/scala/actors/remote/NetKernel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package remote diff --git a/src/actors/scala/actors/remote/Proxy.scala b/src/actors/scala/actors/remote/Proxy.scala index 3607e6e62d..625ce8bb0b 100644 --- a/src/actors/scala/actors/remote/Proxy.scala +++ b/src/actors/scala/actors/remote/Proxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package remote diff --git a/src/actors/scala/actors/remote/RemoteActor.scala b/src/actors/scala/actors/remote/RemoteActor.scala index 4e544665c0..c5397bc1be 100644 --- a/src/actors/scala/actors/remote/RemoteActor.scala +++ b/src/actors/scala/actors/remote/RemoteActor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/remote/Serializer.scala b/src/actors/scala/actors/remote/Serializer.scala index d6d327da04..e6f5bd5ba7 100644 --- a/src/actors/scala/actors/remote/Serializer.scala +++ b/src/actors/scala/actors/remote/Serializer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/remote/Service.scala b/src/actors/scala/actors/remote/Service.scala index faf4f0b322..298d87e3c5 100644 --- a/src/actors/scala/actors/remote/Service.scala +++ b/src/actors/scala/actors/remote/Service.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package remote diff --git a/src/actors/scala/actors/remote/TcpService.scala b/src/actors/scala/actors/remote/TcpService.scala index e09efe161d..a6f7adffed 100644 --- a/src/actors/scala/actors/remote/TcpService.scala +++ b/src/actors/scala/actors/remote/TcpService.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors diff --git a/src/actors/scala/actors/scheduler/ActorGC.scala b/src/actors/scala/actors/scheduler/ActorGC.scala index 0fe94b09c9..059eedf7f4 100644 --- a/src/actors/scala/actors/scheduler/ActorGC.scala +++ b/src/actors/scala/actors/scheduler/ActorGC.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/actors/scala/actors/scheduler/ExecutorScheduler.scala b/src/actors/scala/actors/scheduler/ExecutorScheduler.scala index 8c29af604e..d9194c0edf 100644 --- a/src/actors/scala/actors/scheduler/ExecutorScheduler.scala +++ b/src/actors/scala/actors/scheduler/ExecutorScheduler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala index 3687138e0e..89df10e19c 100644 --- a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala +++ b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: ThreadPoolScheduler.scala 18948 2009-10-06 17:30:27Z phaller $ package scala.actors.scheduler diff --git a/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala b/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala index f91351d1f5..6ee3754d69 100644 --- a/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala +++ b/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/actors/scala/actors/scheduler/TerminationMonitor.scala b/src/actors/scala/actors/scheduler/TerminationMonitor.scala index 82897f7afd..bb6ae0bde8 100644 --- a/src/actors/scala/actors/scheduler/TerminationMonitor.scala +++ b/src/actors/scala/actors/scheduler/TerminationMonitor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/actors/scala/actors/scheduler/TerminationService.scala b/src/actors/scala/actors/scheduler/TerminationService.scala index aa047eedfa..610a76372f 100644 --- a/src/actors/scala/actors/scheduler/TerminationService.scala +++ b/src/actors/scala/actors/scheduler/TerminationService.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala index 6efe9b007d..1c5b9be0d3 100644 --- a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala +++ b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.actors package scheduler diff --git a/src/android-library/scala/ScalaObject.scala b/src/android-library/scala/ScalaObject.scala index dc3b0260f3..10b2306abd 100644 --- a/src/android-library/scala/ScalaObject.scala +++ b/src/android-library/scala/ScalaObject.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/attic/scala/tools/nsc/models/Models.scala b/src/attic/scala/tools/nsc/models/Models.scala index 438a9d3f2c..7365709b25 100644 --- a/src/attic/scala/tools/nsc/models/Models.scala +++ b/src/attic/scala/tools/nsc/models/Models.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package models diff --git a/src/attic/scala/tools/nsc/models/SemanticTokens.scala b/src/attic/scala/tools/nsc/models/SemanticTokens.scala index 4da23b358b..5b492ba056 100644 --- a/src/attic/scala/tools/nsc/models/SemanticTokens.scala +++ b/src/attic/scala/tools/nsc/models/SemanticTokens.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package models diff --git a/src/attic/scala/tools/nsc/models/Signatures.scala b/src/attic/scala/tools/nsc/models/Signatures.scala index 2a94a1cfae..cca65f7fc9 100644 --- a/src/attic/scala/tools/nsc/models/Signatures.scala +++ b/src/attic/scala/tools/nsc/models/Signatures.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package models diff --git a/src/build/genprod.scala b/src/build/genprod.scala index f12f98b569..842d235f24 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ /** <p> * This program generates the <code>ProductN</code>, <code>TupleN</code> <code>FunctionN</code> classes, where @@ -74,7 +73,6 @@ object genprod { ** |/ ** \* */ -// $Id$ %s diff --git a/src/compiler/scala/tools/ant/FastScalac.scala b/src/compiler/scala/tools/ant/FastScalac.scala index 1badd3047b..8c8363a321 100644 --- a/src/compiler/scala/tools/ant/FastScalac.scala +++ b/src/compiler/scala/tools/ant/FastScalac.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant diff --git a/src/compiler/scala/tools/ant/Same.scala b/src/compiler/scala/tools/ant/Same.scala index d5cba4a0bf..4f7173e68b 100644 --- a/src/compiler/scala/tools/ant/Same.scala +++ b/src/compiler/scala/tools/ant/Same.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant diff --git a/src/compiler/scala/tools/ant/ScalaBazaar.scala b/src/compiler/scala/tools/ant/ScalaBazaar.scala index f560883a2d..1c1b0ccb46 100644 --- a/src/compiler/scala/tools/ant/ScalaBazaar.scala +++ b/src/compiler/scala/tools/ant/ScalaBazaar.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant { diff --git a/src/compiler/scala/tools/ant/ScalaTool.scala b/src/compiler/scala/tools/ant/ScalaTool.scala index 90f1fcaeda..db53224b4f 100644 --- a/src/compiler/scala/tools/ant/ScalaTool.scala +++ b/src/compiler/scala/tools/ant/ScalaTool.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index 4ecfc3dc85..6cda588419 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant diff --git a/src/compiler/scala/tools/ant/Scaladoc.scala b/src/compiler/scala/tools/ant/Scaladoc.scala index 03dc99be68..3d96b959f5 100644 --- a/src/compiler/scala/tools/ant/Scaladoc.scala +++ b/src/compiler/scala/tools/ant/Scaladoc.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant diff --git a/src/compiler/scala/tools/ant/sabbus/Break.scala b/src/compiler/scala/tools/ant/sabbus/Break.scala index e6c89dccf7..95bc5cc14e 100644 --- a/src/compiler/scala/tools/ant/sabbus/Break.scala +++ b/src/compiler/scala/tools/ant/sabbus/Break.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/CompilationFailure.scala b/src/compiler/scala/tools/ant/sabbus/CompilationFailure.scala index 618350d91f..94e2ceffd2 100644 --- a/src/compiler/scala/tools/ant/sabbus/CompilationFailure.scala +++ b/src/compiler/scala/tools/ant/sabbus/CompilationFailure.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/Compiler.scala b/src/compiler/scala/tools/ant/sabbus/Compiler.scala index 2daf664b2e..6d8473ef7d 100644 --- a/src/compiler/scala/tools/ant/sabbus/Compiler.scala +++ b/src/compiler/scala/tools/ant/sabbus/Compiler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/Compilers.scala b/src/compiler/scala/tools/ant/sabbus/Compilers.scala index 6f6986a118..91a8580475 100644 --- a/src/compiler/scala/tools/ant/sabbus/Compilers.scala +++ b/src/compiler/scala/tools/ant/sabbus/Compilers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/ForeignCompiler.scala b/src/compiler/scala/tools/ant/sabbus/ForeignCompiler.scala index 2263196af4..697ec44bd0 100644 --- a/src/compiler/scala/tools/ant/sabbus/ForeignCompiler.scala +++ b/src/compiler/scala/tools/ant/sabbus/ForeignCompiler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/Make.scala b/src/compiler/scala/tools/ant/sabbus/Make.scala index d1579670ac..9173745472 100644 --- a/src/compiler/scala/tools/ant/sabbus/Make.scala +++ b/src/compiler/scala/tools/ant/sabbus/Make.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala index 353499ddb3..689df48a88 100644 --- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala +++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant package sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/Settings.scala b/src/compiler/scala/tools/ant/sabbus/Settings.scala index 2719196095..2304c31a0b 100644 --- a/src/compiler/scala/tools/ant/sabbus/Settings.scala +++ b/src/compiler/scala/tools/ant/sabbus/Settings.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/TaskArgs.scala b/src/compiler/scala/tools/ant/sabbus/TaskArgs.scala index 20a6791648..977bfee3d4 100644 --- a/src/compiler/scala/tools/ant/sabbus/TaskArgs.scala +++ b/src/compiler/scala/tools/ant/sabbus/TaskArgs.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/ant/sabbus/Use.scala b/src/compiler/scala/tools/ant/sabbus/Use.scala index fa17c48b63..a466d7b18a 100644 --- a/src/compiler/scala/tools/ant/sabbus/Use.scala +++ b/src/compiler/scala/tools/ant/sabbus/Use.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.ant.sabbus diff --git a/src/compiler/scala/tools/nsc/CompilationUnits.scala b/src/compiler/scala/tools/nsc/CompilationUnits.scala index fb62c7d46c..a9300ff304 100644 --- a/src/compiler/scala/tools/nsc/CompilationUnits.scala +++ b/src/compiler/scala/tools/nsc/CompilationUnits.scala @@ -2,13 +2,11 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc -import scala.tools.nsc.util.{FreshNameCreator,OffsetPosition,Position,NoPosition,SourceFile} -import scala.tools.nsc.io.AbstractFile -import scala.collection.mutable.{LinkedHashSet, HashSet, HashMap, ListBuffer} +import util.{ FreshNameCreator,Position,NoPosition,SourceFile } +import scala.collection.mutable.{ LinkedHashSet, HashSet, HashMap, ListBuffer } trait CompilationUnits { self: Global => diff --git a/src/compiler/scala/tools/nsc/CompileClient.scala b/src/compiler/scala/tools/nsc/CompileClient.scala index b672a616c3..c3307cba77 100644 --- a/src/compiler/scala/tools/nsc/CompileClient.scala +++ b/src/compiler/scala/tools/nsc/CompileClient.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/CompileServer.scala b/src/compiler/scala/tools/nsc/CompileServer.scala index c4f9b1d9f1..832f1e5aef 100644 --- a/src/compiler/scala/tools/nsc/CompileServer.scala +++ b/src/compiler/scala/tools/nsc/CompileServer.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala index d4697b69e6..d57016c4e9 100644 --- a/src/compiler/scala/tools/nsc/CompileSocket.scala +++ b/src/compiler/scala/tools/nsc/CompileSocket.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala index c8c7482811..54ef6bb8be 100644 --- a/src/compiler/scala/tools/nsc/CompilerCommand.scala +++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/CompilerRun.scala b/src/compiler/scala/tools/nsc/CompilerRun.scala index 63ed4382af..9cac12d896 100644 --- a/src/compiler/scala/tools/nsc/CompilerRun.scala +++ b/src/compiler/scala/tools/nsc/CompilerRun.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/ConsoleWriter.scala b/src/compiler/scala/tools/nsc/ConsoleWriter.scala index 95adc47fb8..3c7d10767c 100644 --- a/src/compiler/scala/tools/nsc/ConsoleWriter.scala +++ b/src/compiler/scala/tools/nsc/ConsoleWriter.scala @@ -2,7 +2,6 @@ * Copyright 2006-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/EvalLoop.scala b/src/compiler/scala/tools/nsc/EvalLoop.scala index 388bcf8ccc..d8aa7799cb 100644 --- a/src/compiler/scala/tools/nsc/EvalLoop.scala +++ b/src/compiler/scala/tools/nsc/EvalLoop.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/FatalError.scala b/src/compiler/scala/tools/nsc/FatalError.scala index f9a801e611..145eb4c9ee 100644 --- a/src/compiler/scala/tools/nsc/FatalError.scala +++ b/src/compiler/scala/tools/nsc/FatalError.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala b/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala index f3ac556d4f..c088bb9303 100644 --- a/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala +++ b/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala @@ -3,7 +3,6 @@ * @author Lex Spoon */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala index 6697146a5a..5d272b06ae 100644 --- a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala +++ b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala @@ -3,7 +3,6 @@ * @author Lex Spoon */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 0ec36cf9ab..7efd8ad2a0 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -12,7 +11,7 @@ import compat.Platform.currentTime import io.{ SourceReader, AbstractFile, Path } import reporters.{ Reporter, ConsoleReporter } -import util.{ ClassPath, SourceFile, Statistics, BatchSourceFile } +import util.{ ClassPath, SourceFile, Statistics, BatchSourceFile, ScriptSourceFile, returning } import collection.mutable.{ HashSet, HashMap, ListBuffer } import reflect.generic.{ PickleBuffer } @@ -220,8 +219,13 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable if (settings.verbose.value || settings.Ylogcp.value) inform("[Classpath = " + classPath.asClasspathString + "]") + /** True if -Xscript has been set, indicating a script run. + */ + def isScriptRun = settings.script.value != "" + def getSourceFile(f: AbstractFile): BatchSourceFile = - new BatchSourceFile(f, reader.read(f)) + if (isScriptRun) ScriptSourceFile(f, reader read f) + else new BatchSourceFile(f, reader read f) def getSourceFile(name: String): SourceFile = { val f = AbstractFile.getFile(name) @@ -796,21 +800,15 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable /** Compile list of abstract files */ def compileFiles(files: List[AbstractFile]) { - try { - compileSources(files map getSourceFile) - } catch { - case ex: IOException => error(ex.getMessage()) - } + try compileSources(files map getSourceFile) + catch { case ex: IOException => error(ex.getMessage()) } } /** Compile list of files given by their names */ def compile(filenames: List[String]) { - val scriptMain = settings.script.value - def sources: List[SourceFile] = scriptMain match { - case "" => filenames map getSourceFile - case main if filenames.length == 1 => List(ScriptRunner.wrappedScript(main, filenames.head, getSourceFile)) - case _ => error("can only compile one script at a time") ; Nil - } + val sources: List[SourceFile] = + if (isScriptRun && filenames.size > 1) returning(Nil)(_ => error("can only compile one script at a time")) + else filenames map getSourceFile try compileSources(sources) catch { case ex: IOException => error(ex.getMessage()) } diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 556a3107cd..128c378e23 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -27,7 +26,7 @@ import scala.util.control.Exception.{ Catcher, catching, ultimately, unwrapping import io.{ PlainFile, VirtualDirectory } import reporters.{ ConsoleReporter, Reporter } import symtab.{ Flags, Names } -import util.{ SourceFile, BatchSourceFile, ClassPath, Chars } +import util.{ SourceFile, BatchSourceFile, ScriptSourceFile, ClassPath, Chars, stringFromWriter } import scala.reflect.NameTransformer import scala.tools.nsc.{ InterpreterResults => IR } import interpreter._ @@ -76,6 +75,11 @@ import Interpreter._ class Interpreter(val settings: Settings, out: PrintWriter) { repl => + def println(x: Any) = { + out.println(x) + out.flush() + } + /** construct an interpreter that reports to Console */ def this(settings: Settings) = this(settings, new NewLinePrintWriter(new ConsoleWriter, true)) def this() = this(new Settings()) @@ -109,28 +113,37 @@ class Interpreter(val settings: Settings, out: PrintWriter) { |} |""".stripMargin - val run = new _compiler.Run() - run compileSources List(new BatchSourceFile("<init>", source)) - if (settings.debug.value) { - out println "Repl compiler initialized." - out.flush() + try { + new _compiler.Run() compileSources List(new BatchSourceFile("<init>", source)) + if (isReplDebug || settings.debug.value) + println("Repl compiler initialized.") + true + } + catch { + case MissingRequirementError(msg) => println(""" + |Failed to initialize compiler: %s not found. + |** Note that as of 2.8 scala does not assume use of the java classpath. + |** For the old behavior pass -usejavacp to scala, or if using a Settings + |** object programatically, settings.usejavacp.value = true.""".stripMargin.format(msg) + ) + false } - true } // set up initialization future - private var _isInitialized: () => Boolean = () => false + private var _isInitialized: () => Boolean = null def initialize() = synchronized { - if (!_isInitialized()) + if (_isInitialized == null) _isInitialized = scala.concurrent.ops future _initialize() } /** the public, go through the future compiler */ lazy val compiler: Global = { initialize() - _isInitialized() // blocks until it is - _compiler + // blocks until it is ; false means catastrophic failure + if (_isInitialized()) _compiler + else null } import compiler.{ Traverser, CompilationUnit, Symbol, Name, Type } @@ -174,16 +187,6 @@ class Interpreter(val settings: Settings, out: PrintWriter) { /** interpreter settings */ lazy val isettings = new InterpreterSettings(this) - /** Heuristically strip interpreter wrapper prefixes - * from an interpreter output string. - */ - def stripWrapperGunk(str: String): String = - if (isettings.unwrapStrings) { - val wrapregex = """(line[0-9]+\$object[$.])?(\$iw[$.])*""" - str.replaceAll(wrapregex, "") - } - else str - /** Instantiate a compiler. Subclasses can override this to * change the compiler class used by this interpreter. */ protected def newCompiler(settings: Settings, reporter: Reporter) = { @@ -237,6 +240,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { private val usedNameMap = new HashMap[Name, Request]() private val boundNameMap = new HashMap[Name, Request]() private def allHandlers = prevRequests.toList flatMap (_.handlers) + private def allReqAndHandlers = prevRequests.toList flatMap (req => req.handlers map (req -> _)) def printAllTypeOf = { prevRequests foreach { req => @@ -322,15 +326,6 @@ class Interpreter(val settings: Settings, out: PrintWriter) { def getVarName = varNameCreator() def getSynthVarName = synthVarNameCreator() - /** generate a string using a routine that wants to write on a stream */ - private def stringFrom(writer: PrintWriter => Unit): String = { - val stringWriter = new StringWriter() - val stream = new NewLinePrintWriter(stringWriter) - writer(stream) - stream.close - stringWriter.toString - } - /** Truncate a string if it is longer than isettings.maxPrintString */ private def truncPrintString(str: String): String = { val maxpr = isettings.maxPrintString @@ -341,7 +336,10 @@ class Interpreter(val settings: Settings, out: PrintWriter) { } /** Clean up a string for output */ - private def clean(str: String) = truncPrintString(stripWrapperGunk(str)) + private def clean(str: String) = truncPrintString( + if (isettings.unwrapStrings) stripWrapperGunk(str) + else str + ) /** Indent some code by the width of the scala> prompt. * This way, compiler error messages read better. @@ -350,7 +348,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { def indentCode(code: String) = { /** Heuristic to avoid indenting and thereby corrupting """-strings and XML literals. */ val noIndent = (code contains "\n") && (List("\"\"\"", "</", "/>") exists (code contains _)) - stringFrom(str => + stringFromWriter(str => for (line <- code.lines) { if (!noIndent) str.print(spaces) @@ -419,10 +417,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { } /** Flatten the handlers out and pair each with the original request */ - val rhpairs = prevRequests.reverse.toList flatMap { req => - req.handlers map (ReqAndHandler(req, _)) - } - select(rhpairs, wanted).reverse + select(allReqAndHandlers reverseMap { case (r, h) => ReqAndHandler(r, h) }, wanted).reverse } val code, trailingBraces, accessPath = new StringBuffer @@ -579,26 +574,28 @@ class Interpreter(val settings: Settings, out: PrintWriter) { */ def interpret(line: String): IR.Result = interpret(line, false) def interpret(line: String, synthetic: Boolean): IR.Result = { - val req = requestFromLine(line, synthetic) match { - case Left(result) => return result - case Right(req) => req - } - // null indicates a disallowed statement type; otherwise compile and - // fail if false (implying e.g. a type error) - if (req == null || !req.compile) - return IR.Error + def loadAndRunReq(req: Request) = { + val (result, succeeded) = req.loadAndRun + if (printResults || !succeeded) + out print clean(result) - val (result, succeeded) = req.loadAndRun - if (printResults || !succeeded) - out print clean(result) + // book-keeping + if (succeeded && !synthetic) + recordRequest(req) - if (succeeded) { - if (!synthetic) - recordRequest(req) // book-keeping + if (succeeded) IR.Success + else IR.Error + } - IR.Success + if (compiler == null) IR.Error + else requestFromLine(line, synthetic) match { + case Left(result) => result + case Right(req) => + // null indicates a disallowed statement type; otherwise compile and + // fail if false (implying e.g. a type error) + if (req == null || !req.compile) IR.Error + else loadAndRunReq(req) } - else IR.Error } /** A name creator used for objects created by <code>bind()</code>. */ @@ -682,7 +679,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { def extraCodeToEvaluate(req: Request, code: PrintWriter) { } def resultExtractionCode(req: Request, code: PrintWriter) { } - override def toString = "%s(usedNames = %s)".format(this.getClass, usedNames) + override def toString = "%s(used = %s)".format(this.getClass.toString split '.' last, usedNames) } private class GenericHandler(member: Tree) extends MemberHandler(member) @@ -840,7 +837,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { def toCompute = line /** generate the source code for the object that computes this request */ - def objectSourceCode: String = stringFrom { code => + def objectSourceCode: String = stringFromWriter { code => val preamble = """ |object %s { | %s%s @@ -854,7 +851,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { /** generate source code for the object that retrieves the result from objectSourceCode */ - def resultObjectSourceCode: String = stringFrom { code => + def resultObjectSourceCode: String = stringFromWriter { code => /** We only want to generate this code when the result * is a value which can be referred to as-is. */ @@ -975,7 +972,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { case t: Throwable if bindLastException => withoutBindingLastException { quietBind("lastException", "java.lang.Throwable", t) - (stringFrom(t.printStackTrace(_)), false) + (stringFromWriter(t.printStackTrace(_)), false) } } @@ -985,6 +982,8 @@ class Interpreter(val settings: Settings, out: PrintWriter) { } } } + + override def toString = "Request(line=%s, %s trees)".format(line, trees.size) } /** A container class for methods to be injected into the repl diff --git a/src/compiler/scala/tools/nsc/InterpreterCommand.scala b/src/compiler/scala/tools/nsc/InterpreterCommand.scala index 45e139194e..0ac2ef9617 100644 --- a/src/compiler/scala/tools/nsc/InterpreterCommand.scala +++ b/src/compiler/scala/tools/nsc/InterpreterCommand.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index 4e8a04de44..f68ce4a5b4 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Alexander Spoon */ -// $Id$ package scala.tools.nsc @@ -246,31 +245,18 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite case _ => true } - // this is about the illusion of snappiness. We call initialize() - // which spins off a separate thread, then print the prompt and try - // our best to look ready. Ideally the user will spend a - // couple seconds saying "wow, it starts so fast!" and by the time - // they type a command the compiler is ready to roll. - interpreter.initialize() - while (processLine(readOneLine)) { } } /** interpret all lines from a specified file */ - def interpretAllFrom(filename: String) { - val fileIn = File(filename) - if (!fileIn.exists) - return out.println("Error opening file: " + filename) - + def interpretAllFrom(file: File) { val oldIn = in val oldReplay = replayCommandStack - try { - fileIn applyReader { reader => - in = new SimpleReader(reader, out, false) - plushln("Loading " + filename + "...") - repl - } + try file applyReader { reader => + in = new SimpleReader(reader, out, false) + plushln("Loading " + file + "...") + repl() } finally { in = oldIn @@ -303,8 +289,10 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite List(("stdout", p.stdout), ("stderr", p.stderr)) foreach (add _).tupled } - def withFile(filename: String)(action: String => Unit) { - if (File(filename).exists) action(filename) + def withFile(filename: String)(action: File => Unit) { + val f = File(filename) + + if (f.exists) action(f) else out.println("That file does not exist") } @@ -367,10 +355,13 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite def ambiguous(cmds: List[Command]) = "Ambiguous: did you mean " + cmds.map(":" + _.name).mkString(" or ") + "?" // not a command - if (!line.startsWith(":")) - return Result(true, interpretStartingWith(line)) + if (!line.startsWith(":")) { + // Notice failure to create compiler + if (interpreter.compiler == null) return Result(false, None) + else return Result(true, interpretStartingWith(line)) + } - val tokens = line.substring(1).split("""\s+""").toList + val tokens = (line drop 1 split """\s+""").toList if (tokens.isEmpty) return withError(ambiguous(commands)) @@ -477,20 +468,25 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite // signal completion non-completion input has been received in.completion foreach (_.resetVerbosity()) - def reallyInterpret = { - interpreter.interpret(code) match { - case IR.Error => None - case IR.Success => Some(code) - case IR.Incomplete => - if (in.interactive && code.endsWith("\n\n")) { - out.println("You typed two blank lines. Starting a new command.") + def reallyInterpret = interpreter.interpret(code) match { + case IR.Error => None + case IR.Success => Some(code) + case IR.Incomplete => + if (in.interactive && code.endsWith("\n\n")) { + out.println("You typed two blank lines. Starting a new command.") + None + } + else in.readLine(CONTINUATION_STRING) match { + case null => + // we know compilation is going to fail since we're at EOF and the + // parser thinks the input is still incomplete, but since this is + // a file being read non-interactively we want to fail. So we send + // it straight to the compiler for the nice error message. + interpreter.compileString(code) None - } - else in.readLine(CONTINUATION_STRING) match { - case null => None // end of file - case line => interpretStartingWith(code + "\n" + line) - } - } + + case line => interpretStartingWith(code + "\n" + line) + } } /** Here we place ourselves between the user and the interpreter and examine @@ -552,8 +548,16 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite if (interpreter.reporter.hasErrors) return printWelcome() + + // this is about the illusion of snappiness. We call initialize() + // which spins off a separate thread, then print the prompt and try + // our best to look ready. Ideally the user will spend a + // couple seconds saying "wow, it starts so fast!" and by the time + // they type a command the compiler is ready to roll. + interpreter.initialize() repl() - } finally closeInterpreter() + } + finally closeInterpreter() } private def objClass(x: Any) = x.asInstanceOf[AnyRef].getClass diff --git a/src/compiler/scala/tools/nsc/InterpreterResults.scala b/src/compiler/scala/tools/nsc/InterpreterResults.scala index 76657a2125..fad3fb653f 100644 --- a/src/compiler/scala/tools/nsc/InterpreterResults.scala +++ b/src/compiler/scala/tools/nsc/InterpreterResults.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/InterpreterSettings.scala b/src/compiler/scala/tools/nsc/InterpreterSettings.scala index a5e1c1e729..b53a6f6955 100644 --- a/src/compiler/scala/tools/nsc/InterpreterSettings.scala +++ b/src/compiler/scala/tools/nsc/InterpreterSettings.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Alexander Spoon */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala index eaa2970dda..948c5f6fb8 100644 --- a/src/compiler/scala/tools/nsc/Main.scala +++ b/src/compiler/scala/tools/nsc/Main.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/MainGenericRunner.scala b/src/compiler/scala/tools/nsc/MainGenericRunner.scala index fdc5fe82dd..936ee3c1db 100644 --- a/src/compiler/scala/tools/nsc/MainGenericRunner.scala +++ b/src/compiler/scala/tools/nsc/MainGenericRunner.scala @@ -3,7 +3,6 @@ * @author Lex Spoon */ -// $Id$ package scala.tools.nsc @@ -39,14 +38,23 @@ object MainGenericRunner { else if (settings.version.value) return errorFn("Scala code runner %s -- %s".format(versionString, copyrightString)) else if (command.shouldStopWithInfo) return errorFn(command getInfoMessage sampleCompiler) + def isE = !settings.execute.isDefault def dashe = settings.execute.value + + def isI = !settings.loadfiles.isDefault def dashi = settings.loadfiles.value - def slurp = dashi map (file => File(file).slurp()) mkString "\n" + + def combinedCode = { + val files = if (isI) dashi map (file => File(file).slurp()) else Nil + val str = if (isE) List(dashe) else Nil + + files ++ str mkString "\n\n" + } val classpath: List[URL] = new PathResolver(settings) asURLs /** Was code given in a -e argument? */ - if (!settings.execute.isDefault) { + if (isE) { /** If a -i argument was also given, we want to execute the code after the * files have been included, so they are read into strings and prepended to * the code given in -e. The -i option is documented to only make sense @@ -55,11 +63,8 @@ object MainGenericRunner { * This all needs a rewrite though. */ val fullArgs = command.thingToRun.toList ::: command.arguments - val code = - if (settings.loadfiles.isDefault) dashe - else slurp + "\n" + dashe - exitCond(ScriptRunner.runCommand(settings, code, fullArgs)) + exitCond(ScriptRunner.runCommand(settings, combinedCode, fullArgs)) } else command.thingToRun match { case None => diff --git a/src/compiler/scala/tools/nsc/MainInterpreter.scala b/src/compiler/scala/tools/nsc/MainInterpreter.scala index 568705aff1..0a0d1e4a33 100644 --- a/src/compiler/scala/tools/nsc/MainInterpreter.scala +++ b/src/compiler/scala/tools/nsc/MainInterpreter.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Lex Spoon */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/MainTokenMetric.scala b/src/compiler/scala/tools/nsc/MainTokenMetric.scala index 9c123922d6..fc0ea67051 100644 --- a/src/compiler/scala/tools/nsc/MainTokenMetric.scala +++ b/src/compiler/scala/tools/nsc/MainTokenMetric.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/NewLinePrintWriter.scala b/src/compiler/scala/tools/nsc/NewLinePrintWriter.scala index ecb436d8a9..4ced491a8d 100644 --- a/src/compiler/scala/tools/nsc/NewLinePrintWriter.scala +++ b/src/compiler/scala/tools/nsc/NewLinePrintWriter.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc import java.io.{Writer, PrintWriter} diff --git a/src/compiler/scala/tools/nsc/NoPhase.scala b/src/compiler/scala/tools/nsc/NoPhase.scala index a6907ddf58..8f5e3e440c 100644 --- a/src/compiler/scala/tools/nsc/NoPhase.scala +++ b/src/compiler/scala/tools/nsc/NoPhase.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/ObjectRunner.scala b/src/compiler/scala/tools/nsc/ObjectRunner.scala index 210f9a1785..f2ddc84445 100644 --- a/src/compiler/scala/tools/nsc/ObjectRunner.scala +++ b/src/compiler/scala/tools/nsc/ObjectRunner.scala @@ -3,7 +3,6 @@ * @author Lex Spoon */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala b/src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala index b011f88f2b..ae56941633 100644 --- a/src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala +++ b/src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/Phase.scala b/src/compiler/scala/tools/nsc/Phase.scala index 98f0f840ff..882b96d84d 100644 --- a/src/compiler/scala/tools/nsc/Phase.scala +++ b/src/compiler/scala/tools/nsc/Phase.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/PhaseAssembly.scala b/src/compiler/scala/tools/nsc/PhaseAssembly.scala index b3300a1ff9..e0cc91cb80 100644 --- a/src/compiler/scala/tools/nsc/PhaseAssembly.scala +++ b/src/compiler/scala/tools/nsc/PhaseAssembly.scala @@ -3,7 +3,6 @@ * @author Anders Bach Nielsen * @version 1.0 */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/Properties.scala b/src/compiler/scala/tools/nsc/Properties.scala index 4601a1ca64..4d488e65cf 100644 --- a/src/compiler/scala/tools/nsc/Properties.scala +++ b/src/compiler/scala/tools/nsc/Properties.scala @@ -3,7 +3,6 @@ * @author Stephane Micheloud */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/ScalaDoc.scala b/src/compiler/scala/tools/nsc/ScalaDoc.scala index b7e416e121..b539b800b3 100644 --- a/src/compiler/scala/tools/nsc/ScalaDoc.scala +++ b/src/compiler/scala/tools/nsc/ScalaDoc.scala @@ -3,7 +3,6 @@ * @author Martin Odersky * @author Geoffrey Washburn */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala index a096efb749..a7d67a3af9 100644 --- a/src/compiler/scala/tools/nsc/ScriptRunner.scala +++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -17,11 +16,9 @@ import io.{ Directory, File, Path, PlainFile } import java.lang.reflect.InvocationTargetException import java.net.URL import java.util.jar.{ JarEntry, JarOutputStream } -import java.util.regex.Pattern import scala.tools.util.PathResolver import scala.tools.nsc.reporters.{Reporter,ConsoleReporter} -import scala.tools.nsc.util.{ClassPath, CompoundSourceFile, BatchSourceFile, SourceFile, SourceFileFragment} /** An object that runs Scala code in script files. * @@ -49,8 +46,7 @@ import scala.tools.nsc.util.{ClassPath, CompoundSourceFile, BatchSourceFile, Sou * @todo It would be better if error output went to stderr instead * of stdout... */ -object ScriptRunner -{ +object ScriptRunner { /* While I'm chasing down the fsc and script bugs. */ def DBG(msg: Any) { System.err.println(msg.toString) @@ -69,6 +65,8 @@ object ScriptRunner case x => x } + def isScript(settings: Settings) = settings.script.value != "" + /** Choose a jar filename to hold the compiled version of a script. */ private def jarFileFor(scriptFile: String): File = { val name = @@ -119,22 +117,6 @@ object ScriptRunner /** Read the entire contents of a file as a String. */ private def contentsOfFile(filename: String) = File(filename).slurp() - /** Find the length of the header in the specified file, if - * there is one. The header part starts with "#!" or "::#!" - * and ends with a line that begins with "!#" or "::!#". - */ - private def headerLength(filename: String): Int = { - val headerPattern = Pattern.compile("""^(::)?!#.*(\r|\n|\r\n)""", Pattern.MULTILINE) - val fileContents = contentsOfFile(filename) - def isValid = List("#!", "::#!") exists (fileContents startsWith _) - - if (!isValid) 0 else { - val matcher = headerPattern matcher fileContents - if (matcher.find) matcher.end - else throw new IOException("script file does not close its header with !# or ::!#") - } - } - /** Split a fully qualified object name into a * package and an unqualified object name */ private def splitObjectName(fullname: String): (Option[String], String) = @@ -143,48 +125,6 @@ object ScriptRunner case idx => (Some(fullname take idx), fullname drop (idx + 1)) } - /** Code that is added to the beginning of a script file to make - * it a complete Scala compilation unit. - */ - protected def preambleCode(objectName: String): String = { - val (maybePack, objName) = splitObjectName(objectName) - val packageDecl = maybePack map ("package %s\n" format _) getOrElse ("") - - return """| - | object %s { - | def main(argv: Array[String]): Unit = { - | val args = argv - | new AnyRef { - |""".stripMargin.format(objName) - } - - /** Code that is added to the end of a script file to make - * it a complete Scala compilation unit. - */ - val endCode = """ - | } - | } - | } - |""".stripMargin - - /** Wrap a script file into a runnable object named - * <code>scala.scripting.Main</code>. - */ - def wrappedScript( - objectName: String, - filename: String, - getSourceFile: PlainFile => BatchSourceFile): SourceFile = - { - val preamble = new BatchSourceFile("<script preamble>", preambleCode(objectName).toCharArray) - val middle = { - val bsf = getSourceFile(PlainFile fromPath filename) - new SourceFileFragment(bsf, headerLength(filename), bsf.length) - } - val end = new BatchSourceFile("<script trailer>", endCode.toCharArray) - - new CompoundSourceFile(preamble, middle, end) - } - /** Compile a script using the fsc compilation daemon. * * @param settings ... @@ -243,12 +183,15 @@ object ScriptRunner settings.outdir.value = compiledPath.path if (settings.nocompdaemon.value) { + /** Setting settings.script.value informs the compiler this is not a + * self contained compilation unit. + */ + settings.script.value = scriptMain(settings) val reporter = new ConsoleReporter(settings) val compiler = newGlobal(settings, reporter) val cr = new compiler.Run - val wrapped = wrappedScript(scriptMain(settings), scriptFile, compiler getSourceFile _) - cr compileSources List(wrapped) + cr compile List(scriptFile) if (reporter.hasErrors) None else Some(compiledPath) } else if (compileWithDaemon(settings, scriptFile)) Some(compiledPath) @@ -295,10 +238,7 @@ object ScriptRunner val classpath = pr.asURLs :+ File(compiledLocation).toURL try { - ObjectRunner.run( - classpath, - scriptMain(settings), - scriptArgs) + ObjectRunner.run(classpath, scriptMain(settings), scriptArgs) true } catch { diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index cd4626c0c6..8765ad3686 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/SubComponent.scala b/src/compiler/scala/tools/nsc/SubComponent.scala index 425f5e4aff..445021f22a 100644 --- a/src/compiler/scala/tools/nsc/SubComponent.scala +++ b/src/compiler/scala/tools/nsc/SubComponent.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index ddf4fb0a23..48c2536324 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id: Unapplies.scala 19206 2009-10-21 20:57:27Z extempore $ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/NodePrinters.scala b/src/compiler/scala/tools/nsc/ast/NodePrinters.scala index ccab6423cf..111bf48a45 100644 --- a/src/compiler/scala/tools/nsc/ast/NodePrinters.scala +++ b/src/compiler/scala/tools/nsc/ast/NodePrinters.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index e5a49f8358..0555f6c035 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala index fd13958053..34d3423401 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala @@ -7,6 +7,8 @@ package scala.tools.nsc package ast +import PartialFunction._ + /** A DSL for generating scala code. The goal is that the * code generating code should look a lot like the code it * generates. @@ -18,22 +20,20 @@ trait TreeDSL { import global._ import definitions._ import gen.{ scalaDot } - import PartialFunction._ object CODE { // Add a null check to a Tree => Tree function def nullSafe[T](f: Tree => Tree, ifNull: Tree): Tree => Tree = tree => IF (tree MEMBER_== NULL) THEN ifNull ELSE f(tree) - // Applies a function to a value and then returns the value. - def returning[T](f: T => Unit)(x: T): T = { f(x) ; x } - // strip bindings to find what lies beneath final def unbind(x: Tree): Tree = x match { case Bind(_, y) => unbind(y) case y => y } + def returning[T](x: T)(f: T => Unit): T = util.returning(x)(f) + object LIT extends (Any => Literal) { def apply(x: Any) = Literal(Constant(x)) def unapply(x: Any) = condOpt(x) { case Literal(Constant(value)) => value } @@ -93,6 +93,7 @@ trait TreeDSL { def INT_| (other: Tree) = fn(target, getMember(IntClass, nme.OR), other) def INT_& (other: Tree) = fn(target, getMember(IntClass, nme.AND), other) + def INT_>= (other: Tree) = fn(target, getMember(IntClass, nme.GE), other) def INT_== (other: Tree) = fn(target, getMember(IntClass, nme.EQ), other) def INT_!= (other: Tree) = fn(target, getMember(IntClass, nme.NE), other) diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index cc3581c3f8..1327781d31 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala index 430967298c..f21b1b20ff 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala index cb899a2560..ddc1c3169a 100644 --- a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala +++ b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index b40f286680..8db6958d07 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast diff --git a/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala b/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala index e918489446..60df523d92 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Burak Emir */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 43e515d31e..182ae6c21c 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ //todo: allow infix type patterns @@ -10,7 +9,7 @@ package scala.tools.nsc package ast.parser import scala.collection.mutable.ListBuffer -import scala.tools.nsc.util.{OffsetPosition, BatchSourceFile} +import util.{ OffsetPosition, BatchSourceFile } import symtab.Flags import Tokens._ @@ -64,6 +63,13 @@ self => def this(unit: global.CompilationUnit) = this(unit, List()) + /** The parse starting point depends on whether the source file is self-contained: + * if not, the AST will be supplemented. + */ + def parseStartRule = + if (unit.source.isSelfContained) () => compilationUnit() + else () => scriptBody() + val in = new UnitScanner(unit, patches) in.init() @@ -170,14 +176,66 @@ self => */ var classContextBounds: List[Tree] = Nil - /** this is the general parse method + def parseStartRule: () => Tree + + /** This is the general parse entry point. */ def parse(): Tree = { - val t = compilationUnit() + val t = parseStartRule() accept(EOF) t } + /** This is the parse entry point for code which is not self-contained, e.g. + * a script which is a series of template statements. They will be + * swaddled in Trees until the AST is equivalent to the one returned + * by compilationUnit(). + */ + def scriptBody(): Tree = { + val stmts = templateStatSeq(false)._2 + accept(EOF) + + /** Here we are building an AST representing the following source fiction, + * where <moduleName> is from -Xscript (defaults to "Main") and <stmts> are + * the result of parsing the script file. + * + * object <moduleName> { + * def main(argv: Array[String]): Unit = { + * val args = argv + * new AnyRef { + * <stmts> + * } + * } + * } + */ + import definitions._ + + def emptyPkg = atPos(0, 0, 0) { Ident(nme.EMPTY_PACKAGE_NAME) } + def emptyInit = DefDef( + NoMods, + nme.CONSTRUCTOR, + Nil, + List(Nil), + TypeTree(), + Block(List(Apply(Select(Super("", ""), nme.CONSTRUCTOR), Nil)), Literal(Constant(()))) + ) + + // def main + def mainParamType = AppliedTypeTree(Ident("Array".toTypeName), List(Ident("String".toTypeName))) + def mainParameter = List(ValDef(Modifiers(Flags.PARAM), "argv", mainParamType, EmptyTree)) + def mainSetArgv = List(ValDef(NoMods, "args", TypeTree(), Ident("argv"))) + def mainNew = makeNew(Nil, emptyValDef, stmts, List(Nil), NoPosition, NoPosition) + def mainDef = DefDef(NoMods, "main", Nil, List(mainParameter), scalaDot(nme.Unit.toTypeName), Block(mainSetArgv, mainNew)) + + // object Main + def moduleName = ScriptRunner scriptMain settings + def moduleBody = Template(List(scalaScalaObjectConstr), emptyValDef, List(emptyInit, mainDef)) + def moduleDef = ModuleDef(NoMods, moduleName, moduleBody) + + // package <empty> { ... } + makePackaging(0, emptyPkg, List(moduleDef)) + } + /* --------------- PLACEHOLDERS ------------------------------------------- */ /** The implicit parameters introduced by `_' in the current expression. @@ -1407,7 +1465,7 @@ self => else accept(LARROW) val rhs = expr() enums += makeGenerator(r2p(start, point, in.lastOffset), pat, tok == EQUALS, rhs) - if (in.token == IF) enums += makeFilter(in.offset, guard()) + while (in.token == IF) enums += makeFilter(in.offset, guard()) } def makeFilter(start: Int, tree: Tree) = Filter(r2p(start, tree.pos.point, tree.pos.endOrPoint), tree) @@ -1487,7 +1545,9 @@ self => def pattern3(seqOK: Boolean): Tree = { val base = opstack var top = simplePattern(seqOK) - if (seqOK && isIdent && in.name == STAR) + // See ticket #3189 for the motivation for the null check. + // TODO: dredge out the remnants of regexp patterns. + if (seqOK && isIdent && in.name == STAR && in.prev.name != null) return atPos(top.pos.startOrPoint, in.skipToken())(Star(stripParens(top))) while (isIdent && in.name != BAR) { @@ -1727,8 +1787,11 @@ self => mods = mods withPosition (in.token, tokenRange(in)) mods |= Flags.MUTABLE in.nextToken() - } else if (!caseParam) { - mods |= Flags.PRIVATE | Flags.LOCAL + } else { + if (mods.flags != Flags.PARAMACCESSOR) accept(VAL) + if (!caseParam) { + mods |= Flags.PRIVATE | Flags.LOCAL + } } if (caseParam) { mods |= Flags.CASEACCESSOR diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index eeb3fb6e7a..5e9cc3f46e 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala index 049c8aa2ff..86c79eb733 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Burak Emir */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala b/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala index fb97587ec4..b3c3c7dfe9 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala index 2146fa0fe6..00347c3a9e 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index bea52b1153..9f20a70de5 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package ast.parser diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala index b95e3335ba..0af482912d 100644 --- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala +++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/WorklistAlgorithm.scala b/src/compiler/scala/tools/nsc/backend/WorklistAlgorithm.scala index 1cb5cfb051..27f5b27303 100644 --- a/src/compiler/scala/tools/nsc/backend/WorklistAlgorithm.scala +++ b/src/compiler/scala/tools/nsc/backend/WorklistAlgorithm.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala index e5afa84c82..bab3652f69 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/CheckerException.scala b/src/compiler/scala/tools/nsc/backend/icode/CheckerException.scala index 9d102eef28..a2ba0554da 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/CheckerException.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/CheckerException.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala b/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala index c34cefdc12..6067dc6e42 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Checkers.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/ExceptionHandlers.scala b/src/compiler/scala/tools/nsc/backend/icode/ExceptionHandlers.scala index 8168cc2c6e..e5b94076e8 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/ExceptionHandlers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/ExceptionHandlers.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index b357dff25a..9136bffcda 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/ICodes.scala b/src/compiler/scala/tools/nsc/backend/icode/ICodes.scala index 0810a64f5d..dc90a438b9 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/ICodes.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/ICodes.scala @@ -7,7 +7,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala index d090454129..701e5d3815 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Members.scala b/src/compiler/scala/tools/nsc/backend/icode/Members.scala index 82e99d50ac..95cd15711b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Members.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Members.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala index c0255cda65..ed76e66aa0 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Opcodes.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/backend/icode/Primitives.scala b/src/compiler/scala/tools/nsc/backend/icode/Primitives.scala index 826ecc18ec..8624bb5aff 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Primitives.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Primitives.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Printers.scala b/src/compiler/scala/tools/nsc/backend/icode/Printers.scala index 0c81759c18..9aaeeb2e8b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Printers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Printers.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/Repository.scala b/src/compiler/scala/tools/nsc/backend/icode/Repository.scala index 5d08b40557..78a47e129c 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Repository.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Repository.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index 4b53a5e2ae..65a5291f36 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeStacks.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeStacks.scala index 6872f56c39..d334af525f 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeStacks.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeStacks.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/CompleteLattice.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/CompleteLattice.scala index 95f4418759..4efefe89f9 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/CompleteLattice.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/CompleteLattice.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala index 1fbbc10c3d..289fae6fe3 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala index df3dd1a060..39405cd84e 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala index 46771feeee..101bb81503 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/LubException.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/LubException.scala index 0474d12a8b..6cdee7ef4b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/LubException.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/LubException.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/ProgramPoint.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/ProgramPoint.scala index e875ced036..a9a09a71a0 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/ProgramPoint.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/ProgramPoint.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala index 3aa0ddfdbf..f3dd6dd93b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis 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 858512c9b1..9b145c9fbc 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package backend.icode.analysis diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 2b4878a93b..21d1246cc4 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -3,7 +3,6 @@ * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package backend.jvm @@ -815,7 +814,10 @@ abstract class GenJVM extends SubComponent { import JAccessFlags._ val moduleName = javaName(module) // + "$" val mirrorName = moduleName.substring(0, moduleName.length() - 1) - val paramJavaTypes = m.info.paramTypes map toTypeKind + + val methodInfo = module.thisType.memberInfo(m) + + val paramJavaTypes = methodInfo.paramTypes map toTypeKind val paramNames: Array[String] = new Array[String](paramJavaTypes.length); for (i <- 0 until paramJavaTypes.length) @@ -823,7 +825,7 @@ abstract class GenJVM extends SubComponent { val mirrorMethod = jclass.addNewMethod(ACC_PUBLIC | ACC_FINAL | ACC_STATIC, javaName(m), - javaType(m.info.resultType), + javaType(methodInfo.resultType), javaTypes(paramJavaTypes), paramNames); val mirrorCode = mirrorMethod.getCode().asInstanceOf[JExtendedCode]; @@ -839,7 +841,7 @@ abstract class GenJVM extends SubComponent { i += 1 } - mirrorCode.emitINVOKEVIRTUAL(moduleName, mirrorMethod.getName(), mirrorMethod.getType().asInstanceOf[JMethodType]) + mirrorCode.emitINVOKEVIRTUAL(moduleName, mirrorMethod.getName(), javaType(m).asInstanceOf[JMethodType]) mirrorCode.emitRETURN(mirrorMethod.getReturnType()) addRemoteException(mirrorMethod, m) @@ -1701,7 +1703,7 @@ abstract class GenJVM extends SubComponent { def indexOf(local: Local): Int = { assert(local.index >= 0, - "Invalid index for: " + local + "{" + local.hashCode + "}: ") + "Invalid index for: " + local + "{" + local.## + "}: ") local.index } @@ -1716,7 +1718,7 @@ abstract class GenJVM extends SubComponent { for (l <- m.locals) { if (settings.debug.value) - log("Index value for " + l + "{" + l.hashCode + "}: " + idx) + log("Index value for " + l + "{" + l.## + "}: " + idx) l.index = idx idx += sizeOf(l.kind) } diff --git a/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala b/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala index 554dcd4e6d..92ba50e88e 100644 --- a/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala +++ b/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala @@ -3,7 +3,6 @@ * @author Nikolay Mihaylov */ -// $Id$ package scala.tools.nsc package backend.msil diff --git a/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala b/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala index fedf0d4143..9470078507 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala @@ -3,7 +3,6 @@ * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package backend.opt; diff --git a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala index 29d0c37c84..e365b3bc08 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala @@ -3,7 +3,6 @@ * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package backend.opt diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala index dc1ac8e844..9c1489a637 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala @@ -3,7 +3,6 @@ * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package backend.opt @@ -444,6 +443,15 @@ abstract class Inliners extends SubComponent { case Some(b) => callsNonPublic = b case None => + // Avoiding crashing the compiler if there are open blocks. + callee.code.blocks filterNot (_.closed) foreach { b => + currentIClazz.cunit.warning(callee.symbol.pos, + "Encountered open block in isSafeToInline: this indicates a bug in the optimizer!\n" + + " caller = " + caller + ", callee = " + callee + ) + return false + } + breakable { for (b <- callee.code.blocks; i <- b) i match { diff --git a/src/compiler/scala/tools/nsc/doc/DocFactory.scala b/src/compiler/scala/tools/nsc/doc/DocFactory.scala index 7fd6538566..42aab918f7 100644 --- a/src/compiler/scala/tools/nsc/doc/DocFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/DocFactory.scala @@ -1,6 +1,5 @@ /* NSC -- new Scala compiler -- Copyright 2007-2010 LAMP/EPFL */ -// $Id$ package scala.tools.nsc package doc diff --git a/src/compiler/scala/tools/nsc/doc/Settings.scala b/src/compiler/scala/tools/nsc/doc/Settings.scala index 4897d78488..f3fe8c384b 100644 --- a/src/compiler/scala/tools/nsc/doc/Settings.scala +++ b/src/compiler/scala/tools/nsc/doc/Settings.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package doc diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala index 31b932ac53..66e2ba2260 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala @@ -10,7 +10,7 @@ package html import model._ import comment._ -import xml.{Unparsed, XML, NodeSeq} +import xml.{XML, NodeSeq} import xml.dtd.{DocType, PublicID} import scala.collection._ import scala.reflect.NameTransformer @@ -128,12 +128,12 @@ abstract class HtmlPage { thisPage => body.blocks flatMap (blockToHtml(_)) def blockToHtml(block: Block): NodeSeq = block match { - case Title(in, 1) => <h1>{ inlineToHtml(in) }</h1> - case Title(in, 2) => <h2>{ inlineToHtml(in) }</h2> - case Title(in, 3) => <h3>{ inlineToHtml(in) }</h3> - case Title(in, _) => <h4>{ inlineToHtml(in) }</h4> + case Title(in, 1) => <h3>{ inlineToHtml(in) }</h3> + case Title(in, 2) => <h4>{ inlineToHtml(in) }</h4> + case Title(in, 3) => <h5>{ inlineToHtml(in) }</h5> + case Title(in, _) => <h6>{ inlineToHtml(in) }</h6> case Paragraph(in) => <p>{ inlineToHtml(in) }</p> - case Code(data) => <pre>{ Unparsed(data) }</pre> + case Code(data) => <pre>{ xml.Text(data) }</pre> case UnorderedList(items) => <ul>{ listItemsToHtml(items) }</ul> case OrderedList(items, listStyle) => @@ -165,9 +165,10 @@ abstract class HtmlPage { thisPage => case Subscript(in) => <sub>{ inlineToHtml(in) }</sub> case Link(raw, title) => <a href={ raw }>{ inlineToHtml(title) }</a> case EntityLink(entity) => templateToHtml(entity) - case Monospace(text) => <code>{ Unparsed(text) }</code> - case Text(text) => Unparsed(text) + case Monospace(text) => <code>{ xml.Text(text) }</code> + case Text(text) => xml.Text(text) case Summary(in) => inlineToHtml(in) + case HtmlTag(tag) => xml.Unparsed(tag) } def typeToHtml(tpe: model.TypeEntity, hasLinks: Boolean): NodeSeq = { diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css index 92de97f619..0c17d9fa2a 100644 --- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css +++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css @@ -81,6 +81,7 @@ a:hover { } #comment { + padding-right: 8px; padding-left: 8px; } @@ -193,17 +194,56 @@ div.members > ol > li { .cmt {} .cmt p { - margin: 2px 0 2px 0; + margin-bottom: 0.4em; + margin-top: 0.4em; } -.cmt code { - font-family: monospace; +.cmt h3 { + margin-bottom: 1em; + margin-top: 1em; + display: block; + text-align: left; + font-weight: bold; + font-size: x-large; +} + +.cmt h4 { + margin-bottom: 0.6em; + margin-top: 0.6em; + display: block; + text-align: left; + font-weight: bold; + font-size: large; +} + +.cmt h5 { + margin-bottom: 0.4em; + margin-top: 0.4em; + display: block; + text-align: left; + font-weight: bold; +} + +.cmt h6 { + margin-bottom: 0.4em; + margin-top: 0.4em; + display: block; + text-align: left; + font-style: italic; } .cmt pre { + padding: 0.4em; + border-color: #ddd; + border-style: solid; + border-width: 1px; + margin-left: 0; + margin-bottom: 0.4em; + margin-right: 0; + margin-top: 0.4em; + background-color: #eee; display: block; font-family: monospace; - margin: 2px 0 2px 0; } .cmt ul { @@ -241,20 +281,24 @@ div.members > ol > li { display:list-item; } +.cmt code { + font-family: monospace; +} + .cmt a { - text-decoration: underline; + font-style: bold; } /* Comments structured layout */ p.comment { display: block; - margin-left: 8.7em; + margin-left: 8.7em; } p.shortcomment { display: block; - margin-left: 8.7em; + margin-left: 8.7em; cursor: help; } @@ -264,7 +308,7 @@ div.fullcomment { } #template div.fullcomment { - margin: 6px 0 6px 8.7em; + margin: 6px 0 6px 8.7em; } div.fullcomment .block { diff --git a/src/compiler/scala/tools/nsc/doc/model/comment/Body.scala b/src/compiler/scala/tools/nsc/doc/model/comment/Body.scala index 29e47fa578..255c61095e 100644 --- a/src/compiler/scala/tools/nsc/doc/model/comment/Body.scala +++ b/src/compiler/scala/tools/nsc/doc/model/comment/Body.scala @@ -67,6 +67,7 @@ final case class Link(target: String, title: Inline) extends Inline final case class EntityLink(target: TemplateEntity) extends Inline final case class Monospace(text: String) extends Inline final case class Text(text: String) extends Inline +final case class HtmlTag(data: String) extends Inline /** The summary of a comment, usually its first sentence. There must be exactly one summary per body. */ final case class Summary(text: Inline) extends Inline 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 f067555cc3..475fbf584e 100644 --- a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala @@ -57,21 +57,31 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => new Regex("""(?:\s*\*\s?)?(.*)""") /** Dangerous HTML tags that should be replaced by something safer, such as wiki syntax, or that should be dropped. */ - protected val DangerousHtml = - new Regex("""<(/?(?:p|div|pre|ol|ul|li|h[1-6]|code))[^>]*>""") + protected val DangerousTags = + new Regex("""<(/?(div|ol|ul|li|h[1-6]|p))( [^>]*)?/?>|<!--.*-->""") /** Maps a dangerous HTML tag to a safe wiki replacement, or an empty string if it cannot be salvaged. */ - protected def htmlReplacement(mtch: Regex.Match): String = mtch.matched match { + protected def htmlReplacement(mtch: Regex.Match): String = mtch.group(1) match { case "p" | "div" => "\n\n" - case "h1" | "h2" | "h3" | "h4" | "h5" | "h6" => "\n= " - case "/h1" | "/h2" | "/h3" | "/h4" | "/h5" | "/h6" => " =\n" - case "pre" => "{{{" - case "/pre" => "}}}" + case "h1" => "\n= " + case "/h1" => " =\n" + case "h2" => "\n== " + case "/h2" => " ==\n" + case "h3" => "\n=== " + case "/h3" => " ===\n" + case "h4" | "h5" | "h6" => "\n==== " + case "/h4" | "/h5" | "/h6" => " ====\n" case "code" | "/code" => "`" - case "li" => "\n - " + case "li" => "\n * - " case _ => "" } + /** Safe HTML tags that can be kept. */ + protected val SafeTags = + new Regex("""(</?(abbr|acronym|address|area|a|bdo|big|blockquote|br|button|b|caption|code|cite|col|colgroup|dd|del|dfn|em|fieldset|form|hr|img|input|ins|i|kbd|label|legend|link|map|object|optgroup|option|param|pre|q|samp|select|small|span|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|tr|tt|var)( [^>]*)?/?>)""") + + protected val safeTagMarker = '\u000E' + /** A Scaladoc tag not linked to a symbol. Returns the name of the tag, and the rest of the line. */ protected val SimpleTag = new Regex("""\s*@(\S+)\s+(.*)""") @@ -114,8 +124,12 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => } } val strippedComment = comment.trim.stripPrefix("/*").stripSuffix("*/") - val safeComment = DangerousHtml.replaceAllIn(strippedComment, { htmlReplacement(_) }) - safeComment.lines.toList map (cleanLine(_)) + val safeComment = DangerousTags.replaceAllIn(strippedComment, { htmlReplacement(_) }) + val markedTagComment = + SafeTags.replaceAllIn(safeComment, { mtch => + java.util.regex.Matcher.quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker) + }) + markedTagComment.lines.toList map (cleanLine(_)) } /** Parses a comment (in the form of a list of lines) to a Comment instance, recursively on lines. To do so, it @@ -251,17 +265,6 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => var summaryParsed = false - /** listStyle ::= '-' spc | '1.' spc | 'I.' spc | 'i.' spc | 'A.' spc | 'a.' spc - * Characters used to build lists and their constructors */ - protected val listStyles = Map[String, (Seq[Block] => Block)]( // TODO Should this be defined at some list companion? - "- " -> ( UnorderedList(_) ), - "1. " -> ( OrderedList(_,"decimal") ), - "I. " -> ( OrderedList(_,"upperRoman") ), - "i. " -> ( OrderedList(_,"lowerRoman") ), - "A. " -> ( OrderedList(_,"upperAlpha") ), - "a. " -> ( OrderedList(_,"lowerAlpha") ) - ) - def document(): Body = { nextChar() val blocks = new mutable.ListBuffer[Block] @@ -287,9 +290,20 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => } } + /** listStyle ::= '-' spc | '1.' spc | 'I.' spc | 'i.' spc | 'A.' spc | 'a.' spc + * Characters used to build lists and their constructors */ + protected val listStyles = Map[String, (Seq[Block] => Block)]( // TODO Should this be defined at some list companion? + "- " -> ( UnorderedList(_) ), + "1. " -> ( OrderedList(_,"decimal") ), + "I. " -> ( OrderedList(_,"upperRoman") ), + "i. " -> ( OrderedList(_,"lowerRoman") ), + "A. " -> ( OrderedList(_,"upperAlpha") ), + "a. " -> ( OrderedList(_,"lowerAlpha") ) + ) + /** Checks if the current line is formed with more than one space and one the listStyles */ def checkList = - countWhitespace > 0 && listStyles.keysIterator.indexWhere(checkSkipInitWhitespace(_)) >= 0 + (countWhitespace > 0) && (listStyles.keys exists { checkSkipInitWhitespace(_) }) /** {{{ * nListBlock ::= nLine { mListBlock } @@ -297,42 +311,39 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => * }}} * Where n and m stand for the number of spaces. When m > n, a new list is nested. */ def listBlock: Block = { - /** consumes one line of a list block */ - def listLine(indentedListStyle: String): Block = { - // deals with mixed lists in the same nesting level by skipping it - if(!jump(indentedListStyle)) { // TODO show warning when jump is false - nextChar(); - nextChar() - } - val p = Paragraph(inline(check(Array(endOfLine)))) - blockEnded("end of list line ") - p - } - def listLevel(leftSide: String, listStyle: String, constructor: (Seq[Block] => Block)): Block = { - val blocks = mutable.ListBuffer.empty[Block] - val length = leftSide.length - val indentedListStyle = leftSide + listStyle - - var index = 1 - var line = listLine(indentedListStyle) - - while (index > -1) { - blocks += line - if (countWhitespace > length) { // nesting-in - blocks += listBlock // TODO is tailrec really needed here? - } - index = listStyles.keysIterator.indexWhere(x => check(leftSide)) - if (index > -1) { line = listLine(indentedListStyle) } + + /** Consumes one list item block and returns it, or None if the block is not a list or a different list. */ + def listLine(indent: Int, style: String): Option[Block] = + if (countWhitespace > indent && checkList) + Some(listBlock) + else if (countWhitespace != indent || !checkSkipInitWhitespace(style)) + None + else { + jumpWhitespace() + jump(style) + val p = Paragraph(inline(false)) + blockEnded("end of list line ") + Some(p) } - constructor(blocks) + /** Consumes all list item blocks (possibly with nested lists) of the same list and returns the list block. */ + def listLevel(indent: Int, style: String): Block = { + val lines = mutable.ListBuffer.empty[Block] + var line: Option[Block] = listLine(indent, style) + while (line.isDefined) { + lines += line.get + line = listLine(indent, style) + } + val constructor = listStyles(style) + constructor(lines) } - val indentation = countWhitespace - val indentStr = " " * indentation - val style = listStyles.keysIterator.find( x => check(indentStr + x) ).getOrElse(listStyles.keysIterator.next) - val constructor = listStyles(style) - listLevel(indentStr, style, constructor) + + val indent = countWhitespace + val style = (listStyles.keys find { checkSkipInitWhitespace(_) }).getOrElse(listStyles.keys.head) + listLevel(indent, style) + } + def code(): Block = { jumpWhitespace() jump("{{{") @@ -387,7 +398,8 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => def inline(isInlineEnd: => Boolean): Inline = { def inline0(): Inline = { - if (check("'''")) bold() + if (char == safeTagMarker) htmlTag() + else if (check("'''")) bold() else if (check("''")) italic() else if (check("`")) monospace() else if (check("__")) underline() @@ -395,7 +407,7 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => else if (check(",,")) subscript() else if (check("[[")) link() else { - readUntil { check("''") || char == '`' || check("__") || char == '^' || check(",,") || check("[[") || isInlineEnd || checkParaEnded || char == endOfLine } + readUntil { char == safeTagMarker || check("''") || char == '`' || check("__") || char == '^' || check(",,") || check("[[") || isInlineEnd || checkParaEnded || char == endOfLine } Text(getRead()) } } @@ -423,6 +435,14 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => } + def htmlTag(): Inline = { + jump(safeTagMarker) + readUntil(safeTagMarker) + if (char != endOfText) jump(safeTagMarker) + var read = getRead + HtmlTag(read) + } + def bold(): Inline = { jump("'''") val i = inline(check("'''")) @@ -530,7 +550,7 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => checkSkipInitWhitespace(Array(endOfLine)) || checkSkipInitWhitespace(Array('=')) || checkSkipInitWhitespace(Array('{', '{', '{')) || - checkSkipInitWhitespace(Array(' ', '-', ' ')) || + checkList || checkSkipInitWhitespace(Array('\u003D')) } offset = poff @@ -606,10 +626,18 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory => /* JUMPERS */ - /** jumps all the characters in chars - * @return true only if the correct characters have been jumped - * consumes any matching characters - */ + /** jumps a character and consumes it + * @return true only if the correct character has been jumped */ + final def jump(ch: Char): Boolean = { + if (char == ch) { + nextChar() + true + } + else false + } + + /** jumps all the characters in chars, consuming them in the process. + * @return true only if the correct characters have been jumped */ final def jump(chars: Array[Char]): Boolean = { var index = 0 while (index < chars.length && char == chars(index) && char != endOfText) { diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 03fd92235d..2c174860e4 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -7,7 +7,7 @@ import scala.collection.mutable.{LinkedHashMap, SynchronizedMap} import scala.concurrent.SyncVar import scala.util.control.ControlThrowable import scala.tools.nsc.io.AbstractFile -import scala.tools.nsc.util.{SourceFile, Position, RangePosition, OffsetPosition, NoPosition, WorkScheduler} +import scala.tools.nsc.util.{SourceFile, Position, RangePosition, NoPosition, WorkScheduler} import scala.tools.nsc.reporters._ import scala.tools.nsc.symtab._ import scala.tools.nsc.ast._ diff --git a/src/compiler/scala/tools/nsc/interactive/RangePositions.scala b/src/compiler/scala/tools/nsc/interactive/RangePositions.scala index 337f306664..6ef85b2f59 100644 --- a/src/compiler/scala/tools/nsc/interactive/RangePositions.scala +++ b/src/compiler/scala/tools/nsc/interactive/RangePositions.scala @@ -3,7 +3,7 @@ package interactive import ast.Trees import symtab.Positions -import scala.tools.nsc.util.{SourceFile, Position, RangePosition, OffsetPosition, NoPosition, WorkScheduler} +import scala.tools.nsc.util.{SourceFile, Position, RangePosition, NoPosition, WorkScheduler} import scala.collection.mutable.ListBuffer /** Handling range positions diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala index 7c977c6e60..bde90bc347 100644 --- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala +++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package interactive diff --git a/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala b/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala index c821b9ed80..0c3d24d46f 100644 --- a/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala +++ b/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala @@ -1,7 +1,6 @@ /* NSC -- new Scala compiler * Copyright 2005-2010 LAMP/EPFL */ -// $Id$ package scala.tools.nsc package interpreter diff --git a/src/compiler/scala/tools/nsc/interpreter/Completion.scala b/src/compiler/scala/tools/nsc/interpreter/Completion.scala index fddb1ee928..58ce85f1f6 100644 --- a/src/compiler/scala/tools/nsc/interpreter/Completion.scala +++ b/src/compiler/scala/tools/nsc/interpreter/Completion.scala @@ -9,6 +9,7 @@ package interpreter import jline._ import java.util.{ List => JList } +import util.returning object Completion { def looksLikeInvocation(code: String) = ( @@ -166,7 +167,19 @@ class Completion(val repl: Interpreter) extends CompletionOutput { override def follow(id: String) = if (completions(0) contains id) { for (clazz <- repl clazzForIdent id) yield { - (typeOf(clazz.getName) map TypeMemberCompletion.apply) getOrElse new InstanceCompletion(clazz) + // XXX The isMemberClass check is a workaround for the crasher described + // in the comments of #3431. The issue as described by iulian is: + // + // Inner classes exist as symbols + // inside their enclosing class, but also inside their package, with a mangled + // name (A$B). The mangled names should never be loaded, and exist only for the + // optimizer, which sometimes cannot get the right symbol, but it doesn't care + // and loads the bytecode anyway. + // + // So this solution is incorrect, but in the short term the simple fix is + // to skip the compiler any time completion is requested on a nested class. + if (clazz.isMemberClass) new InstanceCompletion(clazz) + else (typeOf(clazz.getName) map TypeMemberCompletion.apply) getOrElse new InstanceCompletion(clazz) } } else None diff --git a/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala b/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala index b3957e1062..92df6a8736 100644 --- a/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala +++ b/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stepan Koltsov */ -// $Id$ package scala.tools.nsc package interpreter diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala index 34367eacea..ab11a53d43 100644 --- a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala +++ b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stepan Koltsov */ -// $Id$ package scala.tools.nsc package interpreter diff --git a/src/compiler/scala/tools/nsc/interpreter/Parsed.scala b/src/compiler/scala/tools/nsc/interpreter/Parsed.scala index 0b92608d88..84f5477c21 100644 --- a/src/compiler/scala/tools/nsc/interpreter/Parsed.scala +++ b/src/compiler/scala/tools/nsc/interpreter/Parsed.scala @@ -7,6 +7,7 @@ package scala.tools.nsc package interpreter import jline.ArgumentCompletor.{ ArgumentDelimiter, ArgumentList } +import util.returning /** One instance of a command buffer. */ diff --git a/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala b/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala index 9d604ab8b3..c350468c3b 100644 --- a/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala +++ b/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stepan Koltsov */ -// $Id$ package scala.tools.nsc package interpreter diff --git a/src/compiler/scala/tools/nsc/interpreter/package.scala b/src/compiler/scala/tools/nsc/interpreter/package.scala index 2ded3a7900..eaf736c5b7 100644 --- a/src/compiler/scala/tools/nsc/interpreter/package.scala +++ b/src/compiler/scala/tools/nsc/interpreter/package.scala @@ -6,9 +6,6 @@ package scala.tools.nsc package object interpreter { - /** Apply a function and return the passed value */ - def returning[T](x: T)(f: T => Unit): T = { f(x) ; x } - /** Tracing */ def tracing[T](msg: String)(x: T): T = { println("(" + msg + ") " + x) ; x } @@ -18,6 +15,14 @@ package object interpreter { /** null becomes "", otherwise identity */ def onull(s: String) = if (s == null) "" else s + /** Heuristically strip interpreter wrapper prefixes + * from an interpreter output string. + */ + def stripWrapperGunk(str: String): String = { + val wrapregex = """(line[0-9]+\$object[$.])?(\$iw[$.])*""" + str.replaceAll(wrapregex, "") + } + /** Class objects */ def classForName(name: String): Option[Class[_]] = try Some(Class forName name) diff --git a/src/compiler/scala/tools/nsc/io/AbstractFile.scala b/src/compiler/scala/tools/nsc/io/AbstractFile.scala index 079b33c2a2..5d4f7b8464 100644 --- a/src/compiler/scala/tools/nsc/io/AbstractFile.scala +++ b/src/compiler/scala/tools/nsc/io/AbstractFile.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -231,7 +230,7 @@ abstract class AbstractFile extends AnyRef with Iterable[AbstractFile] { * creating an empty file if it does not already existing. */ def fileNamed(name: String): AbstractFile = { - assert(isDirectory) + assert(isDirectory, "Tried to find '%s' in '%s' but it is not a directory".format(name, path)) Option(lookupName(name, false)) getOrElse new PlainFile((sfile.get / name).createFile()) } @@ -240,7 +239,7 @@ abstract class AbstractFile extends AnyRef with Iterable[AbstractFile] { * does not already exist. */ def subdirectoryNamed(name: String): AbstractFile = { - assert (isDirectory) + assert (isDirectory, "Tried to find '%s' in '%s' but it is not a directory".format(name, path)) Option(lookupName(name, true)) getOrElse new PlainFile((sfile.get / name).createDirectory()) } diff --git a/src/compiler/scala/tools/nsc/io/File.scala b/src/compiler/scala/tools/nsc/io/File.scala index 66a0da3a0f..fb7170b3b3 100644 --- a/src/compiler/scala/tools/nsc/io/File.scala +++ b/src/compiler/scala/tools/nsc/io/File.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.nsc package io diff --git a/src/compiler/scala/tools/nsc/io/FileOperationException.scala b/src/compiler/scala/tools/nsc/io/FileOperationException.scala index a94b2c2ef2..2863a485df 100644 --- a/src/compiler/scala/tools/nsc/io/FileOperationException.scala +++ b/src/compiler/scala/tools/nsc/io/FileOperationException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.nsc package io diff --git a/src/compiler/scala/tools/nsc/io/PlainFile.scala b/src/compiler/scala/tools/nsc/io/PlainFile.scala index a40d01d1f5..9346e88bb2 100644 --- a/src/compiler/scala/tools/nsc/io/PlainFile.scala +++ b/src/compiler/scala/tools/nsc/io/PlainFile.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -11,8 +10,7 @@ package io import java.io.{ File => JFile, FileInputStream, FileOutputStream, IOException } import PartialFunction._ -object PlainFile -{ +object PlainFile { /** * If the specified File exists, returns an abstract file backed * by it. Otherwise, returns null. diff --git a/src/compiler/scala/tools/nsc/io/SourceReader.scala b/src/compiler/scala/tools/nsc/io/SourceReader.scala index ccd946d0b6..cc69c238b3 100644 --- a/src/compiler/scala/tools/nsc/io/SourceReader.scala +++ b/src/compiler/scala/tools/nsc/io/SourceReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/io/VirtualFile.scala b/src/compiler/scala/tools/nsc/io/VirtualFile.scala index 6e3ad7ead6..421e39195d 100644 --- a/src/compiler/scala/tools/nsc/io/VirtualFile.scala +++ b/src/compiler/scala/tools/nsc/io/VirtualFile.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -32,7 +31,7 @@ class VirtualFile(val name: String, _path: String) extends AbstractFile */ def this(name: String) = this(name, name) - override def hashCode = name.hashCode + override def hashCode = name.## override def equals(that: Any) = cond(that) { case x: VirtualFile => x.name == name } //######################################################################## diff --git a/src/compiler/scala/tools/nsc/io/ZipArchive.scala b/src/compiler/scala/tools/nsc/io/ZipArchive.scala index 4ee3a29671..4be11fc9a8 100644 --- a/src/compiler/scala/tools/nsc/io/ZipArchive.scala +++ b/src/compiler/scala/tools/nsc/io/ZipArchive.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index fe46e22654..0388df7005 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ //todo: allow infix type patterns diff --git a/src/compiler/scala/tools/nsc/javac/JavaTokens.scala b/src/compiler/scala/tools/nsc/javac/JavaTokens.scala index c91ecc95c2..eb64ffe062 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaTokens.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaTokens.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package javac diff --git a/src/compiler/scala/tools/nsc/matching/Matrix.scala b/src/compiler/scala/tools/nsc/matching/Matrix.scala index de3204318f..2c9d974d61 100644 --- a/src/compiler/scala/tools/nsc/matching/Matrix.scala +++ b/src/compiler/scala/tools/nsc/matching/Matrix.scala @@ -16,7 +16,7 @@ trait Matrix extends MatrixAdditions { import analyzer.Typer import CODE._ import Debug._ - import Flags.{ TRANS_FLAG } + import Flags.{ TRANS_FLAG, SYNTHETIC } /** Translation of match expressions. * @@ -201,7 +201,7 @@ trait Matrix extends MatrixAdditions { { val n: Name = if (name == null) newName(pos, "temp") else name // careful: pos has special meaning - owner.newVariable(pos, n) setInfo tpe setFlag (0L /: flags)(_|_) + owner.newVariable(pos, n) setInfo tpe setFlag (SYNTHETIC.toLong /: flags)(_|_) } def typedValDef(x: Symbol, rhs: Tree) = diff --git a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala index d3dddbfaaf..fbfe00d2c1 100644 --- a/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala +++ b/src/compiler/scala/tools/nsc/matching/MatrixAdditions.scala @@ -135,7 +135,7 @@ trait MatrixAdditions extends ast.TreeDSL } } - returning[Tree](resetTraverser traverse _)(lxtt transform tree) + returning(lxtt transform tree)(resetTraverser traverse _) } } diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index d4a920008f..f33f637a46 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -3,12 +3,10 @@ * Copyright 2007 Google Inc. All Rights Reserved. * Author: bqe@google.com (Burak Emir) */ -// $Id$ package scala.tools.nsc package matching -import util.Position import transform.ExplicitOuter import symtab.Flags import collection._ @@ -172,11 +170,7 @@ trait ParallelMatching extends ast.TreeDSL def tail = ps.tail def size = ps.length - def headType = head.necessaryType - def isCaseHead = head.isCaseClass - private val dummyCount = if (isCaseHead) headType.typeSymbol.caseFieldAccessors.length else 0 - def dummies = emptyPatterns(dummyCount) - // def dummies = head.dummies + def dummies = head.dummies def apply(i: Int): Pattern = ps(i) def pzip() = ps.zipWithIndex @@ -193,9 +187,10 @@ trait ParallelMatching extends ast.TreeDSL } } - object TypedUnapply { - def unapply(x: Tree): Option[Boolean] = condOpt(x) { - case Typed(UnapplyParamType(tpe), tpt) => !(tpt.tpe <:< tpe) + if (settings.Xmigration28.value) { + for (p <- ps ; if isArraySeqTest(scrut.tpe, p.tpe)) { + val reportPos = if (p.tree.pos.isDefined) p.tree.pos else scrut.pos + cunit.warning(reportPos, "An Array will no longer match as Seq[_].") } } @@ -203,7 +198,7 @@ trait ParallelMatching extends ast.TreeDSL tracing("Rule", head match { case x if isEquals(x.tree.tpe) => new MixEquals(this, rest) case x: SequencePattern => new MixSequence(this, rest, x) - case AnyUnapply(false) => new MixUnapply(this, rest, false) + case AnyUnapply(false) => new MixUnapply(this, rest) case _ => isPatternSwitch(scrut, ps) match { case Some(x) => new MixLiteralInts(x, rest) @@ -359,7 +354,7 @@ trait ParallelMatching extends ast.TreeDSL /** mixture rule for unapply pattern */ - class MixUnapply(val pmatch: PatternMatch, val rest: Rep, typeTest: Boolean) extends RuleApplication { + class MixUnapply(val pmatch: PatternMatch, val rest: Rep) extends RuleApplication { val uapattern = head match { case x: UnapplyPattern => x ; case _ => abort("XXX") } val ua @ UnApply(app, args) = head.tree @@ -444,32 +439,92 @@ trait ParallelMatching extends ast.TreeDSL * Note: pivot == head, just better typed. */ sealed class MixSequence(val pmatch: PatternMatch, val rest: Rep, pivot: SequencePattern) extends RuleApplication { + require(scrut.tpe <:< head.tpe) + def hasStar = pivot.hasStar - private def pivotLen = pivot.nonStarLength + private def pivotLen = pivot.nonStarLength + private def seqDummies = emptyPatterns(pivot.elems.length + 1) // one pattern var per sequence element up to elemCount, and one more for the rest of the sequence lazy val pvs = scrut createSequenceVars pivotLen - // divide the remaining rows into success/failure branches, expanding subsequences of patterns - private lazy val rowsplit = { - require(scrut.tpe <:< head.tpe) + // Should the given pattern join the expanded pivot in the success matrix? If so, + // this partial function will be defined for the pattern, and the result of the apply + // is the expanded sequence of new patterns. + lazy val successMatrixFn = new PartialFunction[Pattern, List[Pattern]] { + private def seqIsDefinedAt(x: SequenceLikePattern) = (hasStar, x.hasStar) match { + case (true, true) => true + case (true, false) => pivotLen <= x.nonStarLength + case (false, true) => pivotLen >= x.nonStarLength + case (false, false) => pivotLen == x.nonStarLength + } - val res = for ((c, rows) <- pmatch pzip rest.rows) yield { - def canSkip = pivot canSkipSubsequences c - def passthrough(skip: Boolean) = if (skip) None else Some(rows insert c) + def isDefinedAt(pat: Pattern) = pat match { + case x: SequenceLikePattern => seqIsDefinedAt(x) + case WildcardPattern() => true + case _ => false + } - pivot.subsequences(c, scrut.seqType) match { - case Some(ps) => (Some(rows insert ps), passthrough(canSkip)) - case None => (None, passthrough(false)) - } + def apply(pat: Pattern): List[Pattern] = pat match { + case x: SequenceLikePattern => + def isSameLength = pivotLen == x.nonStarLength + def rebound = x.nonStarPatterns :+ (x.elemPatterns.last rebindTo WILD(scrut.seqType)) + + (pivot.hasStar, x.hasStar, isSameLength) match { + case (true, true, true) => rebound :+ NoPattern + case (true, true, false) => (seqDummies drop 1) :+ x + case (true, false, true) => x.elemPatterns ++ List(NilPattern, NoPattern) + case (false, true, true) => rebound + case (false, false, true) => x.elemPatterns :+ NoPattern + case _ => seqDummies + } + + case _ => seqDummies } + } + + // Should the given pattern be in the fail matrix? This is true of any sequences + // as long as the result of the length test on the pivot doesn't make it impossible: + // for instance if neither sequence is right ignoring and they are of different + // lengths, the later one cannot match since its length must be wrong. + def failureMatrixFn(c: Pattern) = (pivot ne c) && (c match { + case x: SequenceLikePattern => + (hasStar, x.hasStar) match { + case (_, true) => true + case (true, false) => pivotLen > x.nonStarLength + case (false, false) => pivotLen != x.nonStarLength + } + case WildcardPattern() => true + case _ => false + }) - res.unzip match { case (l1, l2) => (l1.flatten, l2.flatten) } + // divide the remaining rows into success/failure branches, expanding subsequences of patterns + val successRows = pmatch pzip rest.rows collect { + case (c, row) if successMatrixFn isDefinedAt c => row insert successMatrixFn(c) } + val failRows = pmatch pzip rest.rows collect { + case (c, row) if failureMatrixFn(c) => row insert c + } + + // the discrimination test for sequences is a call to lengthCompare. Note that + // this logic must be fully consistent wiith successMatrixFn and failureMatrixFn above: + // any inconsistency will (and frequently has) manifested as pattern matcher crashes. + lazy val cond = { + // the method call symbol + val methodOp: Symbol = head.tpe member nme.lengthCompare + + // the comparison to perform. If the pivot is right ignoring, then a scrutinee sequence + // of >= pivot length could match it; otherwise it must be exactly equal. + val compareOp: (Tree, Tree) => Tree = if (hasStar) _ INT_>= _ else _ INT_== _ - lazy val cond = (pivot precondition pmatch).get // length check - lazy val success = squeezedBlockPVs(pvs, remake(rowsplit._1, pvs, hasStar).toTree) - lazy val failure = remake(rowsplit._2).toTree + // scrutinee.lengthCompare(pivotLength) [== | >=] 0 + val compareFn: Tree => Tree = (t: Tree) => compareOp((t DOT methodOp)(LIT(pivotLen)), ZERO) + + // wrapping in a null check on the scrutinee + nullSafe(compareFn, FALSE)(scrut.id) + } + lazy val success = squeezedBlockPVs(pvs, remake(successRows, pvs, hasStar).toTree) + lazy val failure = remake(failRows).toTree final def tree(): Tree = codegen } @@ -508,53 +563,38 @@ trait ParallelMatching extends ast.TreeDSL * remaining: remaining, rows index and pattern */ class MixTypes(val pmatch: PatternMatch, val rest: Rep) extends RuleApplication { - case class Yes(bx: Int, moreSpecific: Pattern, subsumed: List[Pattern]) - case class No(bx: Int, remaining: Pattern) - - val (yeses, noes) = { - val _ys = new ListBuffer[Yes] - val _ns = new ListBuffer[No] - - for ((pattern, j) <- pmatch.pzip()) { - // scrutinee, head of pattern group - val (s, p) = (pattern.tpe, head.necessaryType) - - def isEquivalent = head.necessaryType =:= pattern.tpe - def isObjectTest = pattern.isObject && (p =:= pattern.necessaryType) - - def sMatchesP = matches(s, p) - def pMatchesS = matches(p, s) - - def ifEquiv(yes: Pattern): Pattern = if (isEquivalent) yes else pattern - - def passl(p: Pattern = NoPattern, ps: List[Pattern] = pmatch.dummies) = Some(Yes(j, p, ps)) - def passr() = Some( No(j, pattern)) - - def typed(pp: Tree) = passl(ifEquiv(Pattern(pp))) - def subs() = passl(ifEquiv(NoPattern), pattern subpatterns pmatch) - - val (oneY, oneN) = pattern match { - case Pattern(LIT(null), _) if !(p =:= s) => (None, passr) // (1) - case x if isObjectTest => (passl(), None) // (2) - case Pattern(Typed(pp, _), _) if sMatchesP => (typed(pp), None) // (4) - // The next line used to be this which "fixed" 1697 but introduced - // numerous regressions including #3136. - // case Pattern(_: UnApply, _) => (passl(), passr) - case Pattern(_: UnApply, _) => (None, passr) - case x if !x.isDefault && sMatchesP => (subs(), None) - case x if x.isDefault || pMatchesS => (passl(), passr) - case _ => (None, passr) - } - oneY map (_ys +=) - oneN map (_ns +=) + val succRows = new ListBuffer[(Int, List[Pattern])] + val failRows = new ListBuffer[(Int, Pattern)] + + for ((pattern, j) <- pmatch.pzip()) { + def isMoreSpecific = matches(pattern.tpe, head.tpe) + def isLessSpecific = matches(head.tpe, pattern.tpe) + def isEquivalent = head.tpe =:= pattern.tpe + def isObjectTest = pattern.isObject && (head.tpe =:= pattern.tpe) + + def whichSubs = if (head.isCaseClass) (pattern expandToArity head.arity) else Nil + + def ifElsePattern(yes: Pattern) = if (isEquivalent) yes else pattern + + def succDummy = succRows += ((j, NoPattern :: pmatch.dummies)) + def succTyped(pp: Pattern) = succRows += ((j, ifElsePattern(pp) :: pmatch.dummies)) + def succSubs = succRows += ((j, ifElsePattern(NoPattern) :: whichSubs)) + def failOnly = failRows += ((j, pattern)) + + pattern match { + case Pattern(LIT(null), _) if !isEquivalent => failOnly + case x if isObjectTest => succDummy + // Note: bugs 1697/2337/etc have their origins right here because they + // have a type test which when passed doesn't guarantee a match: the + // unapply can still fail. + case Pattern(Typed(pp, _), _) if isMoreSpecific => succTyped(Pattern(pp)) + case Pattern(UnApply(_, _), _) => failOnly + case x if !x.isDefault && isMoreSpecific => succSubs + case x if x.isDefault || isLessSpecific => succDummy ; failOnly + case _ => failOnly } - (_ys.toList, _ns.toList) } - val moreSpecific = yeses map (_.moreSpecific) - val subsumed = yeses map (x => (x.bx, x.subsumed)) - val remaining = noes map (x => (x.bx, x.remaining)) - // temporary checks so we're less crashy while we determine what to implement. def checkErroneous(scrut: Scrutinee): Type = { scrut.tpe match { @@ -565,29 +605,20 @@ trait ParallelMatching extends ast.TreeDSL } } - private def mkZipped = - for (Yes(j, moreSpecific, subsumed) <- yeses) yield - j -> (moreSpecific :: subsumed) - - lazy val casted = scrut castedTo pmatch.headType + lazy val casted = scrut castedTo head.tpe lazy val cond = condition(checkErroneous(casted), scrut, head.boundVariables.nonEmpty) - private def isAnyMoreSpecific = yeses exists (x => !x.moreSpecific.isEmpty) - lazy val (subtests, subtestVars) = - if (isAnyMoreSpecific) (mkZipped, List(casted.pv)) - else (subsumed, Nil) - - lazy val newRows = - for ((j, ps) <- subtests) yield - (rest rows j).insert2(ps, pmatch(j).boundVariables, casted.sym) - lazy val success = { - val srep = remake(newRows, subtestVars ::: casted.accessorPatternVars, includeScrut = false) + val newRows = + for ((j, ps) <- succRows.toList) yield + (rest rows j).insert2(ps, pmatch(j).boundVariables, casted.sym) + + val newRoots = casted.pv :: casted.accessorPatternVars + val srep = remake(newRows, newRoots, false) squeezedBlock(casted.allValDefs, srep.toTree) } - lazy val failure = - mkFail(remaining map { case (p1, p2) => rest rows p1 insert p2 }) + lazy val failure = mkFail(failRows.toList map { case (p1, p2) => rest rows p1 insert p2 }) final def tree(): Tree = codegen } diff --git a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala index 83fd3a9608..82bddb2013 100644 --- a/src/compiler/scala/tools/nsc/matching/PatternBindings.scala +++ b/src/compiler/scala/tools/nsc/matching/PatternBindings.scala @@ -104,10 +104,7 @@ trait PatternBindings extends ast.TreeDSL // Like rebindToEqualsCheck, but subtly different. Not trying to be // mysterious -- I haven't sorted it all out yet. - def rebindToObjectCheck(): Pattern = { - val sType = sufficientType - rebindToType(mkEqualsRef(sType), sType) - } + def rebindToObjectCheck(): Pattern = rebindToType(mkEqualsRef(atomicTpe), atomicTpe) /** Helpers **/ private def wrapBindings(vs: List[Symbol], pat: Tree): Tree = vs match { diff --git a/src/compiler/scala/tools/nsc/matching/Patterns.scala b/src/compiler/scala/tools/nsc/matching/Patterns.scala index a21a9c7d9f..7621c1c2f3 100644 --- a/src/compiler/scala/tools/nsc/matching/Patterns.scala +++ b/src/compiler/scala/tools/nsc/matching/Patterns.scala @@ -85,10 +85,11 @@ trait Patterns extends ast.TreeDSL { // 8.1.4 (a) case class ApplyIdentPattern(tree: Apply) extends ApplyPattern with NamePattern { - require (!isVarPattern(fn) && args.isEmpty) + // XXX - see bug 3411 for code which violates this assumption + // require (!isVarPattern(fn) && args.isEmpty) val ident @ Ident(name) = fn - override def sufficientType = Pattern(ident).equalsCheck + override def atomicTpe = Pattern(ident).equalsCheck override def simplify(pv: PatternVar) = this.rebindToObjectCheck() override def description = "Id(%s)".format(name) } @@ -97,7 +98,7 @@ trait Patterns extends ast.TreeDSL { require (args.isEmpty) val Apply(select: Select, _) = tree - override def sufficientType = mkSingletonFromQualifier + override def atomicTpe = mkSingletonFromQualifier override def simplify(pv: PatternVar) = this.rebindToObjectCheck() override def description = backticked match { case Some(s) => "this." + s @@ -116,7 +117,7 @@ trait Patterns extends ast.TreeDSL { case class ObjectPattern(tree: Apply) extends ApplyPattern { // NamePattern? require(!fn.isType && isModule) - override def sufficientType = tpe.narrow + override def atomicTpe = tpe.narrow override def simplify(pv: PatternVar) = this.rebindToObjectCheck() override def description = "Obj(%s)".format(fn) } @@ -138,9 +139,7 @@ trait Patterns extends ast.TreeDSL { private def isColonColon = cleanName == "::" - override def subpatterns(pm: MatchMatrix#PatternMatch) = - if (pm.head.isCaseClass) toPats(args) - else super.subpatterns(pm) + override def expandToArity(newArity: Int): List[Pattern] = toPats(args) override def simplify(pv: PatternVar) = if (args.isEmpty) this rebindToEmpty tree.tpe @@ -167,19 +166,20 @@ trait Patterns extends ast.TreeDSL { private val MethodType(List(arg, _*), _) = fn.tpe private def uaTyped = Typed(tree, TypeTree(arg.tpe)) setType arg.tpe - override def necessaryType = arg.tpe + // to match an extractor, the arg type must be matched. + override def tpe = arg.tpe override def simplify(pv: PatternVar) = if (pv.sym.tpe <:< arg.tpe) this else this rebindTo uaTyped - override def description = "UnApp(%s => %s)".format(necessaryType, resTypesString) + override def description = "UnApp(%s => %s)".format(tpe, resTypesString) } // 8.1.8 (unapplySeq calls) - case class SequenceExtractorPattern(tree: UnApply) extends UnapplyPattern { + case class SequenceExtractorPattern(tree: UnApply) extends UnapplyPattern with SequenceLikePattern { - private val UnApply( + lazy val UnApply( Apply(TypeApply(Select(_, nme.unapplySeq), List(tptArg)), _), List(ArrayValue(_, elems)) ) = tree @@ -211,90 +211,24 @@ trait Patterns extends ast.TreeDSL { override def description = "UnSeq(%s => %s)".format(tptArg, resTypesString) } - abstract class SequencePattern extends Pattern { - val tree: ArrayValue - def nonStarPatterns: List[Pattern] - def subsequences(other: Pattern, seqType: Type): Option[List[Pattern]] - def canSkipSubsequences(second: Pattern): Boolean - - lazy val ArrayValue(elemtpt, elems) = tree - lazy val elemPatterns = toPats(elems) - - override def dummies = emptyPatterns(elems.length + 1) - override def subpatternsForVars: List[Pattern] = elemPatterns + trait SequenceLikePattern extends Pattern { + def elems: List[Tree] + def elemPatterns = toPats(elems) + def nonStarPatterns: List[Pattern] = if (hasStar) elemPatterns.init else elemPatterns def nonStarLength = nonStarPatterns.length def isAllDefaults = nonStarPatterns forall (_.isDefault) - def isShorter(other: SequencePattern) = nonStarLength < other.nonStarLength - def isSameLength(other: SequencePattern) = nonStarLength == other.nonStarLength - - protected def lengthCheckOp: (Tree, Tree) => Tree = - if (hasStar) _ ANY_>= _ - else _ MEMBER_== _ - - // optimization to avoid trying to match if length makes it impossible - override def precondition(pm: PatternMatch) = { - import pm.{ scrut, head } - val len = nonStarLength - val compareOp = head.tpe member nme.lengthCompare - - def cmpFunction(t1: Tree) = lengthCheckOp((t1 DOT compareOp)(LIT(len)), ZERO) - - Some(nullSafe(cmpFunction _, FALSE)(scrut.id)) - } - - /** True if 'next' must be checked even if 'first' failed to match after passing its length test - * (the conditional supplied by getPrecondition.) This is an optimization to avoid checking sequences - * which cannot match due to a length incompatibility. - */ - override def description = "Seq(%s)".format(elemPatterns) + def isShorter(other: SequenceLikePattern) = nonStarLength < other.nonStarLength + def isSameLength(other: SequenceLikePattern) = nonStarLength == other.nonStarLength } // 8.1.8 (b) (literal ArrayValues) - case class SequenceNoStarPattern(tree: ArrayValue) extends SequencePattern { - require(!hasStar) - lazy val nonStarPatterns = elemPatterns - - // no star - def subsequences(other: Pattern, seqType: Type): Option[List[Pattern]] = - condOpt(other) { - case next: SequenceStarPattern if isSameLength(next) => next rebindStar seqType - case next: SequenceNoStarPattern if isSameLength(next) => next.elemPatterns ::: List(NoPattern) - case WildcardPattern() | (_: SequencePattern) => dummies - } - - def canSkipSubsequences(second: Pattern): Boolean = - (tree eq second.tree) || (cond(second) { - case x: SequenceNoStarPattern => (x isShorter this) && this.isAllDefaults - }) - } - - // 8.1.8 (b) - case class SequenceStarPattern(tree: ArrayValue) extends SequencePattern { - require(hasStar) - lazy val nonStarPatterns = elemPatterns.init - - // yes star - private def nilPats = List(NilPattern, NoPattern) - def subsequences(other: Pattern, seqType: Type): Option[List[Pattern]] = - condOpt(other) { - case next: SequenceStarPattern if isSameLength(next) => (next rebindStar seqType) ::: List(NoPattern) - case next: SequenceStarPattern if (next isShorter this) => (dummies drop 1) ::: List(next) - case next: SequenceNoStarPattern if isSameLength(next) => next.elemPatterns ::: nilPats - case WildcardPattern() | (_: SequencePattern) => dummies - } - - def rebindStar(seqType: Type): List[Pattern] = - nonStarPatterns ::: List(elemPatterns.last rebindTo WILD(seqType)) - - def canSkipSubsequences(second: Pattern): Boolean = - (tree eq second.tree) || (cond(second) { - case x: SequenceStarPattern => this isShorter x - case x: SequenceNoStarPattern => !(x isShorter this) - }) + case class SequencePattern(tree: ArrayValue) extends Pattern with SequenceLikePattern { + lazy val ArrayValue(elemtpt, elems) = tree - override def description = "Seq*(%s)".format(elemPatterns) + override def subpatternsForVars: List[Pattern] = elemPatterns + override def description = "Seq(%s)".format(elemPatterns mkString ", ") } // 8.1.8 (c) @@ -353,7 +287,7 @@ trait Patterns extends ast.TreeDSL { case x: Literal => LiteralPattern(x) case x: UnApply => UnapplyPattern(x) case x: Ident => if (isVarPattern(x)) VariablePattern(x) else SimpleIdPattern(x) - case x: ArrayValue => if (isRightIgnoring(x)) SequenceStarPattern(x) else SequenceNoStarPattern(x) + case x: ArrayValue => SequencePattern(x) case x: Select => StableIdPattern(x) case x: Star => StarPattern(x) case x: This => ThisPattern(x) // XXX ? @@ -377,13 +311,20 @@ trait Patterns extends ast.TreeDSL { object UnapplyPattern { private object UnapplySeq { + /** This is as far as I can tell an elaborate attempt to spot case List(...) and + * avoid the extractor penalty. It has led to some bugs (e.g. 2800, 3050) which + * I attempt to address below. + */ private object TypeApp { def unapply(x: Any) = condOpt(x) { case TypeApply(sel @ Select(stor, nme.unapplySeq), List(tpe)) if stor.symbol eq ListModule => tpe } } def unapply(x: UnApply) = condOpt(x) { - case UnApply(Apply(TypeApp(tptArg), _), List(ArrayValue(_, xs))) => (tptArg, xs) + case UnApply(Apply(TypeApp(tptArg), _), List(ArrayValue(_, xs))) + // make sure it's not only _*, as otherwise the rewrite + // also removes the instance check. + if (xs.isEmpty || xs.size > 1 || !isStar(xs.head)) => (tptArg, xs) } } @@ -449,7 +390,7 @@ trait Patterns extends ast.TreeDSL { protected def mkSingletonFromQualifier = { def pType = qualifier match { case _: Apply => PseudoType(tree) - case _ => singleType(Pattern(qualifier).necessaryType, sym) + case _ => singleType(Pattern(qualifier).tpe, sym) } qualifier.tpe match { case t: ThisType => singleType(t, sym) // this.X @@ -460,7 +401,7 @@ trait Patterns extends ast.TreeDSL { sealed trait NamePattern extends Pattern { def name: Name - override def sufficientType = tpe.narrow + override def atomicTpe = tpe.narrow override def simplify(pv: PatternVar) = this.rebindToEqualsCheck() override def description = name.toString() } @@ -487,26 +428,31 @@ trait Patterns extends ast.TreeDSL { protected lazy val Apply(fn, args) = tree override def subpatternsForVars: List[Pattern] = toPats(args) - override def dummies = - if (!this.isCaseClass) Nil - else emptyPatterns(sufficientType.typeSymbol.caseFieldAccessors.size) - def isConstructorPattern = fn.isType } sealed abstract class Pattern extends PatternBindingLogic { val tree: Tree + // The type of a pattern says: in order for something to match this + // pattern, it must conform to this type. It does NOT say that if + // something does conform to this type, it definitely matches the pattern: + // see atomic type for that. + def tpe = tree.tpe + + // The atomic type of a pattern says: if something matches this, it + // definitely matches the pattern (but this is independent of nullness + // and guards, which are checked independently.) + def atomicTpe = tpe + // returns either a simplification of this pattern or identity. def simplify(pv: PatternVar): Pattern = this - def simplify(): Pattern = this simplify null - // the right number of dummies for this pattern - def dummies: List[Pattern] = Nil + // the arity of this pattern + def arity = if (isCaseClass) caseAccessors.length else 0 - // given this scrutinee, what if any condition must be satisfied before - // we even try to match? - def precondition(scrut: PatternMatch): Option[Tree] = None + // the right number of dummies for this pattern + def dummies: List[Pattern] = emptyPatterns(arity) // 8.1.13 // A pattern p is irrefutable for type T if any of the following applies: @@ -517,33 +463,26 @@ trait Patterns extends ast.TreeDSL { // pi is irrefutable for Ti. def irrefutableFor(tpe: Type) = false - // does this pattern completely cover that pattern (i.e. latter cannot be matched) - def completelyCovers(second: Pattern) = false - // Is this a default pattern (untyped "_" or an EmptyTree inserted by the matcher) def isDefault = false - // what type must a scrutinee have to have any chance of matching this pattern? - def necessaryType = tpe - - // what type could a scrutinee have which would automatically indicate a match? - // (nullness and guards will still be checked.) - def sufficientType = tpe - // XXX have to determine if this can be made useful beyond an extractor barrier. // Default sufficient type might be NothingClass.tpe, tpe.narrow, ... // the subpatterns for this pattern (at the moment, that means constructor arguments) - def subpatterns(pm: MatchMatrix#PatternMatch): List[Pattern] = pm.dummies + def expandToArity(newArity: Int): List[Pattern] = + if (isDefault) emptyPatterns(newArity) + else if (newArity == 0) Nil + else Predef.error("expandToArity(" + newArity + ") in " + this) def sym = tree.symbol - def tpe = tree.tpe def prefix = tpe.prefix def isEmpty = tree.isEmpty def isSymValid = (sym != null) && (sym != NoSymbol) def isModule = sym.isModule || tpe.termSymbol.isModule def isCaseClass = tpe.typeSymbol hasFlag Flags.CASE + def caseAccessors = tpe.typeSymbol.caseFieldAccessors def isObject = isSymValid && prefix.isStable // XXX not entire logic def unadorn(t: Tree): Tree = Pattern unadorn t @@ -585,7 +524,7 @@ trait Patterns extends ast.TreeDSL { if (boundVariables.isEmpty) description else "%s%s".format(bindingsDescription, description) } - def toTypeString() = "%s <: x <: %s".format(necessaryType, sufficientType) + def toTypeString() = "%s <: x <: %s".format(tpe, atomicTpe) } /*** Extractors ***/ diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala index f527441c68..1b7e208334 100644 --- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala +++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Lex Spoon */ -// $Id$ package scala.tools.nsc package plugins diff --git a/src/compiler/scala/tools/nsc/plugins/PluginComponent.scala b/src/compiler/scala/tools/nsc/plugins/PluginComponent.scala index 1da08cc4ee..4234d49545 100644 --- a/src/compiler/scala/tools/nsc/plugins/PluginComponent.scala +++ b/src/compiler/scala/tools/nsc/plugins/PluginComponent.scala @@ -3,7 +3,6 @@ * @author Lex Spoon * Updated by Anders Bach Nielsen */ -// $Id$ package scala.tools.nsc package plugins diff --git a/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala b/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala index 2345fcc32c..2498d84338 100644 --- a/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala +++ b/src/compiler/scala/tools/nsc/plugins/PluginDescription.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Lex Spoon */ -// $Id$ package scala.tools.nsc package plugins diff --git a/src/compiler/scala/tools/nsc/plugins/PluginLoadException.scala b/src/compiler/scala/tools/nsc/plugins/PluginLoadException.scala index 42780d7a05..f0402809d7 100644 --- a/src/compiler/scala/tools/nsc/plugins/PluginLoadException.scala +++ b/src/compiler/scala/tools/nsc/plugins/PluginLoadException.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Lex Spoon */ -// $Id$ package scala.tools.nsc package plugins diff --git a/src/compiler/scala/tools/nsc/plugins/Plugins.scala b/src/compiler/scala/tools/nsc/plugins/Plugins.scala index e800e0f904..5823a09995 100644 --- a/src/compiler/scala/tools/nsc/plugins/Plugins.scala +++ b/src/compiler/scala/tools/nsc/plugins/Plugins.scala @@ -3,7 +3,6 @@ * @author Lex Spoon * Updated by Anders Bach Nielsen */ -// $Id$ package scala.tools.nsc package plugins diff --git a/src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala b/src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala index e35843fc9c..11ef7ffb68 100644 --- a/src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala @@ -2,7 +2,6 @@ * Copyright 2002-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package reporters diff --git a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala index f7d380c975..1f01087dad 100644 --- a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala @@ -2,7 +2,6 @@ * Copyright 2002-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package reporters diff --git a/src/compiler/scala/tools/nsc/reporters/Reporter.scala b/src/compiler/scala/tools/nsc/reporters/Reporter.scala index bdb6c6ae6f..8dcb5183bb 100644 --- a/src/compiler/scala/tools/nsc/reporters/Reporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/Reporter.scala @@ -2,7 +2,6 @@ * Copyright 2002-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package reporters diff --git a/src/compiler/scala/tools/nsc/reporters/ReporterTimer.scala b/src/compiler/scala/tools/nsc/reporters/ReporterTimer.scala index 4c2f6a4a69..56f904a8bc 100644 --- a/src/compiler/scala/tools/nsc/reporters/ReporterTimer.scala +++ b/src/compiler/scala/tools/nsc/reporters/ReporterTimer.scala @@ -2,7 +2,6 @@ * Copyright 2002-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package reporters diff --git a/src/compiler/scala/tools/nsc/reporters/StoreReporter.scala b/src/compiler/scala/tools/nsc/reporters/StoreReporter.scala index b94639bb5c..e4736297e9 100644 --- a/src/compiler/scala/tools/nsc/reporters/StoreReporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/StoreReporter.scala @@ -2,7 +2,6 @@ * Copyright 2002-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package reporters diff --git a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala index 75e2c5ce11..21608f7f05 100644 --- a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala @@ -69,9 +69,12 @@ trait AbsSettings { * In immutable, of course they will return a new object, which means * we can't use "this.type", at least not in a non-casty manner, which * is unfortunate because we lose type information without it. + * + * ...but now they're this.type because of #3462. The immutable + * side doesn't exist yet anyway. */ - def withAbbreviation(name: String): Setting - def withHelpSyntax(help: String): Setting + def withAbbreviation(name: String): this.type + def withHelpSyntax(help: String): this.type def helpSyntax: String = name def abbreviations: List[String] = Nil diff --git a/src/compiler/scala/tools/nsc/symtab/AnnotationCheckers.scala b/src/compiler/scala/tools/nsc/symtab/AnnotationCheckers.scala index 945d9aa2fe..388e68497e 100644 --- a/src/compiler/scala/tools/nsc/symtab/AnnotationCheckers.scala +++ b/src/compiler/scala/tools/nsc/symtab/AnnotationCheckers.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala b/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala index f2e62856d5..40177fad10 100644 --- a/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala +++ b/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala @@ -2,7 +2,6 @@ * Copyright 2007-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 3511565326..597a34c773 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -2,14 +2,14 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab import scala.collection.mutable.{HashMap, HashSet} -import scala.tools.nsc.util.{Position, NoPosition} +import scala.tools.nsc.util.NoPosition import Flags._ +import PartialFunction._ trait Definitions extends reflect.generic.StandardDefinitions { self: SymbolTable => @@ -17,12 +17,6 @@ trait Definitions extends reflect.generic.StandardDefinitions { object definitions extends AbsDefinitions { def isDefinitionsInitialized = isInitialized - // Working around bug #2133 - private object definitionHelpers { - def cond[T](x: T)(f: PartialFunction[T, Boolean]) = (f isDefinedAt x) && f(x) - } - import definitionHelpers._ - // symbols related to packages var emptypackagescope: Scope = null //debug diff --git a/src/compiler/scala/tools/nsc/symtab/Flags.scala b/src/compiler/scala/tools/nsc/symtab/Flags.scala index b0cc3a5340..de8f92fdf4 100644 --- a/src/compiler/scala/tools/nsc/symtab/Flags.scala +++ b/src/compiler/scala/tools/nsc/symtab/Flags.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/InfoTransformers.scala b/src/compiler/scala/tools/nsc/symtab/InfoTransformers.scala index 54bd35e5b3..95dcb07c7c 100644 --- a/src/compiler/scala/tools/nsc/symtab/InfoTransformers.scala +++ b/src/compiler/scala/tools/nsc/symtab/InfoTransformers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/Names.scala b/src/compiler/scala/tools/nsc/symtab/Names.scala index b0e6c5250a..e6222a7a94 100644 --- a/src/compiler/scala/tools/nsc/symtab/Names.scala +++ b/src/compiler/scala/tools/nsc/symtab/Names.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/Scopes.scala b/src/compiler/scala/tools/nsc/symtab/Scopes.scala index f305f20d2a..bc8b93ac2c 100644 --- a/src/compiler/scala/tools/nsc/symtab/Scopes.scala +++ b/src/compiler/scala/tools/nsc/symtab/Scopes.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala index 9133228768..ed72fc16fa 100644 --- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala +++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab @@ -330,7 +329,7 @@ trait StdNames extends reflect.generic.StdNames { self: SymbolTable => val print = newTermName("print") val productArity = newTermName("productArity") val productElement = newTermName("productElement") - val productElementName = newTermName("productElementName") + // val productElementName = newTermName("productElementName") val productPrefix = newTermName("productPrefix") val readResolve = newTermName("readResolve") val sameElements = newTermName("sameElements") diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index 947f5a8f88..a95c8ada8f 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala index 75902568fa..0fdbeae98f 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index ebab5d9be7..3157e5cc20 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc @@ -928,7 +927,20 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => * type parameters later. */ def typeParams: List[Symbol] = - if (isMonomorphicType) List() else { rawInfo.load(this); rawInfo.typeParams } + if (isMonomorphicType) + List() + else { + if (validTo == NoPeriod) { + val current = phase + try { + phase = phaseOf(infos.validFrom) + rawInfo.load(this) + } finally { + phase = current + } + } + rawInfo.typeParams + } /** The value parameter sections of this symbol. */ diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index dc59587c4a..e0987c2d8b 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -2301,7 +2301,7 @@ A type's typeSymbol should never be inspected directly. origin+ (if(typeArgs.isEmpty) "" else (typeArgs map (_.safeToString)).mkString("[ ", ", ", " ]")) // +"#"+tid //DEBUG if (constr.inst eq null) "<null " + origin + ">" - else if (settings.debug.value) varString+"(@"+constr.hashCode+")"+constr.toString + else if (settings.debug.value) varString+"(@"+constr.## +")"+constr.toString else if (constr.inst eq NoType) varString else constr.inst.toString } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/AbstractFileReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/AbstractFileReader.scala index b32646e3cb..106318a47d 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/AbstractFileReader.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/AbstractFileReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala index a139f605b0..a3917cf2d2 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 7cd32ff81e..9c382439bc 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala index 23f45e0d13..624b3635bf 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/MetaParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/MetaParser.scala index 0ae2d5b015..d1f9280872 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/MetaParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/MetaParser.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 68d314bfe9..91141ce4d6 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala index 4022258746..a94838e163 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala b/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala index 20dbb4d917..f62a42375a 100644 --- a/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala +++ b/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala @@ -2,7 +2,6 @@ * Copyright 2004-2010 LAMP/EPFL */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala b/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala index 4d9c0ffc92..a90fb8b66c 100644 --- a/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala @@ -2,7 +2,6 @@ * Copyright 2004-2010 LAMP/EPFL */ -// $Id$ package scala.tools.nsc package symtab diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 92f117428a..f1ed9f43a0 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform @@ -162,7 +161,8 @@ abstract class AddInterfaces extends InfoTransform { case ClassInfoType(parents, decls, _) => assert(phase == implClassPhase) ClassInfoType( - ObjectClass.tpe :: (parents.tail map mixinToImplClass) ::: List(iface.tpe), + ObjectClass.tpe :: (parents.tail map mixinToImplClass filter (_.typeSymbol != ObjectClass)) + ::: List(iface.tpe), implDecls(sym, decls), sym) case PolyType(tparams, restpe) => diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index e6811cf497..c3c60253b9 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -2,7 +2,6 @@ * Copyrights 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index ad88b783b4..c9049d9ab1 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author */ -// $Id$ package scala.tools.nsc package transform @@ -28,6 +27,7 @@ abstract class Constructors extends Transform with ast.TreeDSL { import collection.mutable private val guardedCtorStats: mutable.Map[Symbol, List[Tree]] = new mutable.HashMap[Symbol, List[Tree]] + private val ctorParams: mutable.Map[Symbol, List[Symbol]] = new mutable.HashMap[Symbol, List[Symbol]] def transformClassTemplate(impl: Template): Template = { val clazz = impl.symbol.owner // the transformed class @@ -78,18 +78,22 @@ abstract class Constructors extends Transform with ast.TreeDSL { // A transformer for expressions that go into the constructor val intoConstructorTransformer = new Transformer { + def isParamRef(sym: Symbol) = + (sym hasFlag PARAMACCESSOR) && + sym.owner == clazz && + !(sym.isGetter && sym.accessed.isVariable) && + !sym.isSetter override def transform(tree: Tree): Tree = tree match { case Apply(Select(This(_), _), List()) => // references to parameter accessor methods of own class become references to parameters // outer accessors become references to $outer parameter - if ((tree.symbol hasFlag PARAMACCESSOR) && tree.symbol.owner == clazz) + if (isParamRef(tree.symbol)) gen.mkAttributedIdent(parameter(tree.symbol.accessed)) setPos tree.pos else if (tree.symbol.outerSource == clazz && !clazz.isImplClass) gen.mkAttributedIdent(parameterNamed(nme.OUTER)) setPos tree.pos else super.transform(tree) - case Select(This(_), _) - if ((tree.symbol hasFlag PARAMACCESSOR) && !tree.symbol.isSetter && tree.symbol.owner == clazz) => + case Select(This(_), _) if (isParamRef(tree.symbol)) => // references to parameter accessor field of own class become references to parameters gen.mkAttributedIdent(parameter(tree.symbol)) setPos tree.pos case Select(_, _) => @@ -301,7 +305,7 @@ abstract class Constructors extends Transform with ast.TreeDSL { case _ => false } - log("merging: " + originalStats.mkString("\n") + " : " + specializedStats.mkString("\n")) + log("merging: " + originalStats.mkString("\n") + "\nwith\n" + specializedStats.mkString("\n")) val res = for (s <- originalStats; val stat = s.duplicate) yield { log("merge: looking at " + stat) val stat1 = stat match { @@ -315,8 +319,13 @@ abstract class Constructors extends Transform with ast.TreeDSL { } if (stat1 eq stat) { + assert(ctorParams(genericClazz).length == constrParams.length) + // this is just to make private fields public + (new specializeTypes.ImplementationAdapter(ctorParams(genericClazz), constrParams, null, true))(stat1) + // statements coming from the original class need retyping in the current context if (settings.debug.value) log("retyping " + stat1) + val d = new specializeTypes.Duplicator d.retyped(localTyper.context1.asInstanceOf[d.Context], stat1, @@ -351,6 +360,7 @@ abstract class Constructors extends Transform with ast.TreeDSL { if (usesSpecializedField && shouldGuard && postfix.nonEmpty) { // save them for duplication in the specialized subclass guardedCtorStats(clazz) = postfix + ctorParams(clazz) = constrParams val tree = If( diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 88a7e13d80..4c000ce3f7 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform @@ -336,9 +335,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast. def erasedTypeRef(sym: Symbol): Type = typeRef(erasure(sym.owner.tpe), sym, List()) - /** Remove duplicate references to class Object in a list of parent classes - * todo: needed? - */ + /** Remove duplicate references to class Object in a list of parent classes */ private def removeDoubleObject(tps: List[Type]): List[Type] = tps match { case List() => List() case tp :: tps1 => diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index ee5bc040f5..f78022bdaa 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform @@ -62,6 +61,12 @@ abstract class ExplicitOuter extends InfoTransform result } + /** Issue a migration warning for instance checks which might be on an Array and + * for which the type parameter conforms to Seq, because these answers changed in 2.8. + */ + def isArraySeqTest(lhs: Type, rhs: Type) = + ArrayClass.tpe <:< lhs.widen && rhs.widen.matchesPattern(SeqClass.tpe) + def outerAccessor(clazz: Symbol): Symbol = { val firstTry = clazz.info.decl(nme.expandedName(nme.OUTER, clazz)) if (firstTry != NoSymbol && firstTry.outerSource == clazz) firstTry @@ -295,7 +300,6 @@ abstract class ExplicitOuter extends InfoTransform * </p> */ class ExplicitOuterTransformer(unit: CompilationUnit) extends OuterPathTransformer(unit) { - /** The definition tree of the outer accessor of current class */ def outerFieldDef: Tree = VAL(outerField(currentClass)) === EmptyTree @@ -484,8 +488,14 @@ abstract class ExplicitOuter extends InfoTransform matchTranslation(mch) case _ => - val x = super.transform(tree) + if (settings.Xmigration28.value) tree match { + case TypeApply(fn @ Select(qual, _), args) if fn.symbol == Object_isInstanceOf || fn.symbol == Any_isInstanceOf => + if (isArraySeqTest(qual.tpe, args.head.tpe)) + unit.warning(tree.pos, "An Array will no longer match as Seq[_].") + case _ => () + } + val x = super.transform(tree) if (x.tpe eq null) x else x setType transformInfo(currentOwner, x.tpe) } diff --git a/src/compiler/scala/tools/nsc/transform/Flatten.scala b/src/compiler/scala/tools/nsc/transform/Flatten.scala index 7fc826cdbb..1bee37bfe6 100644 --- a/src/compiler/scala/tools/nsc/transform/Flatten.scala +++ b/src/compiler/scala/tools/nsc/transform/Flatten.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/InfoTransform.scala b/src/compiler/scala/tools/nsc/transform/InfoTransform.scala index 9872705dfc..fa93a9b534 100644 --- a/src/compiler/scala/tools/nsc/transform/InfoTransform.scala +++ b/src/compiler/scala/tools/nsc/transform/InfoTransform.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 6ed0bfcccb..33fa14033e 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala index 951fa53041..a6a4a8d22c 100644 --- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala +++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Gilles Dubochet */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 18c4a74950..a9810b2217 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform @@ -568,7 +567,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { val newSyms = newDefs map (_.symbol) def isNotDuplicate(tree: Tree) = tree match { case DefDef(_, _, _, _, _, _) => - val sym = tree.symbol; + val sym = tree.symbol !(sym.isDeferred && (newSyms exists (nsym => nsym.name == sym.name && (nsym.tpe matches sym.tpe)))) case _ => @@ -742,14 +741,14 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { && !sym.accessed.hasFlag(PRESUPER) && !sym.isOuterAccessor) - if (settings.debug.value) { - log("needsInitFlag(" + sym.fullName + "): " + res) - log("\tsym.isGetter: " + sym.isGetter) - log("\t!isInitializedToDefault: " + !sym.isInitializedToDefault + sym.hasFlag(DEFAULTINIT) + sym.hasFlag(ACCESSOR) + sym.isTerm) - log("\t!sym.hasFlag(PARAMACCESSOR): " + !sym.hasFlag(PARAMACCESSOR)) - //println("\t!sym.accessed.hasFlag(PRESUPER): " + !sym.accessed.hasFlag(PRESUPER)) - log("\t!sym.isOuterAccessor: " + !sym.isOuterAccessor) - } +// if (settings.debug.value) { +// log("needsInitFlag(" + sym.fullName + "): " + res) +// log("\tsym.isGetter: " + sym.isGetter) +// log("\t!isInitializedToDefault: " + !sym.isInitializedToDefault + sym.hasFlag(DEFAULTINIT) + sym.hasFlag(ACCESSOR) + sym.isTerm) +// log("\t!sym.hasFlag(PARAMACCESSOR): " + !sym.hasFlag(PARAMACCESSOR)) +// //println("\t!sym.accessed.hasFlag(PRESUPER): " + !sym.accessed.hasFlag(PRESUPER)) +// log("\t!sym.isOuterAccessor: " + !sym.isOuterAccessor) +// } res } diff --git a/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala b/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala index 305f9218ec..1500759b30 100644 --- a/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala +++ b/src/compiler/scala/tools/nsc/transform/OverridingPairs.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala index 02e73035be..6661543d89 100644 --- a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala +++ b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index c2e5e474a9..c4ce7fe6e2 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package transform @@ -11,6 +10,7 @@ import scala.tools.nsc.symtab.Flags import scala.tools.nsc.util.FreshNameCreator import scala.collection.{mutable, immutable} +import immutable.Set /** Specialize code on types. */ @@ -55,7 +55,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { } /** Reduce the given environment to contain mappings only for type variables in tps. */ - def reduce(env: TypeEnv, tps: immutable.Set[Symbol]): TypeEnv = { + def restrict(env: TypeEnv, tps: immutable.Set[Symbol]): TypeEnv = { env filter { kv => tps.contains(kv._1)} } @@ -314,11 +314,13 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { } def specializedTypeVars(sym: Symbol): immutable.Set[Symbol] = - specializedTypeVars(atPhase(currentRun.typerPhase)(sym.info)) + atPhase(currentRun.typerPhase)(specializedTypeVars(sym.info)) /** Return the set of @specialized type variables mentioned by the given type. - * It only counts type variables that appear naked or as arguments to Java - * arrays (the only places where it makes sense to specialize). + * It only counts type variables that appear: + * - naked + * - as arguments to type constructors in @specialized positions + * (arrays ar considered as Array[@specialized T] */ def specializedTypeVars(tpe: Type): immutable.Set[Symbol] = tpe match { case TypeRef(pre, sym, args) => @@ -327,7 +329,11 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { immutable.ListSet.empty + sym else if (sym == definitions.ArrayClass) specializedTypeVars(args) - else immutable.ListSet.empty[Symbol] + else { + val extra = for ((tp, arg) <- sym.typeParams.zip(args) if tp.hasAnnotation(SpecializedClass)) + yield specializedTypeVars(arg).toList + immutable.ListSet.empty[Symbol] ++ extra.flatten + } case PolyType(tparams, resTpe) => specializedTypeVars(tparams map (_.info)) ++ specializedTypeVars(resTpe) @@ -565,6 +571,10 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { normalizeMember(m.owner, m, outerEnv) flatMap { normalizedMember => val ms = specializeMember(m.owner, normalizedMember, outerEnv, clazz.info.typeParams) // atPhase(currentRun.typerPhase)(println("normalizedMember.info: " + normalizedMember.info)) // bring the info to the typer phase + // interface traits have concrete members now + if (ms.nonEmpty && clazz.isTrait && clazz.isInterface) + clazz.resetFlag(INTERFACE) + if (normalizedMember.isMethod) { val newTpe = subst(outerEnv, normalizedMember.info) if (newTpe != normalizedMember.info) // only do it when necessary, otherwise the method type might be at a later phase already @@ -599,7 +609,15 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { private def normalizeMember(owner: Symbol, sym: Symbol, outerEnv: TypeEnv): List[Symbol] = { if (settings.debug.value) log("normalizeMember: " + sym.fullName) if (sym.isMethod && !atPhase(currentRun.typerPhase)(sym.typeParams.isEmpty)) { - val (stps, tps) = splitParams(sym.info.typeParams) + var (stps, tps) = splitParams(sym.info.typeParams) + val unusedStvars = stps -- specializedTypeVars(sym.info).toList + if (unusedStvars.nonEmpty && currentRun.compiles(sym) && !sym.isSynthetic) { + reporter.warning(sym.pos, "%s %s unused or used in non-specializable positions." + .format(unusedStvars.mkString("", ", ", ""), if (unusedStvars.length == 1) "is" else "are")) + unusedStvars foreach (_.removeAnnotation(SpecializedClass)) + stps = stps -- unusedStvars + tps = tps ::: unusedStvars + } val res = sym :: (for (env <- specializations(stps) if needsSpecialization(env, sym)) yield { val keys = env.keysIterator.toList; val vals = env.valuesIterator.toList @@ -636,7 +654,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { for (spec <- specializations(tparams)) yield { if (sym.hasFlag(PRIVATE)) sym.resetFlag(PRIVATE).setFlag(PROTECTED) val specMember = subst(outerEnv)(specializedOverload(owner, sym, spec)) - typeEnv(specMember) = outerEnv ++ spec + typeEnv(specMember) = typeEnv(sym) ++ outerEnv ++ spec overloads(sym) = Overload(specMember, spec) :: overloads(sym) specMember } @@ -674,54 +692,83 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { */ private def specialOverrides(clazz: Symbol): List[Symbol] = { log("specialOverrides(" + clazz + ")") + + /** Return the overridden symbol in syms that needs a specialized overriding symbol, + * together with its specialization environment. The overridden symbol may not be + * the closest to 'overriding', in a given hierarchy. + * + * An method m needs a special override if + * * m overrides a method whose type contains specialized type variables + * * there is a valid specialization environment that maps the overridden method type to m's type. + */ + def needsSpecialOverride(overriding: Symbol, syms: List[Symbol]): (Symbol, TypeEnv) = { + def missingSpecializations(baseTvar: Symbol, derivedTvar: Symbol): Set[Type] = { + val baseSet = concreteTypes(baseTvar).toSet + val derivedSet = concreteTypes(derivedTvar).toSet + baseSet diff derivedSet + } + + def checkOverriddenTParams(overridden: Symbol) { + if (currentRun.compiles(overriding)) + for (val (baseTvar, derivedTvar) <- overridden.info.typeParams.zip(overriding.info.typeParams); + val missing = missingSpecializations(baseTvar, derivedTvar) + if missing.nonEmpty) + reporter.error(derivedTvar.pos, + "Type parameter has to be specialized at least for the same types as in the overridden method. Missing " + + "types: " + missing.mkString("", ", ", "")) + } + + for (overridden <- syms) { + if (settings.debug.value) + log("Overridden: " + overridden.fullName + ": " + overridden.info + + "\n by " + overriding.fullName + ": " + overriding.info) + val stvars = specializedTypeVars(overridden.info) + if (!stvars.isEmpty) { + if (settings.debug.value) log("\t\tspecializedTVars: " + stvars) + checkOverriddenTParams(overridden) + + val env = unify(overridden.info, overriding.info, emptyEnv) + if (settings.debug.value) + log("\t\tenv: " + env + "isValid: " + TypeEnv.isValid(env, overridden) + + "found: " + atPhase(phase.next)(overridden.owner.info.decl(specializedName(overridden, env)))) + if (!TypeEnv.restrict(env, stvars).isEmpty + && TypeEnv.isValid(env, overridden) + && atPhase(phase.next)(overridden.owner.info.decl(specializedName(overridden, env))) != NoSymbol) + return (overridden, env) + } + } + (NoSymbol, emptyEnv) + } + val oms = new mutable.ListBuffer[Symbol] for (overriding <- clazz.info.decls; - val allOverridden = overriding.allOverriddenSymbols - if !allOverridden.isEmpty; - val overridden = allOverridden.head) { - if (settings.debug.value) - log("\toverriding pairs: " + overridden.fullName + ": " + overridden.info - + " overriden by " + overriding.fullName + ": " + overriding.info) - if (overriding.owner == clazz && !specializedTypeVars(overridden.info).isEmpty) { - if (settings.debug.value) log("\t\tspecializedTVars: " + specializedTypeVars(overridden.info)) - val env = unify(overridden.info, overriding.info, emptyEnv) - if (settings.debug.value) - log("\t\tenv: " + env + "isValid: " - + TypeEnv.isValid(env, overridden) - + " looking for: " + specializedName(overridden, env) + " in:\n" - + atPhase(phase.next)(overridden.owner.info.decls) - + "found: " + atPhase(phase.next)(overridden.owner.info.decl(specializedName(overridden, env)))) - if (!env.isEmpty - && TypeEnv.isValid(env, overridden) - && atPhase(phase.next)(overridden.owner.info.decl(specializedName(overridden, env))) != NoSymbol) { - log("Added specialized overload for " + overriding.fullName + " in env: " + env) - val om = specializedOverload(clazz, overridden, env) - typeEnv(om) = env - concreteSpecMethods += overriding - if (!overriding.isDeferred) { - // if the override is a normalized member, 'om' gets the implementation from - // its original target, and adds the environment of the normalized member (that is, - // any specialized /method/ type parameter bindings) - info(om) = info.get(overriding) match { - case Some(NormalizedMember(target)) => - typeEnv(om) = env ++ typeEnv(overriding) - SpecialOverride(target) - case _ => SpecialOverride(overriding) - } - info(overriding) = Forward(om) - om setPos overriding.pos // set the position of the concrete, overriding member - } else { - // abstract override - if (settings.debug.value) log("abstract override " + overriding.fullName + " with specialized " + om.fullName) - info(om) = Forward(overriding) - } - overloads(overriding) = Overload(om, env) :: overloads(overriding) - oms += om - atPhase(phase.next)( - assert(overridden.owner.info.decl(om.name) != NoSymbol, - "Could not find " + om.name + " in " + overridden.owner.info.decls)) + val (overridden, env) = needsSpecialOverride(overriding, overriding.allOverriddenSymbols) + if overridden != NoSymbol) { + log("Added specialized overload for " + overriding.fullName + " in env: " + env) + val om = specializedOverload(clazz, overridden, env) + typeEnv(om) = env + concreteSpecMethods += overriding + if (!overriding.isDeferred) { // concrete method + // if the override is a normalized member, 'om' gets the implementation from + // its original target, and adds the environment of the normalized member (that is, + // any specialized /method/ type parameter bindings) + info(om) = info.get(overriding) match { + case Some(NormalizedMember(target)) => + typeEnv(om) = env ++ typeEnv(overriding) + SpecialOverride(target) + case _ => SpecialOverride(overriding) } + info(overriding) = Forward(om) + om setPos overriding.pos + } else { // abstract override + if (settings.debug.value) log("abstract override " + overriding.fullName + " with specialized " + om.fullName) + info(om) = Forward(overriding) } + overloads(overriding) = Overload(om, env) :: overloads(overriding) + oms += om + atPhase(phase.next)( + assert(overridden.owner.info.decl(om.name) != NoSymbol, + "Could not find " + om.name + " in " + overridden.owner.info.decls)) } oms.toList } @@ -824,7 +871,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { */ override def transformInfo(sym: Symbol, tpe: Type): Type = { val res = tpe match { - case PolyType(targs, ClassInfoType(base, decls, clazz)) => + case PolyType(targs, ClassInfoType(base, decls, clazz)) if clazz != definitions.RepeatedParamClass && clazz != definitions.JavaRepeatedParamClass => val parents = base map specializedType if (settings.debug.value) log("transformInfo (poly) " + clazz + " with parents1: " + parents + " ph: " + phase) // if (clazz.name.toString == "$colon$colon") @@ -905,6 +952,52 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val global: SpecializeTypes.this.global.type = SpecializeTypes.this.global } with typechecker.Duplicators + /** A tree symbol substituter that substitutes on type skolems. + * If a type parameter is a skolem, it looks for the original + * symbol in the 'from' and maps it to the corresponding new + * symbol. The new symbol should probably be a type skolem as + * well (not enforced). + * + * All private members are made protected in order to be accessible from + * specialized classes. + */ + class ImplementationAdapter(from: List[Symbol], + to: List[Symbol], + targetClass: Symbol, + addressFields: Boolean) extends TreeSymSubstituter(from, to) { + override val symSubst = new SubstSymMap(from, to) { + override def matches(sym1: Symbol, sym2: Symbol) = + if (sym2.isTypeSkolem) sym2.deSkolemize eq sym1 + else sym1 eq sym2 + } + + private def isAccessible(sym: Symbol): Boolean = + (currentClass == sym.owner.enclClass) && (currentClass != targetClass) + + private def shouldMakePublic(sym: Symbol): Boolean = + sym.hasFlag(PRIVATE | PROTECTED) && (addressFields || !nme.isLocalName(sym.name)) + + /** All private members that are referenced are made protected, + * in order to be accessible from specialized subclasses. + */ + override def transform(tree: Tree): Tree = tree match { + case Select(qual, name) => + val sym = tree.symbol + if (sym.hasFlag(PRIVATE)) + if (settings.debug.value) + log("seeing private member %s, currentClass: %s, owner: %s, isAccessible: %b, isLocalName: %b" + .format(sym, currentClass, sym.owner.enclClass, isAccessible(sym), nme.isLocalName(sym.name))) + if (shouldMakePublic(sym) && !isAccessible(sym)) { + if (settings.debug.value) log("changing private flag of " + sym) + sym.makeNotPrivate(sym.owner) + } + super.transform(tree) + + case _ => + super.transform(tree) + } + } + def specializeCalls(unit: CompilationUnit) = new TypingTransformer(unit) { /** Map a specializable method to it's rhs, when not deferred. */ val body: mutable.Map[Symbol, Tree] = new mutable.HashMap @@ -938,20 +1031,22 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { /** The specialized symbol of 'tree.symbol' for tree.tpe, if there is one */ def specSym(qual: Tree): Option[Symbol] = { val env = unify(symbol.tpe, tree.tpe, emptyEnv) - log("checking for rerouting: " + tree + " with sym.tpe: " + symbol.tpe + " tree.tpe: " + tree.tpe + " env: " + env) + log("[specSym] checking for rerouting: %s with \n\tsym.tpe: %s, \n\ttree.tpe: %s \n\tenv: %s \n\tname: %s" + .format(tree, symbol.tpe, tree.tpe, env, specializedName(symbol, env))) if (!env.isEmpty) { // a method? - val specMember = overload(symbol, env) - if (specMember.isDefined) Some(specMember.get.sym) - else { // a field? - val specMember = qual.tpe.member(specializedName(symbol, env)) - if (specMember ne NoSymbol) Some(specMember) - else None - } + val specMember = qual.tpe.member(specializedName(symbol, env)) + if (specMember ne NoSymbol) + if (typeEnv(specMember) == env) Some(specMember) + else { + log("wrong environments for specialized member: \n\ttypeEnv(%s) = %s\n\tenv = %s".format(specMember, typeEnv(specMember), env)) + None + } + else None } else None } def maybeTypeApply(fun: Tree, targs: List[Tree]) = - if (targs.isEmpty)fun else TypeApply(fun, targs) + if (targs.isEmpty) fun else TypeApply(fun, targs) curTree = tree tree match { @@ -971,13 +1066,14 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val qual1 = transform(qual) specSym(qual1) match { case Some(specMember) => - if (settings.debug.value) log("found " + specMember) + if (settings.debug.value) log("found " + specMember.fullName) assert(symbol.info.typeParams.length == targs.length) val env = typeEnv(specMember) val residualTargs = - for ((tvar, targ) <-symbol.info.typeParams.zip(targs) if !env.isDefinedAt(tvar)) + for ((tvar, targ) <- symbol.info.typeParams.zip(targs) if !env.isDefinedAt(tvar)) yield targ - assert(residualTargs.length == specMember.info.typeParams.length) + assert(residualTargs.length == specMember.info.typeParams.length, + "residual: %s, tparams: %s, env: %s".format(residualTargs, symbol.info.typeParams, env)) val tree1 = maybeTypeApply(Select(qual1, specMember), residualTargs) log("rewrote " + tree + " to " + tree1) localTyper.typedOperator(atPos(tree.pos)(tree1)) // being polymorphic, it must be a method @@ -988,10 +1084,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { case Select(qual, name) => if (settings.debug.value) log("looking at Select: " + tree + " sym: " + symbol + ": " + symbol.info + "[tree.tpe: " + tree.tpe + "]") - //if (settings.debug.value) log("\toverloads: " + overloads.mkString("", "\n", "")) + if (!specializedTypeVars(symbol.info).isEmpty && name != nme.CONSTRUCTOR) { - if (settings.debug.value) - log("checking for unification at " + tree + " with sym.tpe: " + symbol.tpe + " and tree.tpe: " + tree.tpe + " at " + tree.pos.line) val env = unify(symbol.tpe, tree.tpe, emptyEnv) if (settings.debug.value) log("checking for rerouting: " + tree + " with sym.tpe: " + symbol.tpe + " tree.tpe: " + tree.tpe + " env: " + env) if (!env.isEmpty) { @@ -1048,8 +1142,12 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val superRef: Tree = Select(Super(nme.EMPTY.toTypeName, nme.EMPTY.toTypeName), nme.CONSTRUCTOR) forwardCall(tree.pos, superRef, vparamss) } - val tree1 = atPos(symbol.pos)(treeCopy.DefDef(tree, mods, name, tparams, vparamss, tpt, Block(List(t), Literal(())))) - localTyper.typed(tree1) + if (symbol.isPrimaryConstructor) localTyper typed { + atPos(symbol.pos)(treeCopy.DefDef(tree, mods, name, tparams, vparamss, tpt, Block(List(t), Literal(())))) + } else { + // duplicate the original constructor + duplicateBody(ddef, info(symbol).target) + } } else info(symbol) match { case Implementation(target) => @@ -1177,7 +1275,9 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val symbol = tree.symbol if (settings.debug.value) log("specializing body of" + symbol.fullName + ": " + symbol.info) val DefDef(mods, name, tparams, vparamss, tpt, _) = tree - val (_, origtparams) = splitParams(source.typeParams) +// val (_, origtparams) = splitParams(source.typeParams) + val boundTvars = typeEnv(symbol).keySet + val origtparams = source.typeParams.filter(!boundTvars(_)) if (settings.debug.value) log("substituting " + origtparams + " for " + symbol.typeParams) // skolemize type parameters @@ -1192,54 +1292,14 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val symSubstituter = new ImplementationAdapter( parameters(source).flatten ::: origtparams, vparamss1.flatten.map(_.symbol) ::: newtparams, - source.enclClass) + source.enclClass, + false) // don't make private fields public val tmp = symSubstituter(body(source).duplicate) tpt.tpe = tpt.tpe.substSym(oldtparams, newtparams) treeCopy.DefDef(tree, mods, name, tparams, vparamss1, tpt, tmp) } - /** A tree symbol substituter that substitutes on type skolems. - * If a type parameter is a skolem, it looks for the original - * symbol in the 'from' and maps it to the corresponding new - * symbol. The new symbol should probably be a type skolem as - * well (not enforced). - * - * All private members are made protected in order to be accessible from - * specialized classes. - */ - class ImplementationAdapter(from: List[Symbol], to: List[Symbol], targetClass: Symbol) extends TreeSymSubstituter(from, to) { - override val symSubst = new SubstSymMap(from, to) { - override def matches(sym1: Symbol, sym2: Symbol) = - if (sym2.isTypeSkolem) sym2.deSkolemize eq sym1 - else sym1 eq sym2 - } - - private def isAccessible(sym: Symbol): Boolean = - (currentClass == sym.owner.enclClass) && (currentClass != targetClass) - - /** All private members that are referenced are made protected, - * in order to be accessible from specialized subclasses. - */ - override def transform(tree: Tree): Tree = tree match { - case Select(qual, name) => - val sym = tree.symbol - if (sym.hasFlag(PRIVATE)) - if (settings.debug.value) log("seeing private member " + sym + " targetClass: " + currentClass + " owner: " + sym.owner.enclClass) - if (sym.hasFlag(PRIVATE | PROTECTED) && !nme.isLocalName(sym.name) && !isAccessible(sym)) { - if (settings.debug.value) log("changing private flag of " + sym) -// tree.symbol.resetFlag(PRIVATE).setFlag(PROTECTED) - sym.makeNotPrivate(sym.owner) -// tree.symbol.resetFlag(PRIVATE | PROTECTED) -// tree.symbol.privateWithin = NoSymbol - } - super.transform(tree) - - case _ => - super.transform(tree) - } - } - def warn(clazz: Symbol)(pos: Position, err: String) = if (!clazz.hasFlag(SPECIALIZED)) unit.warning(pos, err) @@ -1263,19 +1323,21 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { if (info(m).target.isGetterOrSetter) hasSpecializedFields = true if (m.isClassConstructor) { val origParamss = parameters(info(m).target) - assert(origParamss.length == 1) // we are after uncurry val vparams = for ((tp, sym) <- m.info.paramTypes zip origParamss(0)) yield m.newValue(sym.pos, specializedName(sym, typeEnv(cls))) .setInfo(tp) .setFlag(sym.flags) + // param accessors for private members (the others are inherited from the generic class) - for (param <- vparams if cls.info.nonPrivateMember(param.name) == NoSymbol; - val acc = param.cloneSymbol(cls).setFlag(PARAMACCESSOR | PRIVATE)) { - cls.info.decls.enter(acc) - mbrs += ValDef(acc, EmptyTree).setType(NoType).setPos(m.pos) - } + if (m.isPrimaryConstructor) + for (param <- vparams if cls.info.nonPrivateMember(param.name) == NoSymbol; + val acc = param.cloneSymbol(cls).setFlag(PARAMACCESSOR | PRIVATE)) { + cls.info.decls.enter(acc) + mbrs += ValDef(acc, EmptyTree).setType(NoType).setPos(m.pos) + } + // ctor mbrs += atPos(m.pos)(DefDef(m, Modifiers(m.flags), List(vparams) map (_ map ValDef), EmptyTree)) } else { @@ -1291,11 +1353,14 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { } } if (hasSpecializedFields) { + import definitions.BooleanClass + + val isSpecializedInstance = cls.hasFlag(SPECIALIZED) || cls.info.parents.exists(_.typeSymbol.hasFlag(SPECIALIZED)) val sym = cls.newMethod(nme.SPECIALIZED_INSTANCE, cls.pos) - .setInfo(MethodType(Nil, definitions.BooleanClass.tpe)) + .setInfo(MethodType(Nil, BooleanClass.tpe)) cls.info.decls.enter(sym) mbrs += atPos(sym.pos) { - DefDef(sym, Literal(cls.hasFlag(SPECIALIZED)).setType(sym.tpe.finalResultType)).setType(NoType) + DefDef(sym, Literal(isSpecializedInstance).setType(BooleanClass.tpe)).setType(NoType) } } mbrs.toList diff --git a/src/compiler/scala/tools/nsc/transform/TailCalls.scala b/src/compiler/scala/tools/nsc/transform/TailCalls.scala index 9fff8534d3..9b54dd9428 100644 --- a/src/compiler/scala/tools/nsc/transform/TailCalls.scala +++ b/src/compiler/scala/tools/nsc/transform/TailCalls.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Iulian Dragos */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/Transform.scala b/src/compiler/scala/tools/nsc/transform/Transform.scala index 9fb6d5cdc1..2fc3eee59c 100644 --- a/src/compiler/scala/tools/nsc/transform/Transform.scala +++ b/src/compiler/scala/tools/nsc/transform/Transform.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/TypingTransformers.scala b/src/compiler/scala/tools/nsc/transform/TypingTransformers.scala index 65f3caf642..8efbb356e8 100644 --- a/src/compiler/scala/tools/nsc/transform/TypingTransformers.scala +++ b/src/compiler/scala/tools/nsc/transform/TypingTransformers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package transform diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index bad98193b0..0270323133 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author */ -// $Id$ package scala.tools.nsc package transform @@ -404,8 +403,15 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { Select(predef, "wrap"+elemtp.typeSymbol.name+"Array") else TypeApply(Select(predef, "genericWrapArray"), List(TypeTree(elemtp))) - val adaptedTree = // need to cast to Array[elemtp], as arrays are not covariant - gen.mkCast(tree, arrayType(elemtp)) + val pt = arrayType(elemtp) + val adaptedTree = // might need to cast to Array[elemtp], as arrays are not covariant + if (tree.tpe <:< pt) tree + else gen.mkCast( + if (elemtp.typeSymbol == AnyClass && isValueClass(tree.tpe.typeArgs.head.typeSymbol)) + gen.mkRuntimeCall("toObjectArray", List(tree)) + else + tree, + arrayType(elemtp)) Apply(meth, List(adaptedTree)) } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala index 70bf55e661..63e5a9fb25 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala index f1e88fe6e8..ac1853cbe0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 82c4c01b79..7469388a08 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker @@ -317,7 +316,7 @@ trait Contexts { self: Analyzer => override def toString(): String = { if (this == NoContext) "NoContext" else owner.toString() + " @ " + tree.getClass() + - " " + tree.toString() + ", scope = " + scope.hashCode() + + " " + tree.toString() + ", scope = " + scope.## + " " + scope.toList + "\n:: " + outer.toString() } diff --git a/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.scala b/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.scala index a2e9f10a5a..43ac9182c3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.scala +++ b/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index 78f43296b4..dbc3ffbe17 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -189,6 +189,7 @@ abstract class Duplicators extends Analyzer { if (tree.hasSymbol && tree.symbol != NoSymbol && !tree.symbol.isLabel // labels cannot be retyped by the type checker as LabelDef has no ValDef/return type trees && invalidSyms.isDefinedAt(tree.symbol)) { + if (settings.debug.value) log("removed symbol " + tree.symbol) tree.symbol = NoSymbol } @@ -240,7 +241,9 @@ abstract class Duplicators extends Analyzer { case Select(th @ This(_), sel) if (oldClassOwner ne null) && (th.symbol == oldClassOwner) => log("selection on this, no type ascription required") - super.typed(atPos(tree.pos)(Select(This(newClassOwner), sel)), mode, pt) + // we use the symbol name instead of the tree name because the symbol may have been + // name mangled, rendering the tree name obsolete + super.typed(atPos(tree.pos)(Select(This(newClassOwner), tree.symbol.name)), mode, pt) case This(_) if (oldClassOwner ne null) && (tree.symbol == oldClassOwner) => // val tree1 = Typed(This(newClassOwner), TypeTree(fixType(tree.tpe.widen))) diff --git a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala index 5b79662014..7cfc4733d3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala +++ b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index e503d721f9..3abaf4f337 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ //todo: rewrite or disllow new T where T is a mixin (currently: <init> not a member of T) //todo: use inherited type info also for vars and values @@ -127,8 +126,7 @@ self: Analyzer => case _ => false } - override def hashCode = - name.hashCode + pre.hashCode + sym.hashCode + override def hashCode = name.## + pre.## + sym.## override def toString = "ImplicitInfo(" + name + "," + pre + "," + sym + ")" } @@ -573,6 +571,19 @@ self: Analyzer => /** A set containing names that are shadowed by implicit infos */ lazy val shadowed = new HashSet[Name]("shadowed", 512) + // #3453 + // in addition to the implicit symbols that may shadow the implicit with name `name`, + // this method tests whether there's a non-implicit symbol with name `name` in scope + // inspired by logic in typedIdent + def nonImplicitSynonymInScope(name: Name) = { + val defEntry = context.scope.lookupEntry(name) + (defEntry ne null) && + reallyExists(defEntry.sym) && + !defEntry.sym.isImplicit // the implicit ones are handled by the `shadowed` set above + // also, subsumes the test that defEntry.sym ne info.sym + // (the `info` that's in scope at the call to nonImplicitSynonymInScope in tryImplicit) + } + /** Is `sym' the standard conforms method in Predef? * Note: DON't replace this by sym == Predef_conforms, as Predef_conforms is a `def' * which does a member lookup (it can't be a lazy val because we might reload Predef @@ -594,7 +605,7 @@ self: Analyzer => def tryImplicit(info: ImplicitInfo): SearchResult = { incCounter(triedImplicits) if (info.isCyclicOrErroneous || - (isLocal && shadowed.contains(info.name)) || + (isLocal && (shadowed.contains(info.name) || nonImplicitSynonymInScope(info.name))) || (isView && isConformsMethod(info.sym)) || //@M this condition prevents no-op conversions, which are a problem (besides efficiency), // one example is removeNames in NamesDefaults, which relies on the type checker failing in case of ambiguity between an assignment/named arg @@ -617,6 +628,11 @@ self: Analyzer => applicable } + // #3453 -- alternative fix, seems not to be faster than encoding the set as the boolean predicate nonImplicitSynonymInScope + // in addition to the *implicit* symbols that may shadow the implicit with name `name` (added to shadowed by addAppInfos) + // add names of non-implicit symbols that are in scope (accessible without prefix) + // for(sym <- context.scope; if !sym.isImplicit) shadowed addEntry sym.name + var applicable = Map[ImplicitInfo, SearchResult]() for (is <- iss) applicable = addAppInfos(is, applicable) diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 1ee1604319..31bb86994e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 37f8a21bf8..d56b8ed944 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker @@ -298,7 +297,7 @@ trait Namers { self: Analyzer => private def enterSymFinishWith(tree: Tree, tparams: List[TypeDef]) { val sym = tree.symbol - if (settings.debug.value) log("entered " + sym + " in " + context.owner + ", scope-id = " + context.scope.hashCode()); + if (settings.debug.value) log("entered " + sym + " in " + context.owner + ", scope-id = " + context.scope.## ) var ltype = namerOf(sym).typeCompleter(tree) if (!tparams.isEmpty) { //@M! TypeDef's type params are handled differently @@ -876,6 +875,7 @@ trait Namers { self: Analyzer => if (vparam.tpt.isEmpty) vparam.symbol setInfo WildcardType val overridden = overriddenSymbol if (overridden != NoSymbol && !(overridden hasFlag OVERLOADED)) { + overridden.cookJavaRawInfo() // #3404 xform java rawtypes into existentials resultPt = site.memberType(overridden) match { case PolyType(tparams, rt) => rt.substSym(tparams, tparamSyms) case mt => mt diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index ef2c3c3071..f1d0537f46 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 72f6f1ae39..4b5de16a31 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 8a7f4b0958..fabf2ed063 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index 1e8b89cb6f..f33e3506fd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker @@ -88,7 +87,7 @@ trait SyntheticMethods extends ast.TreeDSL { typer typed { DEF(method) === LIT(nargs) } } - /** Common code for productElement and productElementName + /** Common code for productElement and (currently disabled) productElementName */ def perElementMethod(accs: List[Symbol], methodName: Name, resType: Type, caseFn: Symbol => Tree): Tree = { val symToTpe = makeTypeConstructor(List(IntClass.tpe), resType) @@ -108,8 +107,8 @@ trait SyntheticMethods extends ast.TreeDSL { def productElementMethod(accs: List[Symbol]): Tree = perElementMethod(accs, nme.productElement, AnyClass.tpe, x => Ident(x)) - def productElementNameMethod(accs: List[Symbol]): Tree = - perElementMethod(accs, nme.productElementName, StringClass.tpe, x => Literal(x.name.toString)) + // def productElementNameMethod(accs: List[Symbol]): Tree = + // perElementMethod(accs, nme.productElementName, StringClass.tpe, x => Literal(x.name.toString)) def moduleToStringMethod: Tree = { val method = syntheticMethod(nme.toString_, FINAL, makeNoArgConstructor(StringClass.tpe)) diff --git a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala index c2b6e7adf2..de9da9d814 100644 --- a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index f503a797bb..aad80c1d8c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ //todo: rewrite or disllow new T where T is a mixin (currently: <init> not a member of T) //todo: use inherited type info also for vars and values @@ -2619,6 +2618,7 @@ trait Typers { self: Analyzer => (nme.ERROR, None) } else { names -= sym + if(isJava) sym.cookJavaRawInfo() // #3429 val annArg = tree2ConstArg(rhs, sym.tpe.resultType) (sym.name, annArg) } diff --git a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala index 6f432cc3c4..5bbda13acd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker @@ -100,13 +99,13 @@ trait Unapplies extends ast.TreeDSL } def copyUntyped[T <: Tree](tree: T): T = - returning[T](UnTyper traverse _)(tree.duplicate) + returning[T](tree.duplicate)(UnTyper traverse _) - def copyUntypedInvariant(td: TypeDef): TypeDef = - returning[TypeDef](UnTyper traverse _)( - treeCopy.TypeDef(td, td.mods &~ (COVARIANT | CONTRAVARIANT), td.name, - td.tparams, td.rhs).duplicate - ) + def copyUntypedInvariant(td: TypeDef): TypeDef = { + val copy = treeCopy.TypeDef(td, td.mods &~ (COVARIANT | CONTRAVARIANT), td.name, td.tparams, td.rhs) + + returning[TypeDef](copy.duplicate)(UnTyper traverse _) + } private def classType(cdef: ClassDef, tparams: List[TypeDef]): Tree = { val tycon = REF(cdef.symbol) diff --git a/src/compiler/scala/tools/nsc/typechecker/Variances.scala b/src/compiler/scala/tools/nsc/typechecker/Variances.scala index feaf57a541..7d0500d598 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Variances.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Variances.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package typechecker diff --git a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala index 39a104fb14..907622e31f 100644 --- a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala +++ b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index c35b7139c6..4994542fdb 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util @@ -247,7 +246,7 @@ abstract class ClassPath[T] { /** Filters for assessing validity of various entities. */ def validClassFile(name: String) = (name endsWith ".class") && context.isValidName(name) - def validPackage(name: String) = (name != "META-INF") && (name != "") && (name.head != '.') + def validPackage(name: String) = (name != "META-INF") && (name != "") && (name(0) != '.') def validSourceFile(name: String) = validSourceExtensions exists (name endsWith _) def validSourceExtensions = List(".scala", ".java") @@ -321,8 +320,7 @@ class DirectoryClassPath(val dir: AbstractFile, val context: ClassPathContext[Ab case f if f.isDirectory && validPackage(f.name) => new DirectoryClassPath(f, context) } toList - - override def toString() = "directory classpath: "+ dir.toString() + override def toString() = "directory classpath: "+ dir } /** diff --git a/src/compiler/scala/tools/nsc/util/DocStrings.scala b/src/compiler/scala/tools/nsc/util/DocStrings.scala index 7ca2722a54..06045daf3b 100755 --- a/src/compiler/scala/tools/nsc/util/DocStrings.scala +++ b/src/compiler/scala/tools/nsc/util/DocStrings.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id: ClassPath.scala 20028 2009-12-07 11:49:19Z cunei $ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/FreshNameCreator.scala b/src/compiler/scala/tools/nsc/util/FreshNameCreator.scala index 0c9fa6db72..714e731891 100644 --- a/src/compiler/scala/tools/nsc/util/FreshNameCreator.scala +++ b/src/compiler/scala/tools/nsc/util/FreshNameCreator.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/HashSet.scala b/src/compiler/scala/tools/nsc/util/HashSet.scala index dc9ec73040..aa6e19538c 100644 --- a/src/compiler/scala/tools/nsc/util/HashSet.scala +++ b/src/compiler/scala/tools/nsc/util/HashSet.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util @@ -27,7 +26,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte private def index(x: Int): Int = math.abs(x % capacity) def findEntryOrUpdate(x: T): T = { - var h = index(x.hashCode()) + var h = index(x.##) var entry = table(h) while (entry ne null) { if (x == entry) @@ -43,7 +42,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte } def findEntry(x: T): T = { - var h = index(x.hashCode()) + var h = index(x.##) var entry = table(h) while ((entry ne null) && entry != x) { h = index(h + 1) @@ -53,7 +52,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte } def addEntry(x: T) { - var h = index(x.hashCode()) + var h = index(x.##) var entry = table(h) while (entry ne null) { if (entry == x) return @@ -77,7 +76,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte } private def addOldEntry(x: T) { - var h = index(x.hashCode()) + var h = index(x.##) var entry = table(h) while (entry ne null) { h = index(h + 1) diff --git a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala index ddefcc04ee..fa377a294d 100644 --- a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala +++ b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/Position.scala b/src/compiler/scala/tools/nsc/util/Position.scala index 806c885291..8d0ff37c44 100644 --- a/src/compiler/scala/tools/nsc/util/Position.scala +++ b/src/compiler/scala/tools/nsc/util/Position.scala @@ -3,7 +3,6 @@ * @author Martin Odersky * */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/RegexCache.scala b/src/compiler/scala/tools/nsc/util/RegexCache.scala index 5227b8ea4d..5c3197afa5 100644 --- a/src/compiler/scala/tools/nsc/util/RegexCache.scala +++ b/src/compiler/scala/tools/nsc/util/RegexCache.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Lex Spoon */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/Set.scala b/src/compiler/scala/tools/nsc/util/Set.scala index 8896ee02a5..c8ba3d27c9 100644 --- a/src/compiler/scala/tools/nsc/util/Set.scala +++ b/src/compiler/scala/tools/nsc/util/Set.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala index b87d603570..82911892d9 100644 --- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala +++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools package nsc diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala index f9f3c5e5fe..8c1d308209 100644 --- a/src/compiler/scala/tools/nsc/util/SourceFile.scala +++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala @@ -3,14 +3,15 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util -import scala.tools.nsc.io.{AbstractFile, VirtualFile} +import io.{ AbstractFile, VirtualFile } import scala.collection.mutable.ArrayBuffer -import annotation.{ tailrec, switch } +import annotation.tailrec +import java.util.regex.Pattern +import java.io.IOException import Chars._ /** abstract base class of a source file used in the compiler */ @@ -18,6 +19,7 @@ abstract class SourceFile { def content : Array[Char] // normalized, must end in SU def file : AbstractFile def isLineBreak(idx : Int) : Boolean + def isSelfContained: Boolean def length : Int def position(offset: Int) : Position = { assert(offset < length) @@ -47,6 +49,42 @@ abstract class SourceFile { def identifier(pos: Position, compiler: Global): Option[String] = None } +object ScriptSourceFile { + /** Length of the script header from the given content, if there is one. + * The header begins with "#!" or "::#!" and ends with a line starting + * with "!#" or "::!#". + */ + def headerLength(cs: Array[Char]): Int = { + val headerPattern = Pattern.compile("""^(::)?!#.*(\r|\n|\r\n)""", Pattern.MULTILINE) + val headerStarts = List("#!", "::#!") + + if (headerStarts exists (cs startsWith _)) { + val matcher = headerPattern matcher cs.mkString + if (matcher.find) matcher.end + else throw new IOException("script file does not close its header with !# or ::!#") + } + else 0 + } + def stripHeader(cs: Array[Char]): Array[Char] = cs drop headerLength(cs) + + def apply(file: AbstractFile, content: Array[Char]) = { + val underlying = new BatchSourceFile(file, content) + val headerLen = headerLength(content) + val stripped = new ScriptSourceFile(underlying, content drop headerLen, headerLen) + + stripped + } +} +import ScriptSourceFile._ + +class ScriptSourceFile(underlying: BatchSourceFile, content: Array[Char], override val start: Int) extends BatchSourceFile(underlying.file, content) { + override def isSelfContained = false + + override def positionInUltimateSource(pos: Position) = + if (!pos.isDefined) super.positionInUltimateSource(pos) + else new OffsetPosition(underlying, pos.point + start) +} + /** a file whose contents do not change over time */ class BatchSourceFile(val file : AbstractFile, val content: Array[Char]) extends SourceFile { @@ -55,16 +93,13 @@ class BatchSourceFile(val file : AbstractFile, val content: Array[Char]) extends def this(file: AbstractFile, cs: Seq[Char]) = this(file, cs.toArray) override def equals(that : Any) = that match { - case that : BatchSourceFile => file.path == that.file.path + case that : BatchSourceFile => file.path == that.file.path && start == that.start case _ => false } - override def hashCode = file.path.hashCode + override def hashCode = file.path.## + start.## val length = content.length - - // in SourceFileFragments, these are overridden to compensate during offset calculation - // Invariant: length + start = underlyingLength - def underlyingLength = length def start = 0 + def isSelfContained = true override def identifier(pos: Position, compiler: Global) = if (pos.isDefined && pos.source == this && pos.point != -1) { @@ -82,13 +117,14 @@ class BatchSourceFile(val file : AbstractFile, val content: Array[Char]) extends else isLineBreakChar(ch) } - private lazy val lineIndices: Array[Int] = { + def calculateLineIndices(cs: Array[Char]) = { val buf = new ArrayBuffer[Int] buf += 0 - for (i <- 0 until content.length) if (isLineBreak(i)) buf += i + 1 - buf += content.length // sentinel, so that findLine below works smoother + for (i <- 0 until cs.length) if (isLineBreak(i)) buf += i + 1 + buf += cs.length // sentinel, so that findLine below works smoother buf.toArray } + private lazy val lineIndices: Array[Int] = calculateLineIndices(content) def lineToOffset(index : Int): Int = lineIndices(index) @@ -106,125 +142,4 @@ class BatchSourceFile(val file : AbstractFile, val content: Array[Char]) extends lastLine = findLine(0, lines.length, lastLine) lastLine } - -/** - - // An array which maps line numbers (counting from 0) to char offset into content - private lazy val lineIndices: Array[Int] = { - - val xs = content.indices filter isLineBreak map (_ + 1) toArray - val arr = new Array[Int](xs.length + 1) - arr(0) = 0 - System.arraycopy(xs, 0, arr, 1, xs.length) - - arr - } - // A reverse map which also hunts down the right answer on non-exact lookups - private class SparseReverser() { - val revMap = Map(lineIndices.zipWithIndex: _*) - - def apply(x: Int): Int = revMap.get(x) match { - case Some(res) => res - case _ => - var candidate = x - 1 - while (!revMap.contains(candidate)) - candidate -= 1 - - revMap(candidate) - } - } - private lazy val lineIndicesRev = new SparseReverser() - - def lineToOffset(index : Int): Int = lineIndices(index) - def offsetToLine(offset: Int): Int = lineIndicesRev(offset) - - */ -} - -/** A source file composed of multiple other source files. - * - * @version 1.0 - */ -class CompoundSourceFile( - name: String, - components: List[BatchSourceFile], - contents: Array[Char]) -extends BatchSourceFile(name, contents) -{ - /** The usual constructor. Specify a name for the compound file and - * a list of component sources. - */ - def this(name: String, components: BatchSourceFile*) = - this(name, components.toList, components flatMap (CompoundSourceFile stripSU _.content) toArray) - - /** Create an instance with the specified components and a generic name. */ - def this(components: BatchSourceFile*) = this("(virtual file)", components: _*) - - override def positionInUltimateSource(position: Position) = { - if (!position.isDefined) super.positionInUltimateSource(position) - else { - var off = position.point - var compsLeft = components - // the search here has to be against the length of the files underlying the - // components, not their advertised length (which in the case of a fragment is - // less than the underlying length.) Otherwise we can and will overshoot the - // correct component and return a garbage position. - while (compsLeft.head.underlyingLength-1 <= off && !compsLeft.tail.isEmpty) { - off = off - compsLeft.head.underlyingLength + 1 - compsLeft = compsLeft.tail - } - // now that we've identified the correct component, we have to adjust the - // position we report since it is expected relative to the fragment, not the - // underlying file. Thus, off - comp.start. - val comp = compsLeft.head - comp.positionInUltimateSource(new OffsetPosition(this, off - comp.start)) - } - } -} - -object CompoundSourceFile { - private[util] def stripSU(chars: Array[Char]) = - if (chars.length > 0 && chars.last == SU) - chars dropRight 1 - else - chars -} - - -/** One portion of an underlying file. The fragment includes - * the indices from the specified start (inclusively) to stop - * (not inclusively). - */ -class SourceFileFragment private ( - name: String, - underlyingFile: BatchSourceFile, - override val start: Int, - stop: Int, - contents: Array[Char]) -extends BatchSourceFile(name, contents) { - override def underlyingLength = underlyingFile.length - def this(name: String, underlyingFile: BatchSourceFile, start: Int, stop: Int) = - this( - name, - underlyingFile, - start, - stop, - { assert(start >= 0) - assert(start <= stop) - assert(start <= underlyingFile.length) - assert(stop <= underlyingFile.length) - underlyingFile.content.slice(start, stop).toArray }) - - def this(underlyingFile: BatchSourceFile, start: Int, stop: Int) = - this( - "(fragment of " + underlyingFile.file.name + ")", - underlyingFile, - start, - stop) - - override def positionInUltimateSource(position: Position) = - super.positionInUltimateSource( - if (position.isDefined) new OffsetPosition(this, position.point) - else position - ) } diff --git a/src/compiler/scala/tools/nsc/util/Statistics.scala b/src/compiler/scala/tools/nsc/util/Statistics.scala index 5aee76d946..de51c2778c 100644 --- a/src/compiler/scala/tools/nsc/util/Statistics.scala +++ b/src/compiler/scala/tools/nsc/util/Statistics.scala @@ -3,7 +3,6 @@ * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/TreeSet.scala b/src/compiler/scala/tools/nsc/util/TreeSet.scala index 86e44df684..522c99c4e0 100644 --- a/src/compiler/scala/tools/nsc/util/TreeSet.scala +++ b/src/compiler/scala/tools/nsc/util/TreeSet.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id$ package scala.tools.nsc package util diff --git a/src/compiler/scala/tools/nsc/util/package.scala b/src/compiler/scala/tools/nsc/util/package.scala new file mode 100644 index 0000000000..92d4eab54f --- /dev/null +++ b/src/compiler/scala/tools/nsc/util/package.scala @@ -0,0 +1,29 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2010 LAMP/EPFL + * @author Paul Phillips + */ + +package scala.tools.nsc + +import java.io.{ OutputStream, PrintStream, ByteArrayOutputStream, PrintWriter, StringWriter } + +package object util { + /** Apply a function and return the passed value */ + def returning[T](x: T)(f: T => Unit): T = { f(x) ; x } + + /** Generate a string using a routine that wants to write on a stream. */ + def stringFromWriter(writer: PrintWriter => Unit): String = { + val stringWriter = new StringWriter() + val stream = new NewLinePrintWriter(stringWriter) + writer(stream) + stream.close() + stringWriter.toString + } + def stringFromStream(stream: OutputStream => Unit): String = { + val bs = new ByteArrayOutputStream() + val ps = new PrintStream(bs) + stream(ps) + ps.close() + bs.toString() + } +} diff --git a/src/compiler/scala/tools/util/AbstractTimer.scala b/src/compiler/scala/tools/util/AbstractTimer.scala index f91c964d26..b0ea663c47 100644 --- a/src/compiler/scala/tools/util/AbstractTimer.scala +++ b/src/compiler/scala/tools/util/AbstractTimer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.util diff --git a/src/compiler/scala/tools/util/SocketConnection.scala b/src/compiler/scala/tools/util/SocketConnection.scala index 085d754300..040f2b2392 100644 --- a/src/compiler/scala/tools/util/SocketConnection.scala +++ b/src/compiler/scala/tools/util/SocketConnection.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.util diff --git a/src/compiler/scala/tools/util/SocketServer.scala b/src/compiler/scala/tools/util/SocketServer.scala index 7dcfd7efce..88d7013f36 100644 --- a/src/compiler/scala/tools/util/SocketServer.scala +++ b/src/compiler/scala/tools/util/SocketServer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.util diff --git a/src/compiler/scala/tools/util/StringOps.scala b/src/compiler/scala/tools/util/StringOps.scala index 6e5b3e54d3..1a42c32fc8 100644 --- a/src/compiler/scala/tools/util/StringOps.scala +++ b/src/compiler/scala/tools/util/StringOps.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools package util diff --git a/src/dbc/scala/dbc/DataType.scala b/src/dbc/scala/dbc/DataType.scala index 9c11688adc..8eb318d1c1 100644 --- a/src/dbc/scala/dbc/DataType.scala +++ b/src/dbc/scala/dbc/DataType.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc; diff --git a/src/dbc/scala/dbc/Database.scala b/src/dbc/scala/dbc/Database.scala index e69bad0eb4..68afe0e51d 100644 --- a/src/dbc/scala/dbc/Database.scala +++ b/src/dbc/scala/dbc/Database.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/Syntax.scala b/src/dbc/scala/dbc/Syntax.scala index 8b3eae3d27..74959724a9 100644 --- a/src/dbc/scala/dbc/Syntax.scala +++ b/src/dbc/scala/dbc/Syntax.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc; diff --git a/src/dbc/scala/dbc/Utilities.scala b/src/dbc/scala/dbc/Utilities.scala index e54c957d53..9f16f895be 100644 --- a/src/dbc/scala/dbc/Utilities.scala +++ b/src/dbc/scala/dbc/Utilities.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc; diff --git a/src/dbc/scala/dbc/Value.scala b/src/dbc/scala/dbc/Value.scala index d6ddca314a..cf7b62c1cf 100644 --- a/src/dbc/scala/dbc/Value.scala +++ b/src/dbc/scala/dbc/Value.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc; diff --git a/src/dbc/scala/dbc/Vendor.scala b/src/dbc/scala/dbc/Vendor.scala index d476f6a5a6..6c840e4b15 100644 --- a/src/dbc/scala/dbc/Vendor.scala +++ b/src/dbc/scala/dbc/Vendor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc; diff --git a/src/dbc/scala/dbc/datatype/ApproximateNumeric.scala b/src/dbc/scala/dbc/datatype/ApproximateNumeric.scala index 1fcc1736f7..bbc77fc83e 100644 --- a/src/dbc/scala/dbc/datatype/ApproximateNumeric.scala +++ b/src/dbc/scala/dbc/datatype/ApproximateNumeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/Boolean.scala b/src/dbc/scala/dbc/datatype/Boolean.scala index adbf4fb840..18aa5371c1 100644 --- a/src/dbc/scala/dbc/datatype/Boolean.scala +++ b/src/dbc/scala/dbc/datatype/Boolean.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/Character.scala b/src/dbc/scala/dbc/datatype/Character.scala index d0be34c779..6873283c78 100644 --- a/src/dbc/scala/dbc/datatype/Character.scala +++ b/src/dbc/scala/dbc/datatype/Character.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/CharacterLargeObject.scala b/src/dbc/scala/dbc/datatype/CharacterLargeObject.scala index 73a61d8ebc..c0ce3a6c01 100644 --- a/src/dbc/scala/dbc/datatype/CharacterLargeObject.scala +++ b/src/dbc/scala/dbc/datatype/CharacterLargeObject.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/CharacterString.scala b/src/dbc/scala/dbc/datatype/CharacterString.scala index 1b3880e63b..90efcb887f 100644 --- a/src/dbc/scala/dbc/datatype/CharacterString.scala +++ b/src/dbc/scala/dbc/datatype/CharacterString.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/CharacterVarying.scala b/src/dbc/scala/dbc/datatype/CharacterVarying.scala index ab90830914..dda07de36b 100644 --- a/src/dbc/scala/dbc/datatype/CharacterVarying.scala +++ b/src/dbc/scala/dbc/datatype/CharacterVarying.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/ExactNumeric.scala b/src/dbc/scala/dbc/datatype/ExactNumeric.scala index f8a9bceff4..dfbdf969e6 100644 --- a/src/dbc/scala/dbc/datatype/ExactNumeric.scala +++ b/src/dbc/scala/dbc/datatype/ExactNumeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/Factory.scala b/src/dbc/scala/dbc/datatype/Factory.scala index a7640cc642..d652556722 100644 --- a/src/dbc/scala/dbc/datatype/Factory.scala +++ b/src/dbc/scala/dbc/datatype/Factory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/Numeric.scala b/src/dbc/scala/dbc/datatype/Numeric.scala index fe1e6785f4..4c39869f0b 100644 --- a/src/dbc/scala/dbc/datatype/Numeric.scala +++ b/src/dbc/scala/dbc/datatype/Numeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/String.scala b/src/dbc/scala/dbc/datatype/String.scala index 3b6ef5fcfb..b149aec04b 100644 --- a/src/dbc/scala/dbc/datatype/String.scala +++ b/src/dbc/scala/dbc/datatype/String.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/datatype/Unknown.scala b/src/dbc/scala/dbc/datatype/Unknown.scala index d496f0a24b..ef8ab1036c 100644 --- a/src/dbc/scala/dbc/datatype/Unknown.scala +++ b/src/dbc/scala/dbc/datatype/Unknown.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/exception/IncompatibleSchema.scala b/src/dbc/scala/dbc/exception/IncompatibleSchema.scala index 39aabef165..883a2369f5 100644 --- a/src/dbc/scala/dbc/exception/IncompatibleSchema.scala +++ b/src/dbc/scala/dbc/exception/IncompatibleSchema.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/exception/UnsupportedFeature.scala b/src/dbc/scala/dbc/exception/UnsupportedFeature.scala index 9ecd8a4d07..3e3d2f64ca 100644 --- a/src/dbc/scala/dbc/exception/UnsupportedFeature.scala +++ b/src/dbc/scala/dbc/exception/UnsupportedFeature.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/result/Field.scala b/src/dbc/scala/dbc/result/Field.scala index 3e2e0a7ffe..b01dd5dcdb 100644 --- a/src/dbc/scala/dbc/result/Field.scala +++ b/src/dbc/scala/dbc/result/Field.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/result/FieldMetadata.scala b/src/dbc/scala/dbc/result/FieldMetadata.scala index a7958be5a3..8314eaae3e 100644 --- a/src/dbc/scala/dbc/result/FieldMetadata.scala +++ b/src/dbc/scala/dbc/result/FieldMetadata.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/result/Relation.scala b/src/dbc/scala/dbc/result/Relation.scala index f70279ddd5..45f3b625d8 100644 --- a/src/dbc/scala/dbc/result/Relation.scala +++ b/src/dbc/scala/dbc/result/Relation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/result/Status.scala b/src/dbc/scala/dbc/result/Status.scala index 0303b2a8e2..c8eebb9d98 100644 --- a/src/dbc/scala/dbc/result/Status.scala +++ b/src/dbc/scala/dbc/result/Status.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/result/Tuple.scala b/src/dbc/scala/dbc/result/Tuple.scala index c7ac29962d..659fa98325 100644 --- a/src/dbc/scala/dbc/result/Tuple.scala +++ b/src/dbc/scala/dbc/result/Tuple.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/AccessMode.scala b/src/dbc/scala/dbc/statement/AccessMode.scala index 5b65ff20c7..d5304c446b 100644 --- a/src/dbc/scala/dbc/statement/AccessMode.scala +++ b/src/dbc/scala/dbc/statement/AccessMode.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/DerivedColumn.scala b/src/dbc/scala/dbc/statement/DerivedColumn.scala index 130d84b593..d1f9eb5ba4 100644 --- a/src/dbc/scala/dbc/statement/DerivedColumn.scala +++ b/src/dbc/scala/dbc/statement/DerivedColumn.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Expression.scala b/src/dbc/scala/dbc/statement/Expression.scala index b4e47d78d9..23b2e8e39c 100644 --- a/src/dbc/scala/dbc/statement/Expression.scala +++ b/src/dbc/scala/dbc/statement/Expression.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Insert.scala b/src/dbc/scala/dbc/statement/Insert.scala index 3afc37c3f9..ec4850bcc8 100644 --- a/src/dbc/scala/dbc/statement/Insert.scala +++ b/src/dbc/scala/dbc/statement/Insert.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/InsertionData.scala b/src/dbc/scala/dbc/statement/InsertionData.scala index 22c6bec832..e0f9083a40 100644 --- a/src/dbc/scala/dbc/statement/InsertionData.scala +++ b/src/dbc/scala/dbc/statement/InsertionData.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/IsolationLevel.scala b/src/dbc/scala/dbc/statement/IsolationLevel.scala index 0367fce22e..444c03aa41 100644 --- a/src/dbc/scala/dbc/statement/IsolationLevel.scala +++ b/src/dbc/scala/dbc/statement/IsolationLevel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/JoinType.scala b/src/dbc/scala/dbc/statement/JoinType.scala index 4214f9b442..4a9af824ca 100644 --- a/src/dbc/scala/dbc/statement/JoinType.scala +++ b/src/dbc/scala/dbc/statement/JoinType.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Jointure.scala b/src/dbc/scala/dbc/statement/Jointure.scala index 30b0f3ddf7..f66d37869c 100644 --- a/src/dbc/scala/dbc/statement/Jointure.scala +++ b/src/dbc/scala/dbc/statement/Jointure.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Relation.scala b/src/dbc/scala/dbc/statement/Relation.scala index c285d2fd28..4f5f29eb53 100644 --- a/src/dbc/scala/dbc/statement/Relation.scala +++ b/src/dbc/scala/dbc/statement/Relation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Select.scala b/src/dbc/scala/dbc/statement/Select.scala index 13c764c842..1e432e2277 100644 --- a/src/dbc/scala/dbc/statement/Select.scala +++ b/src/dbc/scala/dbc/statement/Select.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/SetClause.scala b/src/dbc/scala/dbc/statement/SetClause.scala index 88ae32bb13..177c869a9a 100644 --- a/src/dbc/scala/dbc/statement/SetClause.scala +++ b/src/dbc/scala/dbc/statement/SetClause.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/SetQuantifier.scala b/src/dbc/scala/dbc/statement/SetQuantifier.scala index 74ced70dd6..1f224eae97 100644 --- a/src/dbc/scala/dbc/statement/SetQuantifier.scala +++ b/src/dbc/scala/dbc/statement/SetQuantifier.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Statement.scala b/src/dbc/scala/dbc/statement/Statement.scala index 27ceb9180d..a8d52ba333 100644 --- a/src/dbc/scala/dbc/statement/Statement.scala +++ b/src/dbc/scala/dbc/statement/Statement.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Status.scala b/src/dbc/scala/dbc/statement/Status.scala index cc8b9671cf..bea3a2600b 100644 --- a/src/dbc/scala/dbc/statement/Status.scala +++ b/src/dbc/scala/dbc/statement/Status.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Table.scala b/src/dbc/scala/dbc/statement/Table.scala index fab39d62c7..001b13279e 100644 --- a/src/dbc/scala/dbc/statement/Table.scala +++ b/src/dbc/scala/dbc/statement/Table.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Transaction.scala b/src/dbc/scala/dbc/statement/Transaction.scala index fdb062076a..101f50f197 100644 --- a/src/dbc/scala/dbc/statement/Transaction.scala +++ b/src/dbc/scala/dbc/statement/Transaction.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/Update.scala b/src/dbc/scala/dbc/statement/Update.scala index 9f9656940b..7afb750183 100644 --- a/src/dbc/scala/dbc/statement/Update.scala +++ b/src/dbc/scala/dbc/statement/Update.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/Aggregate.scala b/src/dbc/scala/dbc/statement/expression/Aggregate.scala index 64f0c39f4f..5411afde1f 100644 --- a/src/dbc/scala/dbc/statement/expression/Aggregate.scala +++ b/src/dbc/scala/dbc/statement/expression/Aggregate.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/BinaryOperator.scala b/src/dbc/scala/dbc/statement/expression/BinaryOperator.scala index 76219a7d62..0565ee81ff 100644 --- a/src/dbc/scala/dbc/statement/expression/BinaryOperator.scala +++ b/src/dbc/scala/dbc/statement/expression/BinaryOperator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/Constant.scala b/src/dbc/scala/dbc/statement/expression/Constant.scala index 0f0b1a2cd5..ca099eae5f 100644 --- a/src/dbc/scala/dbc/statement/expression/Constant.scala +++ b/src/dbc/scala/dbc/statement/expression/Constant.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/Default.scala b/src/dbc/scala/dbc/statement/expression/Default.scala index 27f6ea9d5c..5d629eea52 100644 --- a/src/dbc/scala/dbc/statement/expression/Default.scala +++ b/src/dbc/scala/dbc/statement/expression/Default.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/Field.scala b/src/dbc/scala/dbc/statement/expression/Field.scala index e896da5427..7f050fb29b 100644 --- a/src/dbc/scala/dbc/statement/expression/Field.scala +++ b/src/dbc/scala/dbc/statement/expression/Field.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/FunctionCall.scala b/src/dbc/scala/dbc/statement/expression/FunctionCall.scala index 85e203ace4..666bdc594c 100644 --- a/src/dbc/scala/dbc/statement/expression/FunctionCall.scala +++ b/src/dbc/scala/dbc/statement/expression/FunctionCall.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/Select.scala b/src/dbc/scala/dbc/statement/expression/Select.scala index 95e6ff467e..28f4f0ec54 100644 --- a/src/dbc/scala/dbc/statement/expression/Select.scala +++ b/src/dbc/scala/dbc/statement/expression/Select.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/SetFunction.scala b/src/dbc/scala/dbc/statement/expression/SetFunction.scala index f1c6c0fee3..36061b013c 100644 --- a/src/dbc/scala/dbc/statement/expression/SetFunction.scala +++ b/src/dbc/scala/dbc/statement/expression/SetFunction.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/TypeCast.scala b/src/dbc/scala/dbc/statement/expression/TypeCast.scala index 25e9d06abf..ead392ecfc 100644 --- a/src/dbc/scala/dbc/statement/expression/TypeCast.scala +++ b/src/dbc/scala/dbc/statement/expression/TypeCast.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/statement/expression/UnaryOperator.scala b/src/dbc/scala/dbc/statement/expression/UnaryOperator.scala index e48618df23..6910de5b60 100644 --- a/src/dbc/scala/dbc/statement/expression/UnaryOperator.scala +++ b/src/dbc/scala/dbc/statement/expression/UnaryOperator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/syntax/DataTypeUtil.scala b/src/dbc/scala/dbc/syntax/DataTypeUtil.scala index dfbc844f26..5882a08b63 100644 --- a/src/dbc/scala/dbc/syntax/DataTypeUtil.scala +++ b/src/dbc/scala/dbc/syntax/DataTypeUtil.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/syntax/Database.scala b/src/dbc/scala/dbc/syntax/Database.scala index c2fa63313e..938c61b7f3 100644 --- a/src/dbc/scala/dbc/syntax/Database.scala +++ b/src/dbc/scala/dbc/syntax/Database.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/syntax/Statement.scala b/src/dbc/scala/dbc/syntax/Statement.scala index 0a2fa49ee6..c78a718382 100644 --- a/src/dbc/scala/dbc/syntax/Statement.scala +++ b/src/dbc/scala/dbc/syntax/Statement.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/syntax/StatementExpression.scala b/src/dbc/scala/dbc/syntax/StatementExpression.scala index 0dafd8bd55..577c173241 100644 --- a/src/dbc/scala/dbc/syntax/StatementExpression.scala +++ b/src/dbc/scala/dbc/syntax/StatementExpression.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/ApproximateNumeric.scala b/src/dbc/scala/dbc/value/ApproximateNumeric.scala index 672a5d26ec..1d0c7ada15 100644 --- a/src/dbc/scala/dbc/value/ApproximateNumeric.scala +++ b/src/dbc/scala/dbc/value/ApproximateNumeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/Boolean.scala b/src/dbc/scala/dbc/value/Boolean.scala index 233945e799..9349eee28c 100644 --- a/src/dbc/scala/dbc/value/Boolean.scala +++ b/src/dbc/scala/dbc/value/Boolean.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/Character.scala b/src/dbc/scala/dbc/value/Character.scala index 080400cfea..57ad54ee89 100644 --- a/src/dbc/scala/dbc/value/Character.scala +++ b/src/dbc/scala/dbc/value/Character.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/CharacterLargeObject.scala b/src/dbc/scala/dbc/value/CharacterLargeObject.scala index ac6b8c0092..16a4ad0356 100644 --- a/src/dbc/scala/dbc/value/CharacterLargeObject.scala +++ b/src/dbc/scala/dbc/value/CharacterLargeObject.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/CharacterVarying.scala b/src/dbc/scala/dbc/value/CharacterVarying.scala index 4b697d4b25..7991e4ffcd 100644 --- a/src/dbc/scala/dbc/value/CharacterVarying.scala +++ b/src/dbc/scala/dbc/value/CharacterVarying.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/Conversion.scala b/src/dbc/scala/dbc/value/Conversion.scala index d1c898ce7b..dcd3e0ec0e 100644 --- a/src/dbc/scala/dbc/value/Conversion.scala +++ b/src/dbc/scala/dbc/value/Conversion.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/ExactNumeric.scala b/src/dbc/scala/dbc/value/ExactNumeric.scala index c898220f9c..cee219e15a 100644 --- a/src/dbc/scala/dbc/value/ExactNumeric.scala +++ b/src/dbc/scala/dbc/value/ExactNumeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/Factory.scala b/src/dbc/scala/dbc/value/Factory.scala index fa0245d721..06e4bfb466 100644 --- a/src/dbc/scala/dbc/value/Factory.scala +++ b/src/dbc/scala/dbc/value/Factory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/value/Unknown.scala b/src/dbc/scala/dbc/value/Unknown.scala index e32b91a137..46e8a39e42 100644 --- a/src/dbc/scala/dbc/value/Unknown.scala +++ b/src/dbc/scala/dbc/value/Unknown.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/dbc/scala/dbc/vendor/PostgreSQL.scala b/src/dbc/scala/dbc/vendor/PostgreSQL.scala index 0482aa425f..5962bb2fdd 100644 --- a/src/dbc/scala/dbc/vendor/PostgreSQL.scala +++ b/src/dbc/scala/dbc/vendor/PostgreSQL.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.dbc diff --git a/src/fjbg/ch/epfl/lamp/fjbg/FJBGContext.java b/src/fjbg/ch/epfl/lamp/fjbg/FJBGContext.java index a2eb6e7fa1..569a9ac272 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/FJBGContext.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/FJBGContext.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JAccessFlags.java b/src/fjbg/ch/epfl/lamp/fjbg/JAccessFlags.java index 8df4f9350e..7db047ee98 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JAccessFlags.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JAccessFlags.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JArrayType.java b/src/fjbg/ch/epfl/lamp/fjbg/JArrayType.java index 85662428b6..53aeee3ab6 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JArrayType.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JArrayType.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JAttribute.java b/src/fjbg/ch/epfl/lamp/fjbg/JAttribute.java index 981fbfc645..caaff778ec 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JAttribute.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JAttribute.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JAttributeFactory.java b/src/fjbg/ch/epfl/lamp/fjbg/JAttributeFactory.java index a0f575e7d0..92333dc4b4 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JAttributeFactory.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JAttributeFactory.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JClass.java b/src/fjbg/ch/epfl/lamp/fjbg/JClass.java index 1542bb1104..0fc604424a 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JClass.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JClass.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JCode.java b/src/fjbg/ch/epfl/lamp/fjbg/JCode.java index 252186a18e..f7d275c8a7 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JCode.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JCode.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JCodeAttribute.java b/src/fjbg/ch/epfl/lamp/fjbg/JCodeAttribute.java index 79afaded44..44a3d551aa 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JCodeAttribute.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JCodeAttribute.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JCodeIterator.java b/src/fjbg/ch/epfl/lamp/fjbg/JCodeIterator.java index d4effed412..34b38c828d 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JCodeIterator.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JCodeIterator.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java b/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java index 0e6b43f1e2..0df4498d8e 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JExtendedCode.java b/src/fjbg/ch/epfl/lamp/fjbg/JExtendedCode.java index 6ee18a59df..523f960b23 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JExtendedCode.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JExtendedCode.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JField.java b/src/fjbg/ch/epfl/lamp/fjbg/JField.java index d94bf8c64f..2c1e3063bf 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JField.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JField.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JFieldOrMethod.java b/src/fjbg/ch/epfl/lamp/fjbg/JFieldOrMethod.java index bf82015c42..fec7310bdf 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JFieldOrMethod.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JFieldOrMethod.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JLabel.java b/src/fjbg/ch/epfl/lamp/fjbg/JLabel.java index a8ba479c7b..39d7147c42 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JLabel.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JLabel.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JLineNumberTableAttribute.java b/src/fjbg/ch/epfl/lamp/fjbg/JLineNumberTableAttribute.java index 2ca4a73252..1403c34cf2 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JLineNumberTableAttribute.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JLineNumberTableAttribute.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JLocalVariable.java b/src/fjbg/ch/epfl/lamp/fjbg/JLocalVariable.java index b708a37e3c..9cbc8bb08a 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JLocalVariable.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JLocalVariable.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JMember.java b/src/fjbg/ch/epfl/lamp/fjbg/JMember.java index f2378cf473..8d082fb90d 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JMember.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JMember.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JMethod.java b/src/fjbg/ch/epfl/lamp/fjbg/JMethod.java index dbddf6547d..804b4314f2 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JMethod.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JMethod.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JMethodType.java b/src/fjbg/ch/epfl/lamp/fjbg/JMethodType.java index de136bf53d..ec44967e27 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JMethodType.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JMethodType.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JObjectType.java b/src/fjbg/ch/epfl/lamp/fjbg/JObjectType.java index a1930f77ef..b4edb86fec 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JObjectType.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JObjectType.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JOpcode.java b/src/fjbg/ch/epfl/lamp/fjbg/JOpcode.java index 6b6d3b6a74..f7ee688784 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JOpcode.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JOpcode.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JOtherAttribute.java b/src/fjbg/ch/epfl/lamp/fjbg/JOtherAttribute.java index ad73540940..7a64f91ee9 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JOtherAttribute.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JOtherAttribute.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JReferenceType.java b/src/fjbg/ch/epfl/lamp/fjbg/JReferenceType.java index 99c6acff71..0ed6ef4dea 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JReferenceType.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JReferenceType.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JSourceFileAttribute.java b/src/fjbg/ch/epfl/lamp/fjbg/JSourceFileAttribute.java index 77d6783c87..e4478728ae 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JSourceFileAttribute.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JSourceFileAttribute.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JType.java b/src/fjbg/ch/epfl/lamp/fjbg/JType.java index 2557d45b83..b926a59f5a 100644 --- a/src/fjbg/ch/epfl/lamp/fjbg/JType.java +++ b/src/fjbg/ch/epfl/lamp/fjbg/JType.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.fjbg; diff --git a/src/fjbg/ch/epfl/lamp/util/ByteArray.java b/src/fjbg/ch/epfl/lamp/util/ByteArray.java index 800fc9d0d8..d6b70485bc 100644 --- a/src/fjbg/ch/epfl/lamp/util/ByteArray.java +++ b/src/fjbg/ch/epfl/lamp/util/ByteArray.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.util; diff --git a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java b/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java index e6c0fa7bb4..dc1a6bcccc 100644 --- a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java +++ b/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java @@ -1031,9 +1031,10 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { return (Unsafe) f.get(null); } - private static long fieldOffset(String fieldName) + private static long fieldOffset(String fieldName, Unsafe unsafe) throws NoSuchFieldException { - return _unsafe.objectFieldOffset + // do not use _unsafe to avoid NPE + return unsafe.objectFieldOffset (ForkJoinTask.class.getDeclaredField(fieldName)); } @@ -1041,12 +1042,22 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { static final long statusOffset; static { + Unsafe tmpUnsafe = null; + long tmpStatusOffset = 0; try { - _unsafe = getUnsafe(); - statusOffset = fieldOffset("status"); + tmpUnsafe = getUnsafe(); + tmpStatusOffset = fieldOffset("status", tmpUnsafe); } catch (Throwable e) { - throw new RuntimeException("Could not initialize intrinsics", e); + // Ignore the failure to load sun.misc.Unsafe on Android so + // that platform can use the actor library without the + // fork/join scheduler. + String vmVendor = System.getProperty("java.vm.vendor"); + if (!vmVendor.contains("Android")) { + throw new RuntimeException("Could not initialize intrinsics", e); + } } + _unsafe = tmpUnsafe; + statusOffset = tmpStatusOffset; } } diff --git a/src/library/scala/Annotation.scala b/src/library/scala/Annotation.scala index 466983c481..8c75e15a79 100644 --- a/src/library/scala/Annotation.scala +++ b/src/library/scala/Annotation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Application.scala b/src/library/scala/Application.scala index fdb122f5bf..efc64191ae 100644 --- a/src/library/scala/Application.scala +++ b/src/library/scala/Application.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index c9d929b88c..9712990d73 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Cell.scala b/src/library/scala/Cell.scala index e4fb77bd77..0e054d5a4f 100644 --- a/src/library/scala/Cell.scala +++ b/src/library/scala/Cell.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/ClassfileAnnotation.scala b/src/library/scala/ClassfileAnnotation.scala index c6a207da41..b762d71a97 100644 --- a/src/library/scala/ClassfileAnnotation.scala +++ b/src/library/scala/ClassfileAnnotation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala index fc33fa07ef..0f2a76cbc5 100644 --- a/src/library/scala/Console.scala +++ b/src/library/scala/Console.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/CountedIterator.scala b/src/library/scala/CountedIterator.scala index 17899d53e8..3aff6f2f9b 100644 --- a/src/library/scala/CountedIterator.scala +++ b/src/library/scala/CountedIterator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala index 8d9438b749..cbfbee1f35 100644 --- a/src/library/scala/Either.scala +++ b/src/library/scala/Either.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala index 3c8f5cf0bd..5d1a0997ed 100644 --- a/src/library/scala/Enumeration.scala +++ b/src/library/scala/Enumeration.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala @@ -231,7 +230,7 @@ abstract class Enumeration(initial: Int, names: String*) { thisenum => case that: thisenum.Value => compare(that) == 0 case _ => false } - override def hashCode: Int = id.hashCode + override def hashCode: Int = id.## /** this enumeration value as an <code>Int</code> bit mask. * @throws IllegalArgumentException if <code>id</code> is greater than 31 diff --git a/src/library/scala/Equals.scala b/src/library/scala/Equals.scala index e48d909804..2bb2c56834 100644 --- a/src/library/scala/Equals.scala +++ b/src/library/scala/Equals.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Function.scala b/src/library/scala/Function.scala index 6ef137aa2b..d2f79bb270 100644 --- a/src/library/scala/Function.scala +++ b/src/library/scala/Function.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Function0.scala b/src/library/scala/Function0.scala index a946c3ad13..c6f81064b6 100644 --- a/src/library/scala/Function0.scala +++ b/src/library/scala/Function0.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with fancy comment) diff --git a/src/library/scala/Function1.scala b/src/library/scala/Function1.scala index 418bb4bdbf..a6a6fa2828 100644 --- a/src/library/scala/Function1.scala +++ b/src/library/scala/Function1.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with fancy comment) (with extra methods) diff --git a/src/library/scala/Function10.scala b/src/library/scala/Function10.scala index 9435d65dd7..c009fb5c48 100644 --- a/src/library/scala/Function10.scala +++ b/src/library/scala/Function10.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function11.scala b/src/library/scala/Function11.scala index 1d0e3cd1e5..3c3c79db3a 100644 --- a/src/library/scala/Function11.scala +++ b/src/library/scala/Function11.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function12.scala b/src/library/scala/Function12.scala index 4ca33acdb0..3cb2d4bb6f 100644 --- a/src/library/scala/Function12.scala +++ b/src/library/scala/Function12.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function13.scala b/src/library/scala/Function13.scala index d128d396da..5ec61d86fc 100644 --- a/src/library/scala/Function13.scala +++ b/src/library/scala/Function13.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function14.scala b/src/library/scala/Function14.scala index d9adef9374..8624464f48 100644 --- a/src/library/scala/Function14.scala +++ b/src/library/scala/Function14.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function15.scala b/src/library/scala/Function15.scala index dbe1cf870a..beeaa0b55e 100644 --- a/src/library/scala/Function15.scala +++ b/src/library/scala/Function15.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function16.scala b/src/library/scala/Function16.scala index 72f8eff82b..43ffcee0f3 100644 --- a/src/library/scala/Function16.scala +++ b/src/library/scala/Function16.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function17.scala b/src/library/scala/Function17.scala index 523a35c70d..1bd5532f7d 100644 --- a/src/library/scala/Function17.scala +++ b/src/library/scala/Function17.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function18.scala b/src/library/scala/Function18.scala index df68bafee7..31641d9496 100644 --- a/src/library/scala/Function18.scala +++ b/src/library/scala/Function18.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function19.scala b/src/library/scala/Function19.scala index 609aeaa1fe..92d855666e 100644 --- a/src/library/scala/Function19.scala +++ b/src/library/scala/Function19.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function2.scala b/src/library/scala/Function2.scala index b8cbe19881..334cc530bc 100644 --- a/src/library/scala/Function2.scala +++ b/src/library/scala/Function2.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with fancy comment) (with extra methods) diff --git a/src/library/scala/Function20.scala b/src/library/scala/Function20.scala index f84649d4d5..f3ddc31474 100644 --- a/src/library/scala/Function20.scala +++ b/src/library/scala/Function20.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function21.scala b/src/library/scala/Function21.scala index ef8095aebd..dcb500732f 100644 --- a/src/library/scala/Function21.scala +++ b/src/library/scala/Function21.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function22.scala b/src/library/scala/Function22.scala index a3347e996f..9e3f3c9f8f 100644 --- a/src/library/scala/Function22.scala +++ b/src/library/scala/Function22.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function3.scala b/src/library/scala/Function3.scala index 5f1c289853..2afc6acd4c 100644 --- a/src/library/scala/Function3.scala +++ b/src/library/scala/Function3.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function4.scala b/src/library/scala/Function4.scala index 664b75fb40..c0708d8c06 100644 --- a/src/library/scala/Function4.scala +++ b/src/library/scala/Function4.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function5.scala b/src/library/scala/Function5.scala index 94aba5eb9c..0c318f6317 100644 --- a/src/library/scala/Function5.scala +++ b/src/library/scala/Function5.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function6.scala b/src/library/scala/Function6.scala index 297f3e074e..0e77fbd2ce 100644 --- a/src/library/scala/Function6.scala +++ b/src/library/scala/Function6.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function7.scala b/src/library/scala/Function7.scala index bc053f7838..4cfdf1962a 100644 --- a/src/library/scala/Function7.scala +++ b/src/library/scala/Function7.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function8.scala b/src/library/scala/Function8.scala index d645a8d695..92d7f217fd 100644 --- a/src/library/scala/Function8.scala +++ b/src/library/scala/Function8.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Function9.scala b/src/library/scala/Function9.scala index e220537708..0223ac57f7 100644 --- a/src/library/scala/Function9.scala +++ b/src/library/scala/Function9.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Immutable.scala b/src/library/scala/Immutable.scala index bc0a6100f6..56511df29a 100644 --- a/src/library/scala/Immutable.scala +++ b/src/library/scala/Immutable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/LowPriorityImplicits.scala b/src/library/scala/LowPriorityImplicits.scala index 899dbe27d7..6fdf977dd4 100644 --- a/src/library/scala/LowPriorityImplicits.scala +++ b/src/library/scala/LowPriorityImplicits.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala @@ -49,6 +48,7 @@ class LowPriorityImplicits { } /** Can go away after next newstarr */ + /** Caution - not yet. pos/t1459, pos/t2569, jvm/t1342 all fail without the next line. */ def wrapArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = new WrappedArray.ofRef[T](xs) def wrapArray(xs: Array[Int]): WrappedArray[Int] = new WrappedArray.ofInt(xs) def wrapArray(xs: Array[Double]): WrappedArray[Double] = new WrappedArray.ofDouble(xs) diff --git a/src/library/scala/MatchError.scala b/src/library/scala/MatchError.scala index da065686f3..31783da4d3 100644 --- a/src/library/scala/MatchError.scala +++ b/src/library/scala/MatchError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Math.scala b/src/library/scala/Math.scala index 3c11958053..69a3985871 100644 --- a/src/library/scala/Math.scala +++ b/src/library/scala/Math.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/MathCommon.scala b/src/library/scala/MathCommon.scala index 9b4727b7c7..a72fc0e4ee 100644 --- a/src/library/scala/MathCommon.scala +++ b/src/library/scala/MathCommon.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Mutable.scala b/src/library/scala/Mutable.scala index be46764f0f..92db95261f 100644 --- a/src/library/scala/Mutable.scala +++ b/src/library/scala/Mutable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/NotDefinedError.scala b/src/library/scala/NotDefinedError.scala index a47613fb9a..3694f28c02 100644 --- a/src/library/scala/NotDefinedError.scala +++ b/src/library/scala/NotDefinedError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/NotNull.scala b/src/library/scala/NotNull.scala index d5f14459ff..8e4a29f06e 100644 --- a/src/library/scala/NotNull.scala +++ b/src/library/scala/NotNull.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index f2da220775..8992024353 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/PartialFunction.scala b/src/library/scala/PartialFunction.scala index f450596e57..41c2ac70e7 100644 --- a/src/library/scala/PartialFunction.scala +++ b/src/library/scala/PartialFunction.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 2037705bab..502fe4a935 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala index a0503cfe4c..b7dd6cf728 100644 --- a/src/library/scala/Product.scala +++ b/src/library/scala/Product.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala @@ -29,21 +28,6 @@ trait Product extends Equals { */ def productElement(n: Int): Any - // !!! This will be disabled pending reimplementation, but it can't be removed - // until starr forgets about it. - - /** Returns the name of the field at the given index from the definition - * of the class. - * - * @param n the index of the element name to return - * @throws NoSuchElementException if the name data is unavailable for any reason - * @throws IndexOutOfBoundsException if the index is out of range - * @return a String representing the field name - */ - def productElementName(n: Int): String = - // the method implementation is synthetic - if it is not generated we always throw. - throw new NoSuchElementException() - /** return k for a product <code>A(x_1,...,x_k)</code> */ def productArity: Int diff --git a/src/library/scala/Product1.scala b/src/library/scala/Product1.scala index 2e57b85104..f90d720c33 100644 --- a/src/library/scala/Product1.scala +++ b/src/library/scala/Product1.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product10.scala b/src/library/scala/Product10.scala index 7452e242ea..3cdcaf190c 100644 --- a/src/library/scala/Product10.scala +++ b/src/library/scala/Product10.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product11.scala b/src/library/scala/Product11.scala index e105393934..20004258dc 100644 --- a/src/library/scala/Product11.scala +++ b/src/library/scala/Product11.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product12.scala b/src/library/scala/Product12.scala index bf2b9437ec..0f069a2973 100644 --- a/src/library/scala/Product12.scala +++ b/src/library/scala/Product12.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product13.scala b/src/library/scala/Product13.scala index 2278f96dd9..5abae53eae 100644 --- a/src/library/scala/Product13.scala +++ b/src/library/scala/Product13.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product14.scala b/src/library/scala/Product14.scala index e194d36822..818d80ae04 100644 --- a/src/library/scala/Product14.scala +++ b/src/library/scala/Product14.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product15.scala b/src/library/scala/Product15.scala index a2bc70b6ce..e36985614d 100644 --- a/src/library/scala/Product15.scala +++ b/src/library/scala/Product15.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product16.scala b/src/library/scala/Product16.scala index 5ee44729ec..6881b33227 100644 --- a/src/library/scala/Product16.scala +++ b/src/library/scala/Product16.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product17.scala b/src/library/scala/Product17.scala index c1146b18cf..727c90c0fc 100644 --- a/src/library/scala/Product17.scala +++ b/src/library/scala/Product17.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product18.scala b/src/library/scala/Product18.scala index 40ddcdd7d6..4f05b54a08 100644 --- a/src/library/scala/Product18.scala +++ b/src/library/scala/Product18.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product19.scala b/src/library/scala/Product19.scala index 1b1edf6498..ada6f9e950 100644 --- a/src/library/scala/Product19.scala +++ b/src/library/scala/Product19.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product2.scala b/src/library/scala/Product2.scala index 0430341f78..9811a7b110 100644 --- a/src/library/scala/Product2.scala +++ b/src/library/scala/Product2.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product20.scala b/src/library/scala/Product20.scala index 497d7a6796..9b6bb09892 100644 --- a/src/library/scala/Product20.scala +++ b/src/library/scala/Product20.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product21.scala b/src/library/scala/Product21.scala index 5fd0d269f8..bf834c2571 100644 --- a/src/library/scala/Product21.scala +++ b/src/library/scala/Product21.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product22.scala b/src/library/scala/Product22.scala index 998ced16aa..1b32785ec1 100644 --- a/src/library/scala/Product22.scala +++ b/src/library/scala/Product22.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product3.scala b/src/library/scala/Product3.scala index d54b179806..f366782268 100644 --- a/src/library/scala/Product3.scala +++ b/src/library/scala/Product3.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product4.scala b/src/library/scala/Product4.scala index c24b013124..dbd96da077 100644 --- a/src/library/scala/Product4.scala +++ b/src/library/scala/Product4.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product5.scala b/src/library/scala/Product5.scala index de73d2b797..9a34d38722 100644 --- a/src/library/scala/Product5.scala +++ b/src/library/scala/Product5.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product6.scala b/src/library/scala/Product6.scala index 41b9fac951..50eb0a4532 100644 --- a/src/library/scala/Product6.scala +++ b/src/library/scala/Product6.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product7.scala b/src/library/scala/Product7.scala index 8137978f2b..c7b7919687 100644 --- a/src/library/scala/Product7.scala +++ b/src/library/scala/Product7.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product8.scala b/src/library/scala/Product8.scala index c23b50a330..e1afb0d007 100644 --- a/src/library/scala/Product8.scala +++ b/src/library/scala/Product8.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Product9.scala b/src/library/scala/Product9.scala index 09a7b210c3..0f904c6e3d 100644 --- a/src/library/scala/Product9.scala +++ b/src/library/scala/Product9.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Proxy.scala b/src/library/scala/Proxy.scala index fa5c0016ad..feac5904a5 100644 --- a/src/library/scala/Proxy.scala +++ b/src/library/scala/Proxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala @@ -22,7 +21,7 @@ package scala */ trait Proxy { def self: Any - override def hashCode: Int = self.hashCode + override def hashCode: Int = self.## override def equals(that: Any): Boolean = if(that == null) false else that equals self diff --git a/src/library/scala/Responder.scala b/src/library/scala/Responder.scala index c3c42bc757..f86f883894 100644 --- a/src/library/scala/Responder.scala +++ b/src/library/scala/Responder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/ScalaObject.scala b/src/library/scala/ScalaObject.scala index 0f1d1a6eb7..fe6778792f 100644 --- a/src/library/scala/ScalaObject.scala +++ b/src/library/scala/ScalaObject.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/SerialVersionUID.scala b/src/library/scala/SerialVersionUID.scala index e5ea23726b..0a2e29c934 100644 --- a/src/library/scala/SerialVersionUID.scala +++ b/src/library/scala/SerialVersionUID.scala @@ -6,7 +6,6 @@ ** |/ ** */ -// $Id$ package scala diff --git a/src/library/scala/StaticAnnotation.scala b/src/library/scala/StaticAnnotation.scala index 9e0cab393e..a1c3828173 100644 --- a/src/library/scala/StaticAnnotation.scala +++ b/src/library/scala/StaticAnnotation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Symbol.scala b/src/library/scala/Symbol.scala index 0c347b07b9..9463a186b6 100644 --- a/src/library/scala/Symbol.scala +++ b/src/library/scala/Symbol.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/Tuple1.scala b/src/library/scala/Tuple1.scala index 2fef979510..74de5bf688 100644 --- a/src/library/scala/Tuple1.scala +++ b/src/library/scala/Tuple1.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple10.scala b/src/library/scala/Tuple10.scala index 18f9dd6766..5fc0e9fec3 100644 --- a/src/library/scala/Tuple10.scala +++ b/src/library/scala/Tuple10.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple11.scala b/src/library/scala/Tuple11.scala index 94880ce240..c27cddfcc4 100644 --- a/src/library/scala/Tuple11.scala +++ b/src/library/scala/Tuple11.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple12.scala b/src/library/scala/Tuple12.scala index fa0c1128d9..0d78fd7e46 100644 --- a/src/library/scala/Tuple12.scala +++ b/src/library/scala/Tuple12.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple13.scala b/src/library/scala/Tuple13.scala index c858a42d29..955a8e914a 100644 --- a/src/library/scala/Tuple13.scala +++ b/src/library/scala/Tuple13.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple14.scala b/src/library/scala/Tuple14.scala index cdeecb36f9..524166896f 100644 --- a/src/library/scala/Tuple14.scala +++ b/src/library/scala/Tuple14.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple15.scala b/src/library/scala/Tuple15.scala index 316edff038..2b88e353bd 100644 --- a/src/library/scala/Tuple15.scala +++ b/src/library/scala/Tuple15.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple16.scala b/src/library/scala/Tuple16.scala index 3ad584da11..ace0d731c0 100644 --- a/src/library/scala/Tuple16.scala +++ b/src/library/scala/Tuple16.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple17.scala b/src/library/scala/Tuple17.scala index 176022e4cc..a2e77aa9cb 100644 --- a/src/library/scala/Tuple17.scala +++ b/src/library/scala/Tuple17.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple18.scala b/src/library/scala/Tuple18.scala index 96a9736e14..58835c861f 100644 --- a/src/library/scala/Tuple18.scala +++ b/src/library/scala/Tuple18.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple19.scala b/src/library/scala/Tuple19.scala index 428103ef14..abb4f248ec 100644 --- a/src/library/scala/Tuple19.scala +++ b/src/library/scala/Tuple19.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple2.scala b/src/library/scala/Tuple2.scala index fb685096a3..39d8f6bb1d 100644 --- a/src/library/scala/Tuple2.scala +++ b/src/library/scala/Tuple2.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Tuple20.scala b/src/library/scala/Tuple20.scala index bbfdaf3d8e..683c04de69 100644 --- a/src/library/scala/Tuple20.scala +++ b/src/library/scala/Tuple20.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple21.scala b/src/library/scala/Tuple21.scala index ecb02f6558..6f20fca435 100644 --- a/src/library/scala/Tuple21.scala +++ b/src/library/scala/Tuple21.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple22.scala b/src/library/scala/Tuple22.scala index 31d46b7bf2..b8a8a624d1 100644 --- a/src/library/scala/Tuple22.scala +++ b/src/library/scala/Tuple22.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple3.scala b/src/library/scala/Tuple3.scala index ced364f29d..1621d94968 100644 --- a/src/library/scala/Tuple3.scala +++ b/src/library/scala/Tuple3.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 (with extra methods) diff --git a/src/library/scala/Tuple4.scala b/src/library/scala/Tuple4.scala index 388e289647..79fc125502 100644 --- a/src/library/scala/Tuple4.scala +++ b/src/library/scala/Tuple4.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple5.scala b/src/library/scala/Tuple5.scala index b2fb4d23a3..b441fd8961 100644 --- a/src/library/scala/Tuple5.scala +++ b/src/library/scala/Tuple5.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple6.scala b/src/library/scala/Tuple6.scala index 2849e7222d..0e2d0e277e 100644 --- a/src/library/scala/Tuple6.scala +++ b/src/library/scala/Tuple6.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple7.scala b/src/library/scala/Tuple7.scala index c19232eeb2..9f62c1900a 100644 --- a/src/library/scala/Tuple7.scala +++ b/src/library/scala/Tuple7.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple8.scala b/src/library/scala/Tuple8.scala index a6d02c5030..9891797aa4 100644 --- a/src/library/scala/Tuple8.scala +++ b/src/library/scala/Tuple8.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/Tuple9.scala b/src/library/scala/Tuple9.scala index 9349695f42..28a39be444 100644 --- a/src/library/scala/Tuple9.scala +++ b/src/library/scala/Tuple9.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/TypeConstraint.scala b/src/library/scala/TypeConstraint.scala index c1e77c77f1..1cb7e55823 100644 --- a/src/library/scala/TypeConstraint.scala +++ b/src/library/scala/TypeConstraint.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/UninitializedError.scala b/src/library/scala/UninitializedError.scala index 9c2c31d99f..f130c7c0c4 100644 --- a/src/library/scala/UninitializedError.scala +++ b/src/library/scala/UninitializedError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/UninitializedFieldError.scala b/src/library/scala/UninitializedFieldError.scala index 2b805e0b2c..1d6799ec6f 100644 --- a/src/library/scala/UninitializedFieldError.scala +++ b/src/library/scala/UninitializedFieldError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/cloneable.scala b/src/library/scala/cloneable.scala index 1827fec024..9becd3f231 100644 --- a/src/library/scala/cloneable.scala +++ b/src/library/scala/cloneable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/collection/BitSet.scala b/src/library/scala/collection/BitSet.scala index e362271f70..9a56b47e93 100644 --- a/src/library/scala/collection/BitSet.scala +++ b/src/library/scala/collection/BitSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/BitSetLike.scala b/src/library/scala/collection/BitSetLike.scala index b4e9682d88..0202c81513 100644 --- a/src/library/scala/collection/BitSetLike.scala +++ b/src/library/scala/collection/BitSetLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/BufferedIterator.scala b/src/library/scala/collection/BufferedIterator.scala index a86380b2a1..ab56d9377f 100644 --- a/src/library/scala/collection/BufferedIterator.scala +++ b/src/library/scala/collection/BufferedIterator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/DefaultMap.scala b/src/library/scala/collection/DefaultMap.scala index 4ac4ad66c5..046e96d9b6 100644 --- a/src/library/scala/collection/DefaultMap.scala +++ b/src/library/scala/collection/DefaultMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/IndexedSeq.scala b/src/library/scala/collection/IndexedSeq.scala index 78165cb242..8c2eef65cd 100644 --- a/src/library/scala/collection/IndexedSeq.scala +++ b/src/library/scala/collection/IndexedSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/IndexedSeqLike.scala b/src/library/scala/collection/IndexedSeqLike.scala index 7bfad167c6..1ad1da715d 100644 --- a/src/library/scala/collection/IndexedSeqLike.scala +++ b/src/library/scala/collection/IndexedSeqLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -69,14 +68,14 @@ trait IndexedSeqLike[+A, +Repr] extends SeqLike[A, Repr] { self => * '''Note:''' `drop` is overridden to enable fast searching in the middle of indexed sequences. */ override def drop(n: Int): Iterator[A] = - if (n > 0) new Elements(start + n, end) else this + if (n > 0) new Elements(i + n, end) else this /** $super * '''Note:''' `take` is overridden to be symmetric to `drop`. */ override def take(n: Int): Iterator[A] = if (n <= 0) Iterator.empty.buffered - else if (start + n < end) new Elements(start, start + n) + else if (i + n < end) new Elements(i, i + n) else this } diff --git a/src/library/scala/collection/IndexedSeqOptimized.scala b/src/library/scala/collection/IndexedSeqOptimized.scala index 9702297a57..6360de33f1 100755 --- a/src/library/scala/collection/IndexedSeqOptimized.scala +++ b/src/library/scala/collection/IndexedSeqOptimized.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: IndexedSeqLike.scala 20129 2009-12-14 17:12:17Z odersky $ package scala.collection diff --git a/src/library/scala/collection/Iterable.scala b/src/library/scala/collection/Iterable.scala index 2baacec9f9..a25dd3df0a 100644 --- a/src/library/scala/collection/Iterable.scala +++ b/src/library/scala/collection/Iterable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index 06909961ce..ca149809b3 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection import generic._ diff --git a/src/library/scala/collection/IterableProxy.scala b/src/library/scala/collection/IterableProxy.scala index 23c2b40931..0827590856 100644 --- a/src/library/scala/collection/IterableProxy.scala +++ b/src/library/scala/collection/IterableProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/IterableProxyLike.scala b/src/library/scala/collection/IterableProxyLike.scala index fe148339b0..6193d30cba 100644 --- a/src/library/scala/collection/IterableProxyLike.scala +++ b/src/library/scala/collection/IterableProxyLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -16,9 +15,8 @@ import mutable.Buffer // Methods could be printed by cat IterableLike.scala | egrep '^ (override )?def' - -/** This trait implements a proxy for iterable objects. It forwards - * all calls to a different iterable object +/** This trait implements a proxy for Iterable objects. It forwards + * all calls to a different Iterable object. * * @author Martin Odersky * @version 2.8 @@ -26,8 +24,7 @@ import mutable.Buffer */ trait IterableProxyLike[+A, +Repr <: IterableLike[A, Repr] with Iterable[A]] extends IterableLike[A, Repr] - with TraversableProxyLike[A, Repr] -{ + with TraversableProxyLike[A, Repr] { override def iterator: Iterator[A] = self.iterator override def grouped(size: Int): Iterator[Repr] = self.grouped(size) override def sliding[B >: A](size: Int): Iterator[Repr] = self.sliding(size) diff --git a/src/library/scala/collection/IterableView.scala b/src/library/scala/collection/IterableView.scala index a6078bcdc8..faeb56c886 100644 --- a/src/library/scala/collection/IterableView.scala +++ b/src/library/scala/collection/IterableView.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/IterableViewLike.scala b/src/library/scala/collection/IterableViewLike.scala index 49fcee842c..77d3ac770b 100644 --- a/src/library/scala/collection/IterableViewLike.scala +++ b/src/library/scala/collection/IterableViewLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index 5eca806933..daa6a59f3b 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -828,7 +827,7 @@ trait Iterator[+A] extends TraversableOnce[A] { // if 0 elements are requested, or if the number of newly obtained // elements is less than the gap between sequences, we are done. def deliver(howMany: Int) = { - (howMany > 0 && len > gap) && { + (howMany > 0 && (isFirst || len > gap)) && { if (!isFirst) buffer trimStart (step min prevSize) diff --git a/src/library/scala/collection/JavaConversions.scala b/src/library/scala/collection/JavaConversions.scala index 20f44b7f21..c1a39e0332 100644 --- a/src/library/scala/collection/JavaConversions.scala +++ b/src/library/scala/collection/JavaConversions.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -24,9 +23,8 @@ package scala.collection * <li><code>scala.collection.Iterator</code> <=> <code>java.util.{ Iterator, Enumeration }</code></li> * <li><code>scala.collection.mutable.Buffer</code> <=> <code>java.util.List</code></li> * <li><code>scala.collection.mutable.Set</code> <=> <code>java.util.Set</code></li> - * <li><code>scala.collection.mutable.Map</code> <=> <code>java.util.Map</code></li> + * <li><code>scala.collection.mutable.Map</code> <=> <code>java.util.{ Map, Dictionary }</code></li> * <li><code>scala.collection.mutable.ConcurrentMap</code> <=> <code>java.util.concurrent.ConcurrentMap</code></li> - * <li><code>java.util.Properties</code></li> => <code>scala.collection.mutable.Map[String, String]</code></li> * </ul> * <p> * In all cases, converting from a source type to a target type and back @@ -40,24 +38,22 @@ package scala.collection * <b>val</b> sl2 : scala.collection.mutable.Buffer[Int] = jl * assert(sl eq sl2)g</pre> * <p> - * Note that no conversion is provided from <code>scala.collection.immutable.List</code> - * to <code>java.util.List</code>. Instead it is convertible to an immutable - * <code>java.util.Collection</code> which provides size and interaction - * capabilities, but not access by index as would be provided by - * <code>java.util.List</code>.<br/> - * This is intentional: in combination the implementation of - * <code>scala.collection.immutable.List</code> and the typical usage - * patterns of <code>java.util.List</code> would perform extremely poorly. + * In addition, the following one way conversions are provided: * </p> + * <ul> + * <li><code>scala.collection.Seq => <code>java.util.List }</code></li> + * <li><code>scala.collection.mutable.Seq => <code>java.util.List</code></li> + * <li><code>scala.collection.Set</code> => <code>java.util.Set</code></li> + * <li><code>scala.collection.Map</code> => <code>java.util.Map</code></li> + * </ul> * * @author Miles Sabin + * @author Martin Odersky * @since 2.8 */ object JavaConversions { import java.{ lang => jl, util => ju } import java.util.{ concurrent => juc } - import scala.collection.{ generic, immutable, mutable, Traversable } - import scala.reflect.ClassManifest // Scala => Java @@ -74,7 +70,7 @@ object JavaConversions { * @param i The <code>Iterator</code> to be converted. * @return A Java <code>Iterator</code> view of the argument. */ - implicit def asIterator[A](i : Iterator[A]) = i match { + implicit def asIterator[A](i : Iterator[A]): ju.Iterator[A] = i match { case JIteratorWrapper(wrapped) => wrapped case _ => IteratorWrapper(i) } @@ -92,7 +88,7 @@ object JavaConversions { * @param i The <code>Iterator</code> to be converted. * @return A Java <code>Enumeration</code> view of the argument. */ - implicit def asEnumeration[A](i : Iterator[A]) = i match { + implicit def asEnumeration[A](i : Iterator[A]): ju.Enumeration[A] = i match { case JEnumerationWrapper(wrapped) => wrapped case _ => IteratorWrapper(i) } @@ -110,7 +106,7 @@ object JavaConversions { * @param i The <code>Iterable</code> to be converted. * @return A Java <code>Iterable</code> view of the argument. */ - implicit def asIterable[A](i : Iterable[A]) = i match { + implicit def asIterable[A](i : Iterable[A]): jl.Iterable[A] = i match { case JIterableWrapper(wrapped) => wrapped case _ => IterableWrapper(i) } @@ -126,7 +122,7 @@ object JavaConversions { * @param i The <code>SizedIterable</code> to be converted. * @return A Java <code>Collection</code> view of the argument. */ - implicit def asCollection[A](i : Iterable[A]) = i match { + implicit def asCollection[A](i : Iterable[A]): ju.Collection[A] = i match { case JCollectionWrapper(wrapped) => wrapped case _ => new IterableWrapper(i) } @@ -144,12 +140,49 @@ object JavaConversions { * @param b The <code>Buffer</code> to be converted. * @return A Java <code>List</code> view of the argument. */ - implicit def asList[A](b : mutable.Buffer[A]) : ju.List[A] = b match { + implicit def asList[A](b : mutable.Buffer[A]): ju.List[A] = b match { case JListWrapper(wrapped) => wrapped case _ => new MutableBufferWrapper(b) } /** + * Implicitly converts a Scala mutable <code>Seq</code> to a Java <code>List</code>. + * The returned Java <code>List</code> is backed by the provided Scala + * <code>Seq</code> and any side-effects of using it via the Java interface will + * be visible via the Scala interface and vice versa. + * <p> + * If the Scala <code>Seq</code> was previously obtained from an implicit or + * explicit call of <code>asSeq(java.util.List)</code> then the original + * Java <code>List</code> will be returned. + * + * @param b The <code>Seq</code> to be converted. + * @return A Java <code>List</code> view of the argument. + */ + implicit def asList[A](b : mutable.Seq[A]): ju.List[A] = b match { + case JListWrapper(wrapped) => wrapped + case _ => new MutableSeqWrapper(b) + } + + /** + * Implicitly converts a Scala <code>Seq</code> to a Java <code>List</code>. + * The returned Java <code>List</code> is backed by the provided Scala + * <code>Seq</code> and any side-effects of using it via the Java interface will + * be visible via the Scala interface and vice versa. + * <p> + * If the Scala <code>Seq</code> was previously obtained from an implicit or + * explicit call of <code>asSeq(java.util.List)</code> then the original + * Java <code>List</code> will be returned. + * + * @param b The <code>Seq</code> to be converted. + * @return A Java <code>List</co * +de> view of the argument. + */ + implicit def asList[A](b : Seq[A]): ju.List[A] = b match { + case JListWrapper(wrapped) => wrapped + case _ => new SeqWrapper(b) + } + + /** * Implicitly converts a Scala mutable <code>Set</code> to a Java <code>Set</code>. * The returned Java <code>Set</code> is backed by the provided Scala * <code>Set</code> and any side-effects of using it via the Java interface will @@ -162,9 +195,27 @@ object JavaConversions { * @param s The <code>Set</code> to be converted. * @return A Java <code>Set</code> view of the argument. */ - implicit def asSet[A](s : mutable.Set[A])(implicit m : ClassManifest[A]) : ju.Set[A] = s match { + implicit def asSet[A](s : mutable.Set[A]): ju.Set[A] = s match { + case JSetWrapper(wrapped) => wrapped + case _ => new MutableSetWrapper(s) + } + + /** + * Implicitly converts a Scala <code>Set</code> to a Java <code>Set</code>. + * The returned Java <code>Set</code> is backed by the provided Scala + * <code>Set</code> and any side-effects of using it via the Java interface will + * be visible via the Scala interface and vice versa. + * <p> + * If the Scala <code>Set</code> was previously obtained from an implicit or + * explicit call of <code>asSet(java.util.Set)</code> then the original + * Java <code>Set</code> will be returned. + * + * @param s The <code>Set</code> to be converted. + * @return A Java <code>Set</code> view of the argument. + */ + implicit def asSet[A](s: Set[A]): ju.Set[A] = s match { case JSetWrapper(wrapped) => wrapped - case _ => new MutableSetWrapper(s)(m) + case _ => new SetWrapper(s) } /** @@ -180,10 +231,61 @@ object JavaConversions { * @param m The <code>Map</code> to be converted. * @return A Java <code>Map</code> view of the argument. */ - implicit def asMap[A, B](m : mutable.Map[A, B])(implicit ma : ClassManifest[A]) : ju.Map[A, B] = m match { + implicit def asMap[A, B](m : mutable.Map[A, B]): ju.Map[A, B] = m match { + //case JConcurrentMapWrapper(wrapped) => wrapped + case JMapWrapper(wrapped) => wrapped + case _ => new MutableMapWrapper(m) + } + + /** + * Implicitly converts a Scala mutable <code>Map</code> to a Java <code>Dictionary</code>. + * The returned Java <code>Dictionary</code> is backed by the provided Scala + * <code>Dictionary</code> and any side-effects of using it via the Java interface will + * be visible via the Scala interface and vice versa. + * <p> + * If the Scala <code>Dictionary</code> was previously obtained from an implicit or + * explicit call of <code>asMap(java.util.Dictionary)</code> then the original + * Java <code>Dictionary</code> will be returned. + * + * @param m The <code>Map</code> to be converted. + * @return A Java <code>Dictionary</code> view of the argument. + */ + implicit def asDictionary[A, B](m : mutable.Map[A, B]): ju.Dictionary[A, B] = m match { + //case JConcurrentMapWrapper(wrapped) => wrapped + case JDictionaryWrapper(wrapped) => wrapped + case _ => new DictionaryWrapper(m) + } + + /** + * Implicitly converts a Java <code>Properties</code> to a Scala mutable <code>Map[String, String]</code>. + * The returned Scala <code>Map[String, String]</code> is backed by the provided Java + * <code>Properties</code> and any side-effects of using it via the Scala interface will + * be visible via the Java interface and vice versa. + * + * @param m The <code>Properties</code> to be converted. + * @return A Scala mutable <code>Map[String, String]</code> view of the argument. + */ + implicit def asMap(p: ju.Properties): mutable.Map[String, String] = p match { + case _ => new JPropertiesWrapper(p) + } + + /** + * Implicitly converts a Scala <code>Map</code> to a Java <code>Map</code>. + * The returned Java <code>Map</code> is backed by the provided Scala + * <code>Map</code> and any side-effects of using it via the Java interface will + * be visible via the Scala interface and vice versa. + * <p> + * If the Scala <code>Map</code> was previously obtained from an implicit or + * explicit call of <code>asMap(java.util.Map)</code> then the original + * Java <code>Map</code> will be returned. + * + * @param m The <code>Map</code> to be converted. + * @return A Java <code>Map</code> view of the argument. + */ + implicit def asMap[A, B](m : Map[A, B]): ju.Map[A, B] = m match { //case JConcurrentMapWrapper(wrapped) => wrapped case JMapWrapper(wrapped) => wrapped - case _ => new MutableMapWrapper(m)(ma) + case _ => new MapWrapper(m) } /** @@ -196,10 +298,9 @@ object JavaConversions { * explicit call of <code>asConcurrentMap(java.util.concurrect.ConcurrentMap)</code> then the original * Java <code>ConcurrentMap</code> will be returned. */ - implicit def asConcurrentMap[A, B](m: mutable.ConcurrentMap[A, B]) - (implicit ma: ClassManifest[A], mb: ClassManifest[B]): juc.ConcurrentMap[A, B] = m match { + implicit def asConcurrentMap[A, B](m: mutable.ConcurrentMap[A, B]): juc.ConcurrentMap[A, B] = m match { case JConcurrentMapWrapper(wrapped) => wrapped - case _ => new ConcurrentMapWrapper(m)(ma, mb) + case _ => new ConcurrentMapWrapper(m) } // Java => Scala @@ -217,7 +318,7 @@ object JavaConversions { * @param i The <code>Iterator</code> to be converted. * @return A Scala <code>Iterator</code> view of the argument. */ - implicit def asIterator[A](i : ju.Iterator[A]) = i match { + implicit def asIterator[A](i : ju.Iterator[A]): Iterator[A] = i match { case IteratorWrapper(wrapped) => wrapped case _ => JIteratorWrapper(i) } @@ -235,7 +336,7 @@ object JavaConversions { * @param i The <code>Enumeration</code> to be converted. * @return A Scala <code>Iterator</code> view of the argument. */ - implicit def asIterator[A](i : ju.Enumeration[A]) = i match { + implicit def asIterator[A](i : ju.Enumeration[A]): Iterator[A] = i match { case IteratorWrapper(wrapped) => wrapped case _ => JEnumerationWrapper(i) } @@ -253,7 +354,7 @@ object JavaConversions { * @param i The <code>Iterable</code> to be converted. * @return A Scala <code>Iterable</code> view of the argument. */ - implicit def asIterable[A](i : jl.Iterable[A]) = i match { + implicit def asIterable[A](i : jl.Iterable[A]): Iterable[A] = i match { case IterableWrapper(wrapped) => wrapped case _ => JIterableWrapper(i) } @@ -268,7 +369,7 @@ object JavaConversions { * @param i The <code>Collection</code> to be converted. * @return A Scala <code>SizedIterable</code> view of the argument. */ - implicit def asIterable[A](i : ju.Collection[A]) = i match { + implicit def asIterable[A](i : ju.Collection[A]): Iterable[A] = i match { case IterableWrapper(wrapped) => wrapped case _ => JCollectionWrapper(i) } @@ -286,7 +387,7 @@ object JavaConversions { * @param l The <code>List</code> to be converted. * @return A Scala mutable <code>Buffer</code> view of the argument. */ - implicit def asBuffer[A](l : ju.List[A]) = l match { + implicit def asBuffer[A](l : ju.List[A]): mutable.Buffer[A] = l match { case MutableBufferWrapper(wrapped) => wrapped case _ =>new JListWrapper(l) } @@ -299,12 +400,12 @@ object JavaConversions { * <p> * If the Java <code>Set</code> was previously obtained from an implicit or * explicit call of <code>asSet(scala.collection.mutable.Set)</code> then the original - * Scala <code>Set</code> will be returned. + * ScalaThe reported problems have to do with dependent method types, which is currently an experimental feature in Scala and is still under development. We emphasize that these problems are related to type-inference and, as stated in the paper, it is possible to run and type-check the programs with additional annotations. <code>Set</code> will be returned. * * @param s The <code>Set</code> to be converted. * @return A Scala mutable <code>Set</code> view of the argument. */ - implicit def asSet[A](s : ju.Set[A]) = s match { + implicit def asSet[A](s : ju.Set[A]): mutable.Set[A] = s match { case MutableSetWrapper(wrapped) => wrapped case _ =>new JSetWrapper(s) } @@ -322,7 +423,7 @@ object JavaConversions { * @param m The <code>Map</code> to be converted. * @return A Scala mutable <code>Map</code> view of the argument. */ - implicit def asMap[A, B](m : ju.Map[A, B]) = m match { + implicit def asMap[A, B](m : ju.Map[A, B]): mutable.Map[A, B] = m match { //case ConcurrentMapWrapper(wrapped) => wrapped case MutableMapWrapper(wrapped) => wrapped case _ => new JMapWrapper(m) @@ -341,22 +442,23 @@ object JavaConversions { * @param m The <code>ConcurrentMap</code> to be converted. * @return A Scala mutable <code>ConcurrrentMap</code> view of the argument. */ - implicit def asConcurrentMap[A, B](m: juc.ConcurrentMap[A, B]) = m match { - case ConcurrentMapWrapper(wrapped) => wrapped + implicit def asConcurrentMap[A, B](m: juc.ConcurrentMap[A, B]): mutable.ConcurrentMap[A, B] = m match { + case cmw: ConcurrentMapWrapper[a, b] => cmw.underlying case _ => new JConcurrentMapWrapper(m) } /** - * Implicitly converts a Java <code>Properties</code> to a Scala mutable <code>Map[String, String]</code>. + * Implicitly converts a Java <code>Dictionary</code> to a Scala mutable <code>Map[String, String]</code>. * The returned Scala <code>Map[String, String]</code> is backed by the provided Java - * <code>Properties</code> and any side-effects of using it via the Scala interface will + * <code>Dictionary</code> and any side-effects of using it via the Scala interface will * be visible via the Java interface and vice versa. * - * @param m The <code>Properties</code> to be converted. + * @param m The <code>Dictionary</code> to be converted. * @return A Scala mutable <code>Map[String, String]</code> view of the argument. */ - implicit def asMap(p: ju.Properties): mutable.Map[String, String] = p match { - case _ => new JPropertiesWrapper(p) + implicit def asMap[A, B](p: ju.Dictionary[A, B]): mutable.Map[A, B] = p match { + case DictionaryWrapper(wrapped) => wrapped + case _ => new JDictionaryWrapper(p) } // Private implementations ... @@ -397,6 +499,17 @@ object JavaConversions { def newBuilder[B] = new mutable.ArrayBuffer[B] } + case class SeqWrapper[A](underlying : Seq[A]) extends ju.AbstractList[A] { + def size = underlying.length + def get(i : Int) = underlying(i) + } + + case class MutableSeqWrapper[A](underlying : mutable.Seq[A]) extends ju.AbstractList[A] { + def size = underlying.length + def get(i : Int) = underlying(i) + override def set(i : Int, elem: A) = { val p = underlying(i) ; underlying(i) = elem ; p } + } + case class MutableBufferWrapper[A](underlying : mutable.Buffer[A]) extends ju.AbstractList[A] { def size = underlying.length def get(i : Int) = underlying(i) @@ -419,29 +532,36 @@ object JavaConversions { def result = this } - case class MutableSetWrapper[A](underlying : mutable.Set[A])(m : ClassManifest[A]) extends ju.AbstractSet[A] { + class SetWrapper[A](underlying: Set[A]) extends ju.AbstractSet[A] { self => def size = underlying.size - override def add(elem: A) = { val sz = underlying.size ; underlying += elem ; sz < underlying.size } - override def remove(elem : AnyRef) = { - m.erasure.isInstance(elem) && { - val sz = underlying.size - underlying -= elem.asInstanceOf[A] - sz > underlying.size - } - } def iterator = new ju.Iterator[A] { val ui = underlying.iterator var prev : Option[A] = None - def hasNext = ui.hasNext def next = { val e = ui.next ; prev = Some(e) ; e } def remove = prev match { - case Some(e) => self.remove(e.asInstanceOf[AnyRef]) ; prev = None + case Some(e) => + self match { + case ms: mutable.Set[a] => + ms.remove(e.asInstanceOf[a]) + prev = None + case _ => + throw new UnsupportedOperationException("remove") + } case _ => throw new IllegalStateException("next must be called at least once before remove") } } + } + case class MutableSetWrapper[A](underlying : mutable.Set[A]) extends SetWrapper[A](underlying) { + override def add(elem: A) = { val sz = underlying.size ; underlying += elem ; sz < underlying.size } + override def remove(elem : AnyRef) = try { + underlying.remove(elem.asInstanceOf[A]) + } catch { + case ex: ClassCastException => false + } + override def clear() = underlying.clear() } case class JSetWrapper[A](underlying : ju.Set[A]) extends mutable.Set[A] with mutable.SetLike[A, JSetWrapper[A]] { @@ -456,35 +576,24 @@ object JavaConversions { override def add(elem: A): Boolean = underlying.add(elem) override def remove(elem: A): Boolean = underlying.remove(elem) - - override def clear = underlying.clear + override def clear() = underlying.clear() override def empty = JSetWrapper(new ju.HashSet[A]) } - abstract class MutableMapWrapperLike[A, B](underlying: mutable.Map[A, B])(m: ClassManifest[A]) - extends ju.AbstractMap[A, B] { - self => + class MapWrapper[A, B](underlying: Map[A, B]) extends ju.AbstractMap[A, B] { self => override def size = underlying.size - override def put(k : A, v : B) = underlying.put(k, v) match { - case Some(v1) => v1 - case None => null.asInstanceOf[B] - } - - override def remove(k : AnyRef) = { - if (!m.erasure.isInstance(k)) - null.asInstanceOf[B] - else { - val k1 = k.asInstanceOf[A] - underlying.get(k1) match { - case Some(v) => underlying -= k1 ; v - case None => null.asInstanceOf[B] - } + override def get(key: AnyRef): B = try { + underlying get key.asInstanceOf[A] match { + case None => null.asInstanceOf[B] + case Some(v) => v } + } catch { + case ex: ClassCastException => null.asInstanceOf[B] } - override def entrySet : ju.Set[ju.Map.Entry[A, B]] = new ju.AbstractSet[ju.Map.Entry[A, B]] { + override def entrySet: ju.Set[ju.Map.Entry[A, B]] = new ju.AbstractSet[ju.Map.Entry[A, B]] { def size = self.size def iterator = new ju.Iterator[ju.Map.Entry[A, B]] { @@ -508,15 +617,40 @@ object JavaConversions { } def remove = prev match { - case Some(k) => val v = self.remove(k.asInstanceOf[AnyRef]) ; prev = None ; v - case _ => throw new IllegalStateException("next must be called at least once before remove") + case Some(k) => + self match { + case mm: mutable.Map[a, _] => + val v = mm.remove(k.asInstanceOf[a]) + prev = None + v + case _ => + throw new UnsupportedOperationException("remove") + } + case _ => + throw new IllegalStateException("next must be called at least once before remove") } } } } - case class MutableMapWrapper[A, B](underlying : mutable.Map[A, B])(m : ClassManifest[A]) - extends MutableMapWrapperLike[A, B](underlying)(m) + case class MutableMapWrapper[A, B](underlying: mutable.Map[A, B]) + extends MapWrapper[A, B](underlying) { + override def put(k : A, v : B) = underlying.put(k, v) match { + case Some(v1) => v1 + case None => null.asInstanceOf[B] + } + + override def remove(k : AnyRef): B = try { + underlying.remove(k.asInstanceOf[A]) match { + case None => null.asInstanceOf[B] + case Some(v) => v + } + } catch { + case ex: ClassCastException => null.asInstanceOf[B] + } + + override def clear() = underlying.clear() + } trait JMapWrapperLike[A, B, +Repr <: mutable.MapLike[A, B, Repr] with mutable.Map[A, B]] extends mutable.Map[A, B] with mutable.MapLike[A, B, Repr] { @@ -555,7 +689,7 @@ object JavaConversions { def next = { val e = ui.next ; (e.getKey, e.getValue) } } - override def clear = underlying.clear + override def clear() = underlying.clear() override def empty: Repr = null.asInstanceOf[Repr] } @@ -565,36 +699,19 @@ object JavaConversions { override def empty = JMapWrapper(new ju.HashMap[A, B]) } - case class ConcurrentMapWrapper[A, B](underlying: mutable.ConcurrentMap[A, B]) - (m: ClassManifest[A], mv: ClassManifest[B]) - extends MutableMapWrapperLike[A, B](underlying)(m) with juc.ConcurrentMap[A, B] { - self => - - override def remove(k : AnyRef) = { - if (!m.erasure.isInstance(k)) - null.asInstanceOf[B] - else { - val k1 = k.asInstanceOf[A] - underlying.remove(k1) match { - case Some(v) => v - case None => null.asInstanceOf[B] - } - } - } + class ConcurrentMapWrapper[A, B](override val underlying: mutable.ConcurrentMap[A, B]) + extends MutableMapWrapper[A, B](underlying) with juc.ConcurrentMap[A, B] { def putIfAbsent(k: A, v: B) = underlying.putIfAbsent(k, v) match { case Some(v) => v case None => null.asInstanceOf[B] } - def remove(k: AnyRef, v: AnyRef) = { - if (!m.erasure.isInstance(k) || !mv.erasure.isInstance(v)) + def remove(k: AnyRef, v: AnyRef) = try { + underlying.remove(k.asInstanceOf[A], v.asInstanceOf[B]) + } catch { + case ex: ClassCastException => false - else { - val k1 = k.asInstanceOf[A] - val v1 = v.asInstanceOf[B] - underlying.remove(k1, v1) - } } def replace(k: A, v: B): B = underlying.replace(k, v) match { @@ -603,7 +720,6 @@ object JavaConversions { } def replace(k: A, oldval: B, newval: B) = underlying.replace(k, oldval, newval) - } case class JConcurrentMapWrapper[A, B](val underlying: juc.ConcurrentMap[A, B]) @@ -629,7 +745,64 @@ object JavaConversions { } def replace(k: A, oldvalue: B, newvalue: B): Boolean = underlying.replace(k, oldvalue, newvalue) + } + case class DictionaryWrapper[A, B](underlying: mutable.Map[A, B]) + extends ju.Dictionary[A, B] { + def size: Int = underlying.size + def isEmpty: Boolean = underlying.isEmpty + def keys: ju.Enumeration[A] = asEnumeration(underlying.keysIterator) + def elements: ju.Enumeration[B] = asEnumeration(underlying.valuesIterator) + def get(key: AnyRef) = try { + underlying.get(key.asInstanceOf[A]) match { + case None => null.asInstanceOf[B] + case Some(v) => v + } + } catch { + case ex: ClassCastException => null.asInstanceOf[B] + } + def put(key: A, value: B): B = underlying.put(key, value) match { + case Some(v) => v + case None => null.asInstanceOf[B] + } + override def remove(key: AnyRef) = try { + underlying.remove(key.asInstanceOf[A]) match { + case None => null.asInstanceOf[B] + case Some(v) => v + } + } catch { + case ex: ClassCastException => null.asInstanceOf[B] + } + } + + case class JDictionaryWrapper[A, B](underlying: ju.Dictionary[A, B]) + extends mutable.Map[A, B] { + + override def size: Int = underlying.size + + def get(k : A) = { + val v = underlying.get(k) + if (v != null) Some(v) else None + } + + def +=(kv: (A, B)): this.type = { underlying.put(kv._1, kv._2); this } + def -=(key: A): this.type = { underlying.remove(key); this } + + override def put(k : A, v : B): Option[B] = { + val r = underlying.put(k, v) + if (r != null) Some(r) else None + } + + override def update(k : A, v : B) { underlying.put(k, v) } + + override def remove(k : A): Option[B] = { + val r = underlying.remove(k) + if (r != null) Some(r) else None + } + + def iterator = asIterator(underlying.keys) map (k => (k, underlying get k)) + + override def clear() = underlying.clear() } case class JPropertiesWrapper(underlying: ju.Properties) @@ -665,7 +838,7 @@ object JavaConversions { def next = { val e = ui.next ; (e.getKey.asInstanceOf[String], e.getValue.asInstanceOf[String]) } } - override def clear = underlying.clear + override def clear() = underlying.clear() override def empty = JPropertiesWrapper(new ju.Properties) @@ -675,9 +848,5 @@ object JavaConversions { def setProperty(key: String, value: String) = underlying.setProperty(key, value) } - } - - - diff --git a/src/library/scala/collection/LinearSeq.scala b/src/library/scala/collection/LinearSeq.scala index ba0eb6a22d..1cd130eeb2 100644 --- a/src/library/scala/collection/LinearSeq.scala +++ b/src/library/scala/collection/LinearSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/LinearSeqLike.scala b/src/library/scala/collection/LinearSeqLike.scala index 208cbcdd50..c2c4996f47 100644 --- a/src/library/scala/collection/LinearSeqLike.scala +++ b/src/library/scala/collection/LinearSeqLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala index 2add28d7c3..abe8e2fa62 100755 --- a/src/library/scala/collection/LinearSeqOptimized.scala +++ b/src/library/scala/collection/LinearSeqOptimized.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: LinearSeqOptimized.scala 20608 2010-01-20 00:28:09Z extempore $ package scala.collection diff --git a/src/library/scala/collection/Map.scala b/src/library/scala/collection/Map.scala index 0722d55f03..b48acd0c4e 100644 --- a/src/library/scala/collection/Map.scala +++ b/src/library/scala/collection/Map.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala index 9bca2f09a0..fdaee64fd5 100644 --- a/src/library/scala/collection/MapLike.scala +++ b/src/library/scala/collection/MapLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -330,7 +329,7 @@ self => override /*PartialFunction*/ def toString = super[IterableLike].toString - override def hashCode() = this map (_.hashCode) sum + override def hashCode() = this map (_.##) sum /** Compares two maps structurally; i.e. checks if all mappings * contained in this map are also contained in the other map, diff --git a/src/library/scala/collection/MapProxy.scala b/src/library/scala/collection/MapProxy.scala index 9dce47846d..1cc7d81de4 100644 --- a/src/library/scala/collection/MapProxy.scala +++ b/src/library/scala/collection/MapProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/MapProxyLike.scala b/src/library/scala/collection/MapProxyLike.scala index f269a368dd..7ef1eb68ef 100644 --- a/src/library/scala/collection/MapProxyLike.scala +++ b/src/library/scala/collection/MapProxyLike.scala @@ -12,8 +12,8 @@ import generic._ // Methods could be printed by cat MapLike.scala | egrep '^ (override )?def' -/** This trait implements a proxy for iterable objects. It forwards - * all calls to a different iterable object +/** This trait implements a proxy for Map objects. It forwards + * all calls to a different Map object. * * @author Martin Odersky * @version 2.8 @@ -23,12 +23,10 @@ trait MapProxyLike[A, +B, +This <: MapLike[A, B, This] with Map[A, B]] extends MapLike[A, B, This] with IterableProxyLike[(A, B), This] { - // def empty: This - // def + [B1 >: B] (kv: (A, B1)): Map[A, B1] - // def - (key: A): This - override def get(key: A): Option[B] = self.get(key) override def iterator: Iterator[(A, B)] = self.iterator + override def + [B1 >: B] (kv: (A, B1)): Map[A, B1] = self.+(kv) + override def - (key: A): This = self.-(key) override def isEmpty: Boolean = self.isEmpty override def getOrElse[B1 >: B](key: A, default: => B1): B1 = self.getOrElse(key, default) override def apply(key: A): B = self.apply(key) @@ -42,11 +40,10 @@ trait MapProxyLike[A, +B, +This <: MapLike[A, B, This] with Map[A, B]] override def default(key: A): B = self.default(key) override def filterKeys(p: A => Boolean) = self.filterKeys(p) override def mapValues[C](f: B => C) = self.mapValues(f) - - // override def updated [B1 >: B](key: A, value: B1) = self + ((key, value)) - // override def + [B1 >: B](elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *) = self.+(elem1, elem2, elems: _*) - // override def ++[B1 >: B](elems: Traversable[(A, B1)]) = self.++(elems) - // override def ++[B1 >: B](iter: Iterator[(A, B1)]) = self.++(iter) + override def updated [B1 >: B](key: A, value: B1): Map[A, B1] = self.updated(key, value) + override def + [B1 >: B] (kv1: (A, B1), kv2: (A, B1), kvs: (A, B1) *): Map[A, B1] = self.+(kv1, kv2, kvs: _*) + override def ++[B1 >: B](xs: TraversableOnce[(A, B1)]): Map[A, B1] = self.++(xs) + override def filterNot(p: ((A, B)) => Boolean) = self filterNot p override def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder = self.addString(b, start, sep, end) diff --git a/src/library/scala/collection/Seq.scala b/src/library/scala/collection/Seq.scala index f6b89b67b8..2e8a1af99a 100644 --- a/src/library/scala/collection/Seq.scala +++ b/src/library/scala/collection/Seq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index 2774536886..8770de9c36 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -509,7 +508,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self => * @return the last index such that the elements of this $coll starting a this index * match the elements of sequence `that`, or `-1` of no such subsequence exists. */ - def lastIndexOfSlice[B >: A](that: Seq[B]): Int = lastIndexOfSlice(that, that.length) + def lastIndexOfSlice[B >: A](that: Seq[B]): Int = lastIndexOfSlice(that, length) /** Finds last index before or at a given end index where this $coll contains a given sequence as a slice. * @param that the sequence to test @@ -858,7 +857,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self => /** Hashcodes for $Coll produce a value from the hashcodes of all the * elements of the $coll. */ - override def hashCode() = (Seq.hashSeed /: this)(_ * 41 + _.hashCode) + override def hashCode() = (Seq.hashSeed /: this)(_ * 41 + _.##) override def equals(that: Any): Boolean = that match { case that: Seq[_] => (that canEqual this) && (this sameElements that) diff --git a/src/library/scala/collection/SeqProxy.scala b/src/library/scala/collection/SeqProxy.scala index 07657b8680..392ed15d79 100644 --- a/src/library/scala/collection/SeqProxy.scala +++ b/src/library/scala/collection/SeqProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SeqProxyLike.scala b/src/library/scala/collection/SeqProxyLike.scala index 24ee0b430a..c3095c8516 100644 --- a/src/library/scala/collection/SeqProxyLike.scala +++ b/src/library/scala/collection/SeqProxyLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -24,6 +23,8 @@ import generic._ * @since 2.8 */ trait SeqProxyLike[+A, +Repr <: SeqLike[A, Repr] with Seq[A]] extends SeqLike[A, Repr] with IterableProxyLike[A, Repr] { + override def size = self.size + override def toSeq: Seq[A] = self.toSeq override def length: Int = self.length override def apply(idx: Int): A = self.apply(idx) override def lengthCompare(len: Int): Int = self.lengthCompare(len) diff --git a/src/library/scala/collection/SeqView.scala b/src/library/scala/collection/SeqView.scala index 68819e899d..8198abfeab 100644 --- a/src/library/scala/collection/SeqView.scala +++ b/src/library/scala/collection/SeqView.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SeqViewLike.scala b/src/library/scala/collection/SeqViewLike.scala index 6f1f29f536..3231720bb3 100644 --- a/src/library/scala/collection/SeqViewLike.scala +++ b/src/library/scala/collection/SeqViewLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/Set.scala b/src/library/scala/collection/Set.scala index f1c1e43731..61cfd7e27d 100644 --- a/src/library/scala/collection/Set.scala +++ b/src/library/scala/collection/Set.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala index 5a16b975df..2e9a1ec2a2 100644 --- a/src/library/scala/collection/SetLike.scala +++ b/src/library/scala/collection/SetLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SetProxy.scala b/src/library/scala/collection/SetProxy.scala index cf465b6ca5..03ea4fbbb3 100644 --- a/src/library/scala/collection/SetProxy.scala +++ b/src/library/scala/collection/SetProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SetProxyLike.scala b/src/library/scala/collection/SetProxyLike.scala index 76d2c31b99..cf7f3b845c 100644 --- a/src/library/scala/collection/SetProxyLike.scala +++ b/src/library/scala/collection/SetProxyLike.scala @@ -21,10 +21,11 @@ import generic._ */ trait SetProxyLike[A, +This <: SetLike[A, This] with Set[A]] extends SetLike[A, This] with IterableProxyLike[A, This] { + def empty: This // def empty: This - // def + (elem: A): This - // def - (elem: A): This override def contains(elem: A): Boolean = self.contains(elem) + override def + (elem: A) = self.+(elem) + override def - (elem: A) = self.-(elem) override def isEmpty: Boolean = self.isEmpty override def apply(elem: A): Boolean = self.apply(elem) override def intersect(that: Set[A]) = self.intersect(that) diff --git a/src/library/scala/collection/SortedMap.scala b/src/library/scala/collection/SortedMap.scala index 7b0d35220e..e30ad37924 100644 --- a/src/library/scala/collection/SortedMap.scala +++ b/src/library/scala/collection/SortedMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection import generic._ diff --git a/src/library/scala/collection/SortedMapLike.scala b/src/library/scala/collection/SortedMapLike.scala index 78db25f318..a5386802b6 100644 --- a/src/library/scala/collection/SortedMapLike.scala +++ b/src/library/scala/collection/SortedMapLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/SortedSet.scala b/src/library/scala/collection/SortedSet.scala index 9b6fdc8c55..2d59d12f0d 100644 --- a/src/library/scala/collection/SortedSet.scala +++ b/src/library/scala/collection/SortedSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection import generic._ diff --git a/src/library/scala/collection/SortedSetLike.scala b/src/library/scala/collection/SortedSetLike.scala index 4c1d4651f8..4542925a21 100644 --- a/src/library/scala/collection/SortedSetLike.scala +++ b/src/library/scala/collection/SortedSetLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection import generic._ diff --git a/src/library/scala/collection/Traversable.scala b/src/library/scala/collection/Traversable.scala index b3383ba802..dcea1a8c2f 100644 --- a/src/library/scala/collection/Traversable.scala +++ b/src/library/scala/collection/Traversable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala index fd6c000827..50259a1ee8 100644 --- a/src/library/scala/collection/TraversableLike.scala +++ b/src/library/scala/collection/TraversableLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -339,7 +338,7 @@ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] with Traversable } bldr += elem } - m mapValues (_.result) + m map { case (k, b) => (k, b.result) } } /** Tests whether a predicate holds for all elements of this $coll. diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index 54efa62ef3..3984264168 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -408,7 +408,13 @@ trait TraversableOnce[+A] { * $willNotTerminateInf * @return an indexed sequence containing all elements of this $coll. */ - def toIndexedSeq[B >: A]: mutable.IndexedSeq[B] = new ArrayBuffer[B] ++= self + def toIndexedSeq[B >: A]: immutable.IndexedSeq[B] = immutable.IndexedSeq() ++ self + + /** Converts this $coll to a mutable buffer. + * $willNotTerminateInf + * @return a buffer containing all elements of this $coll. + */ + def toBuffer[B >: A]: mutable.Buffer[B] = new ArrayBuffer[B] ++= self /** Converts this $coll to a stream. * $willNotTerminateInf diff --git a/src/library/scala/collection/TraversableProxy.scala b/src/library/scala/collection/TraversableProxy.scala index dd450dccac..4a26c88129 100644 --- a/src/library/scala/collection/TraversableProxy.scala +++ b/src/library/scala/collection/TraversableProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/TraversableProxyLike.scala b/src/library/scala/collection/TraversableProxyLike.scala index 7b4bf99d04..05c4c44f12 100644 --- a/src/library/scala/collection/TraversableProxyLike.scala +++ b/src/library/scala/collection/TraversableProxyLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -16,9 +15,8 @@ import mutable.{Buffer, StringBuilder} // Methods could be printed by cat TraversableLike.scala | egrep '^ (override )?def' - -/** This trait implements a proxy for traversable objects. It forwards - * all calls to a different traversable object. +/** This trait implements a proxy for Traversable objects. It forwards + * all calls to a different Traversable object. * * @author Martin Odersky * @version 2.8 @@ -79,10 +77,13 @@ trait TraversableProxyLike[+A, +Repr <: TraversableLike[A, Repr] with Traversabl override def toList: List[A] = self.toList override def toIterable: Iterable[A] = self.toIterable override def toSeq: Seq[A] = self.toSeq - override def toIndexedSeq[B >: A]: mutable.IndexedSeq[B] = self.toIndexedSeq + override def toIndexedSeq[B >: A] = self.toIndexedSeq + override def toBuffer[B >: A] = self.toBuffer override def toStream: Stream[A] = self.toStream override def toSet[B >: A]: immutable.Set[B] = self.toSet override def toMap[T, U](implicit ev: A <:< (T, U)): immutable.Map[T, U] = self.toMap(ev) + override def toTraversable: Traversable[A] = self.toTraversable + override def toIterator: Iterator[A] = self.toIterator override def mkString(start: String, sep: String, end: String): String = self.mkString(start, sep, end) override def mkString(sep: String): String = self.mkString(sep) override def mkString: String = self.mkString @@ -92,17 +93,6 @@ trait TraversableProxyLike[+A, +Repr <: TraversableLike[A, Repr] with Traversabl override def stringPrefix : String = self.stringPrefix override def view = self.view override def view(from: Int, until: Int): TraversableView[A, Repr] = self.view(from, until) + // This appears difficult to override due to the type of WithFilter. + // override def withFilter(p: A => Boolean): WithFilter = self.withFilter(p) } - -/** Martin to Paul: I'm not sure what the purpose of this class is? I assume it was to make - * sure that TraversableProxyLike has all Traversable methods, but it fails at that - * -private class TraversableProxyLikeConfirmation[+A, +Repr <: TraversableLike[A, Repr] with Traversable[A]] - extends TraversableProxyLike[A, Traversable[A]] - with interfaces.TraversableMethods[A, Traversable[A]] -{ - def self: Repr = repr.asInstanceOf[Repr] - protected[this] def newBuilder = scala.collection.Traversable.newBuilder[A] - // : Builder[A, Repr] -} -*/ diff --git a/src/library/scala/collection/TraversableView.scala b/src/library/scala/collection/TraversableView.scala index 6d7fa70968..9c4f7d8a5d 100644 --- a/src/library/scala/collection/TraversableView.scala +++ b/src/library/scala/collection/TraversableView.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala index 96fc55497d..ae3f6c0e93 100644 --- a/src/library/scala/collection/TraversableViewLike.scala +++ b/src/library/scala/collection/TraversableViewLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/Addable.scala b/src/library/scala/collection/generic/Addable.scala index ecbd8301b6..8411022404 100644 --- a/src/library/scala/collection/generic/Addable.scala +++ b/src/library/scala/collection/generic/Addable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/BitSetFactory.scala b/src/library/scala/collection/generic/BitSetFactory.scala index 08cf7bd0e0..0d89464f71 100644 --- a/src/library/scala/collection/generic/BitSetFactory.scala +++ b/src/library/scala/collection/generic/BitSetFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/CanBuildFrom.scala b/src/library/scala/collection/generic/CanBuildFrom.scala index 4136b88cf5..79e352690e 100644 --- a/src/library/scala/collection/generic/CanBuildFrom.scala +++ b/src/library/scala/collection/generic/CanBuildFrom.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/GenericCompanion.scala b/src/library/scala/collection/generic/GenericCompanion.scala index 2a87f8d913..4552867a9f 100644 --- a/src/library/scala/collection/generic/GenericCompanion.scala +++ b/src/library/scala/collection/generic/GenericCompanion.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/GenericSetTemplate.scala b/src/library/scala/collection/generic/GenericSetTemplate.scala index 72dd464851..c381fb84df 100644 --- a/src/library/scala/collection/generic/GenericSetTemplate.scala +++ b/src/library/scala/collection/generic/GenericSetTemplate.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/GenericTraversableTemplate.scala b/src/library/scala/collection/generic/GenericTraversableTemplate.scala index 263e1902a0..54f4a07c10 100644 --- a/src/library/scala/collection/generic/GenericTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericTraversableTemplate.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/Growable.scala b/src/library/scala/collection/generic/Growable.scala index 80f933a901..3cc0421845 100644 --- a/src/library/scala/collection/generic/Growable.scala +++ b/src/library/scala/collection/generic/Growable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/ImmutableMapFactory.scala b/src/library/scala/collection/generic/ImmutableMapFactory.scala index 512014ba09..c0d0b1ea8b 100644 --- a/src/library/scala/collection/generic/ImmutableMapFactory.scala +++ b/src/library/scala/collection/generic/ImmutableMapFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala b/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala index d30f57f0ce..790a881468 100644 --- a/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala +++ b/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala b/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala index 684e7c41f1..e60bf82857 100644 --- a/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala +++ b/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/IterableForwarder.scala b/src/library/scala/collection/generic/IterableForwarder.scala index f4aef2fcbb..8075fabc01 100644 --- a/src/library/scala/collection/generic/IterableForwarder.scala +++ b/src/library/scala/collection/generic/IterableForwarder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection.generic diff --git a/src/library/scala/collection/generic/MapFactory.scala b/src/library/scala/collection/generic/MapFactory.scala index 163c289e23..916024e476 100644 --- a/src/library/scala/collection/generic/MapFactory.scala +++ b/src/library/scala/collection/generic/MapFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/MutableMapFactory.scala b/src/library/scala/collection/generic/MutableMapFactory.scala index 76ffc9faeb..a24f41754a 100644 --- a/src/library/scala/collection/generic/MutableMapFactory.scala +++ b/src/library/scala/collection/generic/MutableMapFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/SeqFactory.scala b/src/library/scala/collection/generic/SeqFactory.scala index 1bbe0128da..80515b4e2f 100644 --- a/src/library/scala/collection/generic/SeqFactory.scala +++ b/src/library/scala/collection/generic/SeqFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/SeqForwarder.scala b/src/library/scala/collection/generic/SeqForwarder.scala index e5dbe4b79d..203a1a9459 100644 --- a/src/library/scala/collection/generic/SeqForwarder.scala +++ b/src/library/scala/collection/generic/SeqForwarder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection.generic diff --git a/src/library/scala/collection/generic/SetFactory.scala b/src/library/scala/collection/generic/SetFactory.scala index d43664bd39..2c7554dc5a 100644 --- a/src/library/scala/collection/generic/SetFactory.scala +++ b/src/library/scala/collection/generic/SetFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/Shrinkable.scala b/src/library/scala/collection/generic/Shrinkable.scala index cf970e1232..ddd12c05bc 100644 --- a/src/library/scala/collection/generic/Shrinkable.scala +++ b/src/library/scala/collection/generic/Shrinkable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/Sorted.scala b/src/library/scala/collection/generic/Sorted.scala index aa95c76a88..447df4fe72 100644 --- a/src/library/scala/collection/generic/Sorted.scala +++ b/src/library/scala/collection/generic/Sorted.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/SortedMapFactory.scala b/src/library/scala/collection/generic/SortedMapFactory.scala index 1a11ab69e8..1e960bf52d 100644 --- a/src/library/scala/collection/generic/SortedMapFactory.scala +++ b/src/library/scala/collection/generic/SortedMapFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/SortedSetFactory.scala b/src/library/scala/collection/generic/SortedSetFactory.scala index c9c6ef9b5e..9144cc8fb7 100644 --- a/src/library/scala/collection/generic/SortedSetFactory.scala +++ b/src/library/scala/collection/generic/SortedSetFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/generic/Subtractable.scala b/src/library/scala/collection/generic/Subtractable.scala index b2051d2773..23b01376d1 100644 --- a/src/library/scala/collection/generic/Subtractable.scala +++ b/src/library/scala/collection/generic/Subtractable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/TraversableFactory.scala b/src/library/scala/collection/generic/TraversableFactory.scala index ffc4f16466..d8541d2714 100644 --- a/src/library/scala/collection/generic/TraversableFactory.scala +++ b/src/library/scala/collection/generic/TraversableFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package generic diff --git a/src/library/scala/collection/generic/TraversableForwarder.scala b/src/library/scala/collection/generic/TraversableForwarder.scala index dcba86f3d7..3995a5258b 100644 --- a/src/library/scala/collection/generic/TraversableForwarder.scala +++ b/src/library/scala/collection/generic/TraversableForwarder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection.generic @@ -75,7 +74,8 @@ trait TraversableForwarder[+A] extends Traversable[A] { override def toList: List[A] = underlying.toList override def toIterable: Iterable[A] = underlying.toIterable override def toSeq: Seq[A] = underlying.toSeq - override def toIndexedSeq[B >: A]: mutable.IndexedSeq[B] = underlying.toIndexedSeq + override def toIndexedSeq[B >: A] = underlying.toIndexedSeq + override def toBuffer[B >: A] = underlying.toBuffer override def toStream: Stream[A] = underlying.toStream override def toSet[B >: A]: immutable.Set[B] = underlying.toSet override def toMap[T, U](implicit ev: A <:< (T, U)): immutable.Map[T, U] = underlying.toMap(ev) diff --git a/src/library/scala/collection/immutable/BitSet.scala b/src/library/scala/collection/immutable/BitSet.scala index 8fa23c3ddf..e7fd5c7f0f 100644 --- a/src/library/scala/collection/immutable/BitSet.scala +++ b/src/library/scala/collection/immutable/BitSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/DefaultMap.scala b/src/library/scala/collection/immutable/DefaultMap.scala index 4f36679119..02b469a467 100755 --- a/src/library/scala/collection/immutable/DefaultMap.scala +++ b/src/library/scala/collection/immutable/DefaultMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: DefaultMap.scala 20028 2009-12-07 11:49:19Z cunei $ package scala.collection diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala index b82e50ec06..01ef597d24 100644 --- a/src/library/scala/collection/immutable/HashMap.scala +++ b/src/library/scala/collection/immutable/HashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -59,7 +58,7 @@ class HashMap[A, +B] extends Map[A,B] with MapLike[A, B, HashMap[A, B]] { def - (key: A): HashMap[A, B] = removed0(key, computeHash(key), 0) - protected def elemHashCode(key: A) = if (key == null) 0 else key.hashCode() + protected def elemHashCode(key: A) = if (key == null) 0 else key.## protected final def improve(hcode: Int) = { var h: Int = hcode + ~(hcode << 9) diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala index 481b1c3204..08e64d6709 100644 --- a/src/library/scala/collection/immutable/HashSet.scala +++ b/src/library/scala/collection/immutable/HashSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -56,7 +55,7 @@ class HashSet[A] extends Set[A] def - (e: A): HashSet[A] = removed0(e, computeHash(e), 0) - protected def elemHashCode(key: A) = if (key == null) 0 else key.hashCode() + protected def elemHashCode(key: A) = if (key == null) 0 else key.## protected final def improve(hcode: Int) = { var h: Int = hcode + ~(hcode << 9) diff --git a/src/library/scala/collection/immutable/IndexedSeq.scala b/src/library/scala/collection/immutable/IndexedSeq.scala index d3223fd106..3db217a5f3 100644 --- a/src/library/scala/collection/immutable/IndexedSeq.scala +++ b/src/library/scala/collection/immutable/IndexedSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package immutable diff --git a/src/library/scala/collection/immutable/IntMap.scala b/src/library/scala/collection/immutable/IntMap.scala index 90dfa541e3..ba5cd896ac 100644 --- a/src/library/scala/collection/immutable/IntMap.scala +++ b/src/library/scala/collection/immutable/IntMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Iterable.scala b/src/library/scala/collection/immutable/Iterable.scala index e0ef5ffcc1..fa710d3bfb 100644 --- a/src/library/scala/collection/immutable/Iterable.scala +++ b/src/library/scala/collection/immutable/Iterable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/LinearSeq.scala b/src/library/scala/collection/immutable/LinearSeq.scala index 180844ce79..5858a6ce68 100644 --- a/src/library/scala/collection/immutable/LinearSeq.scala +++ b/src/library/scala/collection/immutable/LinearSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index f9937f6925..26d5948f2c 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala index a88c3a52d5..6721d5bbf0 100644 --- a/src/library/scala/collection/immutable/ListMap.scala +++ b/src/library/scala/collection/immutable/ListMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/ListSet.scala b/src/library/scala/collection/immutable/ListSet.scala index 979fdff552..4268e742b0 100644 --- a/src/library/scala/collection/immutable/ListSet.scala +++ b/src/library/scala/collection/immutable/ListSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala index 74cf4a1715..c65fb170cc 100644 --- a/src/library/scala/collection/immutable/Map.scala +++ b/src/library/scala/collection/immutable/Map.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/MapLike.scala b/src/library/scala/collection/immutable/MapLike.scala index 367ffadd43..bbad195687 100644 --- a/src/library/scala/collection/immutable/MapLike.scala +++ b/src/library/scala/collection/immutable/MapLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/MapProxy.scala b/src/library/scala/collection/immutable/MapProxy.scala index a511c6d145..fa0b097070 100644 --- a/src/library/scala/collection/immutable/MapProxy.scala +++ b/src/library/scala/collection/immutable/MapProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -23,8 +22,7 @@ package immutable * @version 2.0, 31/12/2006 * @since 2.8 */ -trait MapProxy[A, +B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]] -{ +trait MapProxy[A, +B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]] { override def repr = this private def newProxy[B1 >: B](newSelf: Map[A, B1]): MapProxy[A, B1] = new MapProxy[A, B1] { val self = newSelf } @@ -32,11 +30,10 @@ trait MapProxy[A, +B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]] override def empty = newProxy(self.empty) override def updated [B1 >: B](key: A, value: B1) = newProxy(self.updated(key, value)) - override def + [B1 >: B](kv: (A, B1)): Map[A, B1] = newProxy(self + kv) - override def + [B1 >: B](elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *) = - newProxy(self.+(elem1, elem2, elems: _*)) - override def -(key: A) = newProxy(self - key) + override def + [B1 >: B](kv: (A, B1)): Map[A, B1] = newProxy(self + kv) + override def + [B1 >: B](elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *) = newProxy(self.+(elem1, elem2, elems: _*)) + override def ++[B1 >: B](xs: TraversableOnce[(A, B1)]) = newProxy(self ++ xs) override def filterKeys(p: A => Boolean) = self.filterKeys(p) override def mapValues[C](f: B => C) = self.mapValues(f) diff --git a/src/library/scala/collection/immutable/NumericRange.scala b/src/library/scala/collection/immutable/NumericRange.scala index 67115f7184..db44e9ffa0 100644 --- a/src/library/scala/collection/immutable/NumericRange.scala +++ b/src/library/scala/collection/immutable/NumericRange.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: NumericRange.scala 18987 2009-10-08 18:31:44Z odersky $ package scala.collection package immutable diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala index 2a1b3c110c..9cb1040f95 100644 --- a/src/library/scala/collection/immutable/PagedSeq.scala +++ b/src/library/scala/collection/immutable/PagedSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala index 7ffceb6be8..f5cfd83643 100644 --- a/src/library/scala/collection/immutable/Queue.scala +++ b/src/library/scala/collection/immutable/Queue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala index 0f20b1ea04..cef043555f 100644 --- a/src/library/scala/collection/immutable/Range.scala +++ b/src/library/scala/collection/immutable/Range.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: Range.scala 18987 2009-10-08 18:31:44Z odersky $ package scala.collection.immutable diff --git a/src/library/scala/collection/immutable/RedBlack.scala b/src/library/scala/collection/immutable/RedBlack.scala index 98a7d67d48..ecd7a65889 100644 --- a/src/library/scala/collection/immutable/RedBlack.scala +++ b/src/library/scala/collection/immutable/RedBlack.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Seq.scala b/src/library/scala/collection/immutable/Seq.scala index 7e41ff7b94..18d3b9b263 100644 --- a/src/library/scala/collection/immutable/Seq.scala +++ b/src/library/scala/collection/immutable/Seq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Set.scala b/src/library/scala/collection/immutable/Set.scala index 745b0034e8..30f0d86139 100644 --- a/src/library/scala/collection/immutable/Set.scala +++ b/src/library/scala/collection/immutable/Set.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/SetProxy.scala b/src/library/scala/collection/immutable/SetProxy.scala index d45b2059ff..3c285b2c81 100644 --- a/src/library/scala/collection/immutable/SetProxy.scala +++ b/src/library/scala/collection/immutable/SetProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -22,8 +21,7 @@ package immutable * * @since 2.8 */ -trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]] -{ +trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]] { override def repr = this private def newProxy[B >: A](newSelf: Set[B]): SetProxy[B] = new SetProxy[B] { val self = newSelf } diff --git a/src/library/scala/collection/immutable/SortedMap.scala b/src/library/scala/collection/immutable/SortedMap.scala index 243636e107..2f0749c37a 100644 --- a/src/library/scala/collection/immutable/SortedMap.scala +++ b/src/library/scala/collection/immutable/SortedMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/SortedSet.scala b/src/library/scala/collection/immutable/SortedSet.scala index 6c9433c30c..d0168b7b22 100644 --- a/src/library/scala/collection/immutable/SortedSet.scala +++ b/src/library/scala/collection/immutable/SortedSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala index c90ab379af..58a37a8136 100644 --- a/src/library/scala/collection/immutable/Stack.scala +++ b/src/library/scala/collection/immutable/Stack.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index fbda0b918b..7e363a7e96 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala index f12ddebd08..0c327195a4 100644 --- a/src/library/scala/collection/immutable/StringLike.scala +++ b/src/library/scala/collection/immutable/StringLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/StringOps.scala b/src/library/scala/collection/immutable/StringOps.scala index 2bdbf672cd..8a27a4ad4b 100644 --- a/src/library/scala/collection/immutable/StringOps.scala +++ b/src/library/scala/collection/immutable/StringOps.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Traversable.scala b/src/library/scala/collection/immutable/Traversable.scala index 8fdb5c7568..bab1a71a97 100644 --- a/src/library/scala/collection/immutable/Traversable.scala +++ b/src/library/scala/collection/immutable/Traversable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/TreeHashMap.scala b/src/library/scala/collection/immutable/TreeHashMap.scala index d991df196f..a7de5bf8d1 100644 --- a/src/library/scala/collection/immutable/TreeHashMap.scala +++ b/src/library/scala/collection/immutable/TreeHashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package immutable @@ -55,7 +54,7 @@ class TreeHashMap[Key, +Value] private (private val underlying : IntMap[AssocMap def empty[V] = TreeHashMap.empty[Key, V] private def hash(key : Key) = { - var h = key.hashCode; + var h = key.## h ^= ((h >>> 20) ^ (h >>> 12)); h ^ (h >>> 7) ^ (h >>> 4); } diff --git a/src/library/scala/collection/immutable/TreeMap.scala b/src/library/scala/collection/immutable/TreeMap.scala index 61cfe2e13b..07212f8f5c 100644 --- a/src/library/scala/collection/immutable/TreeMap.scala +++ b/src/library/scala/collection/immutable/TreeMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/TreeSet.scala b/src/library/scala/collection/immutable/TreeSet.scala index 18c65dd373..9eee10f165 100644 --- a/src/library/scala/collection/immutable/TreeSet.scala +++ b/src/library/scala/collection/immutable/TreeSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/immutable/Vector.scala b/src/library/scala/collection/immutable/Vector.scala index 6defe66d6f..9faab71158 100644 --- a/src/library/scala/collection/immutable/Vector.scala +++ b/src/library/scala/collection/immutable/Vector.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package immutable diff --git a/src/library/scala/collection/immutable/WrappedString.scala b/src/library/scala/collection/immutable/WrappedString.scala index 011774e10d..8fe3a2bc5c 100644 --- a/src/library/scala/collection/immutable/WrappedString.scala +++ b/src/library/scala/collection/immutable/WrappedString.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/interfaces/TraversableMethods.scala b/src/library/scala/collection/interfaces/TraversableMethods.scala index 7ec878b3d3..d381b1dc24 100644 --- a/src/library/scala/collection/interfaces/TraversableMethods.scala +++ b/src/library/scala/collection/interfaces/TraversableMethods.scala @@ -41,7 +41,8 @@ trait TraversableMethods[+A, +This <: TraversableLike[A, This] with Traversable[ def toSeq: Seq[A] def toSet[B >: A]: immutable.Set[B] def toStream: Stream[A] - def toIndexedSeq[B >: A]: mutable.IndexedSeq[B] + def toIndexedSeq[B >: A]: immutable.IndexedSeq[B] + def toBuffer[B >: A]: mutable.Buffer[B] // strings def addString(b: StringBuilder): StringBuilder diff --git a/src/library/scala/collection/mutable/AddingBuilder.scala b/src/library/scala/collection/mutable/AddingBuilder.scala index 54137b6a26..5dbf4813bf 100644 --- a/src/library/scala/collection/mutable/AddingBuilder.scala +++ b/src/library/scala/collection/mutable/AddingBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala index ae656d4e09..6412a21531 100644 --- a/src/library/scala/collection/mutable/ArrayBuffer.scala +++ b/src/library/scala/collection/mutable/ArrayBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ArrayBuilder.scala b/src/library/scala/collection/mutable/ArrayBuilder.scala index 0ddd089852..5199fb9051 100644 --- a/src/library/scala/collection/mutable/ArrayBuilder.scala +++ b/src/library/scala/collection/mutable/ArrayBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ArrayLike.scala b/src/library/scala/collection/mutable/ArrayLike.scala index 15cafa6ee7..ceb1377620 100644 --- a/src/library/scala/collection/mutable/ArrayLike.scala +++ b/src/library/scala/collection/mutable/ArrayLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ArrayOps.scala b/src/library/scala/collection/mutable/ArrayOps.scala index 971709ed67..d7072c0661 100644 --- a/src/library/scala/collection/mutable/ArrayOps.scala +++ b/src/library/scala/collection/mutable/ArrayOps.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ArraySeq.scala b/src/library/scala/collection/mutable/ArraySeq.scala index d59cf684b2..1a287ed4cc 100644 --- a/src/library/scala/collection/mutable/ArraySeq.scala +++ b/src/library/scala/collection/mutable/ArraySeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala index 0c6dc7a0e1..fdabead34a 100644 --- a/src/library/scala/collection/mutable/ArrayStack.scala +++ b/src/library/scala/collection/mutable/ArrayStack.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/BitSet.scala b/src/library/scala/collection/mutable/BitSet.scala index da3e95fce7..41977e51a9 100644 --- a/src/library/scala/collection/mutable/BitSet.scala +++ b/src/library/scala/collection/mutable/BitSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Buffer.scala b/src/library/scala/collection/mutable/Buffer.scala index fbc52ae322..48d877233e 100644 --- a/src/library/scala/collection/mutable/Buffer.scala +++ b/src/library/scala/collection/mutable/Buffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/BufferLike.scala b/src/library/scala/collection/mutable/BufferLike.scala index 15e96b2019..80a8824a3b 100644 --- a/src/library/scala/collection/mutable/BufferLike.scala +++ b/src/library/scala/collection/mutable/BufferLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -54,6 +53,10 @@ import annotation.migration * @define Add Append * @define willNotTerminateInf * @define mayNotTerminateInf + * @define compatMutate + * Note that for backward compatibility reasons, this method + * mutates the collection in place, unlike similar but + * undeprecated methods throughout the collections hierarchy. */ @cloneable trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] @@ -233,17 +236,36 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] } } + + /** This method prepends elements to the buffer and + * returns the same buffer. + * + * $compatMutate + * You are strongly recommended to use `++=:` instead. + * + * @param xs elements to prepend + * @return this buffer + */ @deprecated("use ++=: instead") - final def ++:(iter: Traversable[A]): This = ++=:(iter) + final def ++:(xs: Traversable[A]): This = ++=:(xs) + /** This method prepends elements to the buffer and + * returns the same buffer. + * + * $compatMutate + * You are strongly recommended to use `+=:` instead. + * + * @param xs elements to prepend + * @return this buffer + */ @deprecated("use `+=:' instead") final def +:(elem: A): This = +=:(elem) /** Adds a single element to this collection and returns - * the collection itself. Note that for backward compatibility - * reasons, this method mutates the collection in place, unlike - * similar but undeprecated methods throughout the collections - * hierarchy. You are strongly recommended to use '+=' instead. + * the collection itself. + * + * $compatMutate + * You are strongly recommended to use '+=' instead. * * @param elem the element to add. */ @@ -252,11 +274,10 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] def + (elem: A): This = { +=(elem); repr } /** Adds two or more elements to this collection and returns - * the collection itself. Note that for backward compatibility - * reasons, this method mutates the collection in place, unlike - * all similar methods throughout the collections hierarchy. - * similar but undeprecated methods throughout the collections - * hierarchy. You are strongly recommended to use '++=' instead. + * the collection itself. + * + * $compatMutate + * You are strongly recommended to use '++=' instead. * * @param elem1 the first element to add. * @param elem2 the second element to add. @@ -269,10 +290,11 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] repr } - /** Adds a number of elements provided by a traversable object and returns - * either the collection itself. + /** Creates a new collection containing both the elements of this collection and the provided + * traversable object. * * @param xs the traversable object. + * @return a new collection consisting of all the elements of this collection and `xs`. */ @migration(2, 8, "As of 2.8, ++ always creates a new collection, even on Buffers.\n"+ @@ -280,10 +302,10 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] ) def ++(xs: TraversableOnce[A]): This = clone() ++= xs - /** Removes a single element from this collection and returns - * the collection itself. + /** Creates a new collection with all the elements of this collection except `elem`. * * @param elem the element to remove. + * @return a new collection consisting of all the elements of this collection except `elem`. */ @migration(2, 8, "As of 2.8, - always creates a new collection, even on Buffers.\n"+ @@ -291,12 +313,14 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] ) override def -(elem: A): This = clone() -= elem - /** Removes two or more elements from this collection and returns - * the collection itself. + /** Creates a new collection with all the elements of this collection except the two + * or more specified elements. * * @param elem1 the first element to remove. * @param elem2 the second element to remove. * @param elems the remaining elements to remove. + * @return a new collection consisting of all the elements of this collection except + * `elem1`, `elem2` and those in `elems`. */ @migration(2, 8, "As of 2.8, - always creates a new collection, even on Buffers.\n"+ @@ -304,10 +328,12 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] ) override def -(elem1: A, elem2: A, elems: A*): This = clone() -= elem1 -= elem2 --= elems - /** Removes a number of elements provided by a Traversable object and returns - * the collection itself. + /** Creates a new collection with all the elements of this collection except those + * provided by the specified traversable object. * - * @param iter the Traversable object. + * @param xs the traversable object. + * @return a new collection with all the elements of this collection except + * those in `xs` */ @migration(2, 8, "As of 2.8, -- always creates a new collection, even on Buffers.\n"+ diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala index 983572452b..7adbb8ee3f 100644 --- a/src/library/scala/collection/mutable/BufferProxy.scala +++ b/src/library/scala/collection/mutable/BufferProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Builder.scala b/src/library/scala/collection/mutable/Builder.scala index 0c8bb79f83..701e39e36f 100644 --- a/src/library/scala/collection/mutable/Builder.scala +++ b/src/library/scala/collection/mutable/Builder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/Cloneable.scala b/src/library/scala/collection/mutable/Cloneable.scala index 099c6a68b4..b77172ae16 100644 --- a/src/library/scala/collection/mutable/Cloneable.scala +++ b/src/library/scala/collection/mutable/Cloneable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/CloneableCollection.scala b/src/library/scala/collection/mutable/CloneableCollection.scala index a88d85965f..625b849821 100644 --- a/src/library/scala/collection/mutable/CloneableCollection.scala +++ b/src/library/scala/collection/mutable/CloneableCollection.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/DefaultEntry.scala b/src/library/scala/collection/mutable/DefaultEntry.scala index 553fb3c678..5144f4f590 100644 --- a/src/library/scala/collection/mutable/DefaultEntry.scala +++ b/src/library/scala/collection/mutable/DefaultEntry.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/DefaultMapModel.scala b/src/library/scala/collection/mutable/DefaultMapModel.scala index d22b20e10c..226a09697a 100644 --- a/src/library/scala/collection/mutable/DefaultMapModel.scala +++ b/src/library/scala/collection/mutable/DefaultMapModel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/DoubleLinkedList.scala b/src/library/scala/collection/mutable/DoubleLinkedList.scala index d8b8278c74..e702301703 100644 --- a/src/library/scala/collection/mutable/DoubleLinkedList.scala +++ b/src/library/scala/collection/mutable/DoubleLinkedList.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/DoubleLinkedListLike.scala b/src/library/scala/collection/mutable/DoubleLinkedListLike.scala index b908a1802b..9112ade5af 100644 --- a/src/library/scala/collection/mutable/DoubleLinkedListLike.scala +++ b/src/library/scala/collection/mutable/DoubleLinkedListLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/FlatHashTable.scala b/src/library/scala/collection/mutable/FlatHashTable.scala index 05eafbc811..d46c59173b 100644 --- a/src/library/scala/collection/mutable/FlatHashTable.scala +++ b/src/library/scala/collection/mutable/FlatHashTable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/HashMap.scala b/src/library/scala/collection/mutable/HashMap.scala index 215e0323b3..1d605fe444 100644 --- a/src/library/scala/collection/mutable/HashMap.scala +++ b/src/library/scala/collection/mutable/HashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/HashSet.scala b/src/library/scala/collection/mutable/HashSet.scala index 41f9a17dd6..ebfeaa29ad 100644 --- a/src/library/scala/collection/mutable/HashSet.scala +++ b/src/library/scala/collection/mutable/HashSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/HashTable.scala b/src/library/scala/collection/mutable/HashTable.scala index 04b5e5e3a1..b924a38dde 100644 --- a/src/library/scala/collection/mutable/HashTable.scala +++ b/src/library/scala/collection/mutable/HashTable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -229,7 +228,7 @@ trait HashTable[A] { protected def elemEquals(key1: A, key2: A): Boolean = (key1 == key2) - protected def elemHashCode(key: A) = if (key == null) 0 else key.hashCode() + protected def elemHashCode(key: A) = if (key == null) 0 else key.## protected final def improve(hcode: Int) = { var h: Int = hcode + ~(hcode << 9) diff --git a/src/library/scala/collection/mutable/History.scala b/src/library/scala/collection/mutable/History.scala index ffa3d6481a..d480c4342b 100644 --- a/src/library/scala/collection/mutable/History.scala +++ b/src/library/scala/collection/mutable/History.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala index c2b7cfd2b8..24f11e105f 100644 --- a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala +++ b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala index a56f65e379..4560d01d4d 100644 --- a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala +++ b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/IndexedSeq.scala b/src/library/scala/collection/mutable/IndexedSeq.scala index 06a6230c6b..13788671c2 100644 --- a/src/library/scala/collection/mutable/IndexedSeq.scala +++ b/src/library/scala/collection/mutable/IndexedSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/IndexedSeqLike.scala b/src/library/scala/collection/mutable/IndexedSeqLike.scala index 5e932effe0..f08353ef3d 100644 --- a/src/library/scala/collection/mutable/IndexedSeqLike.scala +++ b/src/library/scala/collection/mutable/IndexedSeqLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/IndexedSeqOptimized.scala b/src/library/scala/collection/mutable/IndexedSeqOptimized.scala index 134cc2a8ea..293588af7d 100755 --- a/src/library/scala/collection/mutable/IndexedSeqOptimized.scala +++ b/src/library/scala/collection/mutable/IndexedSeqOptimized.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: IndexedSeqLike.scala 20129 2009-12-14 17:12:17Z odersky $ package scala.collection diff --git a/src/library/scala/collection/mutable/IndexedSeqView.scala b/src/library/scala/collection/mutable/IndexedSeqView.scala index 8d72ac2c49..966a537bf1 100644 --- a/src/library/scala/collection/mutable/IndexedSeqView.scala +++ b/src/library/scala/collection/mutable/IndexedSeqView.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/LazyBuilder.scala b/src/library/scala/collection/mutable/LazyBuilder.scala index 91cf8f2ad9..db6ca19f2b 100644 --- a/src/library/scala/collection/mutable/LazyBuilder.scala +++ b/src/library/scala/collection/mutable/LazyBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/LinearSeq.scala b/src/library/scala/collection/mutable/LinearSeq.scala index 7567504890..08a8c8282c 100644 --- a/src/library/scala/collection/mutable/LinearSeq.scala +++ b/src/library/scala/collection/mutable/LinearSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/LinkedEntry.scala b/src/library/scala/collection/mutable/LinkedEntry.scala index 5d591058e8..667d45b637 100644 --- a/src/library/scala/collection/mutable/LinkedEntry.scala +++ b/src/library/scala/collection/mutable/LinkedEntry.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/LinkedHashMap.scala b/src/library/scala/collection/mutable/LinkedHashMap.scala index 97961ccd9c..be6442561c 100644 --- a/src/library/scala/collection/mutable/LinkedHashMap.scala +++ b/src/library/scala/collection/mutable/LinkedHashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/LinkedHashSet.scala b/src/library/scala/collection/mutable/LinkedHashSet.scala index e91b03048d..922ff25276 100644 --- a/src/library/scala/collection/mutable/LinkedHashSet.scala +++ b/src/library/scala/collection/mutable/LinkedHashSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable @@ -69,7 +68,7 @@ class LinkedHashSet[A] extends Set[A] clearTable() } - override def iterator = ordered.iterator + override def iterator: Iterator[A] = ordered.iterator override def foreach[U](f: A => U) = ordered foreach f diff --git a/src/library/scala/collection/mutable/LinkedList.scala b/src/library/scala/collection/mutable/LinkedList.scala index a72acf1438..538e2f1ba5 100644 --- a/src/library/scala/collection/mutable/LinkedList.scala +++ b/src/library/scala/collection/mutable/LinkedList.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/LinkedListLike.scala b/src/library/scala/collection/mutable/LinkedListLike.scala index 4f1a878e02..ca904e0a24 100644 --- a/src/library/scala/collection/mutable/LinkedListLike.scala +++ b/src/library/scala/collection/mutable/LinkedListLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ListBuffer.scala b/src/library/scala/collection/mutable/ListBuffer.scala index 7ebbf7b4da..415096ed89 100644 --- a/src/library/scala/collection/mutable/ListBuffer.scala +++ b/src/library/scala/collection/mutable/ListBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ListMap.scala b/src/library/scala/collection/mutable/ListMap.scala index 09b0c6459b..3aa6f9c753 100644 --- a/src/library/scala/collection/mutable/ListMap.scala +++ b/src/library/scala/collection/mutable/ListMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Map.scala b/src/library/scala/collection/mutable/Map.scala index 6c42bad0e9..287069d04b 100644 --- a/src/library/scala/collection/mutable/Map.scala +++ b/src/library/scala/collection/mutable/Map.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/MapBuilder.scala b/src/library/scala/collection/mutable/MapBuilder.scala index 75fb48abd6..4e5b6d1ef7 100644 --- a/src/library/scala/collection/mutable/MapBuilder.scala +++ b/src/library/scala/collection/mutable/MapBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/MapLike.scala b/src/library/scala/collection/mutable/MapLike.scala index f9c0f7232c..11677aca43 100644 --- a/src/library/scala/collection/mutable/MapLike.scala +++ b/src/library/scala/collection/mutable/MapLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -80,9 +79,13 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] */ override def updated[B1 >: B](key: A, value: B1): Map[A, B1] = this + ((key, value)) - /** Add a new key/value mapping and return the map itself. + /** Creates a new map containing a new key/value mapping and all the key/value mappings + * of this map. + * + * Mapping `kv` will override existing mappings from this map with the same key. * * @param kv the key/value mapping to be added + * @return a new map containing mappings of this map and the mapping `kv`. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To add an element as a\n"+ @@ -90,12 +93,15 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] ) def + [B1 >: B] (kv: (A, B1)): Map[A, B1] = clone().asInstanceOf[Map[A, B1]] += kv - /** Adds two or more key/value mappings and return the map itself. - * with the added elements. + /** Creates a new map containing two or more key/value mappings and all the key/value + * mappings of this map. + * + * Specified mappings will override existing mappings from this map with the same keys. * * @param elem1 the first element to add. * @param elem2 the second element to add. * @param elems the remaining elements to add. + * @return a new map containing mappings of this map and two or more specified mappings. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To add an element as a\n"+ @@ -104,12 +110,13 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] override def + [B1 >: B] (elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *): Map[A, B1] = clone().asInstanceOf[Map[A, B1]] += elem1 += elem2 ++= elems - /** Adds a number of elements provided by a traversable object - * via its `iterator` method and returns - * either the collection itself (if it is mutable), or a new collection - * with the added elements. + /** Creates a new map containing the key/value mappings provided by the specified traversable object + * and all the key/value mappings of this map. * - * @param iter the traversable object. + * Note that existing mappings from this map with the same key as those in `xs` will be overriden. + * + * @param xs the traversable object. + * @return a new map containing mappings of this map and those provided by `xs`. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To add the elements as a\n"+ @@ -136,8 +143,11 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] */ def -= (key: A): this.type - /** Delete a key from this map if it is present and return the map itself. + /** Creates a new map with all the key/value mappings of this map except the key/value mapping + * with the specified key. + * * @param key the key to be removed + * @return a new map with all the mappings of this map except that with a key `key`. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To remove an element as a\n"+ @@ -205,12 +215,14 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] */ def result: This = repr - /** Removes two or more elements from this collection and returns - * the collection itself. + /** Creates a new map with all the key/value mappings of this map except mappings with keys + * equal to any of the two or more specified keys. * * @param elem1 the first element to remove. * @param elem2 the second element to remove. * @param elems the remaining elements to remove. + * @return a new map containing all the mappings of this map except mappings + * with a key equal to `elem1`, `elem2` or any of `elems`. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To remove an element as a\n"+ @@ -219,10 +231,12 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] override def -(elem1: A, elem2: A, elems: A*): This = clone() -= elem1 -= elem2 --= elems - /** Removes a number of elements provided by a Traversable object and returns - * the collection itself. + /** Creates a new map with all the key/value mappings of this map except mappings with keys + * equal to any of those provided by the specified traversable object. * - * @param iter the Traversable object. + * @param xs the traversable object. + * @return a new map with all the key/value mappings of this map except mappings + * with a key equal to a key from `xs`. */ @migration(2, 8, "As of 2.8, this operation creates a new map. To remove the elements as a\n"+ diff --git a/src/library/scala/collection/mutable/MapProxy.scala b/src/library/scala/collection/mutable/MapProxy.scala index 7fbb016a57..c39d14b52e 100644 --- a/src/library/scala/collection/mutable/MapProxy.scala +++ b/src/library/scala/collection/mutable/MapProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -23,17 +22,17 @@ package mutable * @version 2.0, 31/12/2006 * @since 1 */ -trait MapProxy[A, B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]] -{ +trait MapProxy[A, B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]] { private def newProxy[B1 >: B](newSelf: Map[A, B1]): MapProxy[A, B1] = new MapProxy[A, B1] { val self = newSelf } override def repr = this override def empty: MapProxy[A, B] = new MapProxy[A, B] { val self = MapProxy.this.self.empty } + override def updated [B1 >: B](key: A, value: B1) = newProxy(self.updated(key, value)) override def + [B1 >: B] (kv: (A, B1)): Map[A, B1] = newProxy(self + kv) override def + [B1 >: B] (elem1: (A, B1), elem2: (A, B1), elems: (A, B1) *) = newProxy(self.+(elem1, elem2, elems: _*)) - + override def ++[B1 >: B](xs: TraversableOnce[(A, B1)]) = newProxy(self ++ xs) override def -(key: A) = newProxy(self - key) override def += (kv: (A, B)) = { self += kv ; this } diff --git a/src/library/scala/collection/mutable/MultiMap.scala b/src/library/scala/collection/mutable/MultiMap.scala index 39c51ef5ad..2f547b2c51 100644 --- a/src/library/scala/collection/mutable/MultiMap.scala +++ b/src/library/scala/collection/mutable/MultiMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/MutableList.scala b/src/library/scala/collection/mutable/MutableList.scala index 4b6d727c34..65c973c9ec 100644 --- a/src/library/scala/collection/mutable/MutableList.scala +++ b/src/library/scala/collection/mutable/MutableList.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -56,6 +55,13 @@ class MutableList[A] extends LinearSeq[A] tl } + /** Prepends a single element to this list. This operation takes constant + * time. + * @param elem the element to prepend. + * @return this $coll. + */ + def +=: (elem: A): this.type = { prependElem(elem); this } + /** Returns the length of this list. */ override def length: Int = len diff --git a/src/library/scala/collection/mutable/ObservableBuffer.scala b/src/library/scala/collection/mutable/ObservableBuffer.scala index 8881e78ebc..3552e1262d 100644 --- a/src/library/scala/collection/mutable/ObservableBuffer.scala +++ b/src/library/scala/collection/mutable/ObservableBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ObservableMap.scala b/src/library/scala/collection/mutable/ObservableMap.scala index 0cde1b2288..fdc5addd53 100644 --- a/src/library/scala/collection/mutable/ObservableMap.scala +++ b/src/library/scala/collection/mutable/ObservableMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ObservableSet.scala b/src/library/scala/collection/mutable/ObservableSet.scala index 1f2f1789f9..e71156cdb7 100644 --- a/src/library/scala/collection/mutable/ObservableSet.scala +++ b/src/library/scala/collection/mutable/ObservableSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/OpenHashMap.scala b/src/library/scala/collection/mutable/OpenHashMap.scala index 4ecfe0e762..b10b88049e 100644 --- a/src/library/scala/collection/mutable/OpenHashMap.scala +++ b/src/library/scala/collection/mutable/OpenHashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -92,7 +91,7 @@ extends Map[Key, Value] /** Returns a mangled hash code of the provided key. */ protected def hashOf(key : Key) = { - var h = key.hashCode; + var h = key.## h ^= ((h >>> 20) ^ (h >>> 12)); h ^ (h >>> 7) ^ (h >>> 4); } diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala index 37e1b0ccae..acdfc03597 100644 --- a/src/library/scala/collection/mutable/PriorityQueue.scala +++ b/src/library/scala/collection/mutable/PriorityQueue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/PriorityQueueProxy.scala b/src/library/scala/collection/mutable/PriorityQueueProxy.scala index f99755128f..f1b25ab18f 100644 --- a/src/library/scala/collection/mutable/PriorityQueueProxy.scala +++ b/src/library/scala/collection/mutable/PriorityQueueProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/Publisher.scala b/src/library/scala/collection/mutable/Publisher.scala index f91864f974..2b89130368 100644 --- a/src/library/scala/collection/mutable/Publisher.scala +++ b/src/library/scala/collection/mutable/Publisher.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Queue.scala b/src/library/scala/collection/mutable/Queue.scala index 3132e2f422..ae6c60d1d0 100644 --- a/src/library/scala/collection/mutable/Queue.scala +++ b/src/library/scala/collection/mutable/Queue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/QueueProxy.scala b/src/library/scala/collection/mutable/QueueProxy.scala index 6adb3d490b..9d93933695 100644 --- a/src/library/scala/collection/mutable/QueueProxy.scala +++ b/src/library/scala/collection/mutable/QueueProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/ResizableArray.scala b/src/library/scala/collection/mutable/ResizableArray.scala index 96d24136cf..96ac7800ab 100644 --- a/src/library/scala/collection/mutable/ResizableArray.scala +++ b/src/library/scala/collection/mutable/ResizableArray.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/RevertibleHistory.scala b/src/library/scala/collection/mutable/RevertibleHistory.scala index b16577486a..87b4efa5f2 100644 --- a/src/library/scala/collection/mutable/RevertibleHistory.scala +++ b/src/library/scala/collection/mutable/RevertibleHistory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Seq.scala b/src/library/scala/collection/mutable/Seq.scala index 679cc24389..eff387353e 100644 --- a/src/library/scala/collection/mutable/Seq.scala +++ b/src/library/scala/collection/mutable/Seq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Set.scala b/src/library/scala/collection/mutable/Set.scala index bebf66157a..066eecc034 100644 --- a/src/library/scala/collection/mutable/Set.scala +++ b/src/library/scala/collection/mutable/Set.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SetBuilder.scala b/src/library/scala/collection/mutable/SetBuilder.scala index b8903372bd..6cab092d06 100644 --- a/src/library/scala/collection/mutable/SetBuilder.scala +++ b/src/library/scala/collection/mutable/SetBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/SetLike.scala b/src/library/scala/collection/mutable/SetLike.scala index 9dbfaf6d5e..78e82eb06b 100644 --- a/src/library/scala/collection/mutable/SetLike.scala +++ b/src/library/scala/collection/mutable/SetLike.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection @@ -47,6 +46,10 @@ import scala.annotation.migration * }}} * It is also good idea to override methods `foreach` and * `size` for efficiency. + * @define addDuplicates + * Note that duplicates (elements for which `equals` yields true) will be + * removed, but it is not specified whether it will be an element of this + * set or a newly added element. * @define coll mutable set * @define Coll mutable.Set */ @@ -132,10 +135,12 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] */ def result: This = repr - /** Adds a single element to this collection and returns - * the collection itself. + /** Creates a new set consisting of all the elements of this set and `elem`. + * + * $addDuplicates * * @param elem the element to add. + * @return a new set consisting of elements of this set and `elem`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To add an element as a\n"+ @@ -143,12 +148,16 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] ) override def + (elem: A): This = clone() += elem - /** Adds two or more elements to this collection and returns - * the collection itself. + /** Creates a new set consisting of all the elements of this set and two or more + * specified elements. + * + * $addDuplicates * * @param elem1 the first element to add. * @param elem2 the second element to add. * @param elems the remaining elements to add. + * @return a new set consisting of all the elements of this set, `elem1`, + * `elem2` and those in `elems`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To add the elements as a\n"+ @@ -157,10 +166,13 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] override def + (elem1: A, elem2: A, elems: A*): This = clone() += elem1 += elem2 ++= elems - /** Adds a number of elements provided by a traversable object and returns - * either the collection itself. + /** Creates a new set consisting of all the elements of this set and those + * provided by the specified traversable object. + * + * $addDuplicates * - * @param iter the iterable object. + * @param xs the traversable object. + * @return a new set cconsisting of elements of this set and those in `xs`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To add the elements as a\n"+ @@ -168,10 +180,10 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] ) override def ++(xs: TraversableOnce[A]): This = clone() ++= xs - /** Removes a single element from this collection and returns - * the collection itself. + /** Creates a new set consisting of all the elements of this set except `elem`. * * @param elem the element to remove. + * @return a new set consisting of all the elements of this set except `elem`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To remove the element as a\n"+ @@ -179,12 +191,14 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] ) override def -(elem: A): This = clone() -= elem - /** Removes two or more elements from this collection and returns - * the collection itself. + /** Creates a new set consisting of all the elements of this set except the two + * or more specified elements. * * @param elem1 the first element to remove. * @param elem2 the second element to remove. * @param elems the remaining elements to remove. + * @return a new set consisting of all the elements of this set except + * `elem1`, `elem2` and `elems`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To remove the elements as a\n"+ @@ -193,10 +207,12 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] override def -(elem1: A, elem2: A, elems: A*): This = clone() -= elem1 -= elem2 --= elems - /** Removes a number of elements provided by a Traversable object and returns - * the collection itself. + /** Creates a new set consisting of all the elements of this set except those + * provided by the specified traversable object. * - * @param iter the Traversable object. + * @param xs the traversable object. + * @return a new set consisting of all the elements of this set except + * elements from `xs`. */ @migration(2, 8, "As of 2.8, this operation creates a new set. To remove the elements as a\n"+ diff --git a/src/library/scala/collection/mutable/SetProxy.scala b/src/library/scala/collection/mutable/SetProxy.scala index 85a4dfdcbc..b1a6c48ffd 100644 --- a/src/library/scala/collection/mutable/SetProxy.scala +++ b/src/library/scala/collection/mutable/SetProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable @@ -20,8 +19,7 @@ package mutable * @version 1.1, 09/05/2004 * @since 1 */ -trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]] -{ +trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]] { override def repr = this override def empty = new SetProxy[A] { val self = SetProxy.this.self.empty } override def + (elem: A) = { self += elem ; this } diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala index 72e2f928c8..e678f7fa5c 100644 --- a/src/library/scala/collection/mutable/Stack.scala +++ b/src/library/scala/collection/mutable/Stack.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/StackProxy.scala b/src/library/scala/collection/mutable/StackProxy.scala index 740afdfd7d..b0af178382 100644 --- a/src/library/scala/collection/mutable/StackProxy.scala +++ b/src/library/scala/collection/mutable/StackProxy.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala index 9673e59486..8bf1aca6b4 100644 --- a/src/library/scala/collection/mutable/StringBuilder.scala +++ b/src/library/scala/collection/mutable/StringBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Subscriber.scala b/src/library/scala/collection/mutable/Subscriber.scala index 8992b7dddf..a89745b107 100644 --- a/src/library/scala/collection/mutable/Subscriber.scala +++ b/src/library/scala/collection/mutable/Subscriber.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SynchronizedBuffer.scala b/src/library/scala/collection/mutable/SynchronizedBuffer.scala index 7bdbd5e520..817657af53 100644 --- a/src/library/scala/collection/mutable/SynchronizedBuffer.scala +++ b/src/library/scala/collection/mutable/SynchronizedBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SynchronizedMap.scala b/src/library/scala/collection/mutable/SynchronizedMap.scala index 08c370ce90..bf294e548e 100644 --- a/src/library/scala/collection/mutable/SynchronizedMap.scala +++ b/src/library/scala/collection/mutable/SynchronizedMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala index bc70e35993..41eb1823ae 100644 --- a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala +++ b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SynchronizedQueue.scala b/src/library/scala/collection/mutable/SynchronizedQueue.scala index 7a0f9f5f6f..95939dd8f2 100644 --- a/src/library/scala/collection/mutable/SynchronizedQueue.scala +++ b/src/library/scala/collection/mutable/SynchronizedQueue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/SynchronizedSet.scala b/src/library/scala/collection/mutable/SynchronizedSet.scala index 904da541c2..bd5e42a57c 100644 --- a/src/library/scala/collection/mutable/SynchronizedSet.scala +++ b/src/library/scala/collection/mutable/SynchronizedSet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection package mutable diff --git a/src/library/scala/collection/mutable/SynchronizedStack.scala b/src/library/scala/collection/mutable/SynchronizedStack.scala index 9109d2ef5d..bb8558ec36 100644 --- a/src/library/scala/collection/mutable/SynchronizedStack.scala +++ b/src/library/scala/collection/mutable/SynchronizedStack.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Traversable.scala b/src/library/scala/collection/mutable/Traversable.scala index 871e3a825d..ea49dd68a7 100644 --- a/src/library/scala/collection/mutable/Traversable.scala +++ b/src/library/scala/collection/mutable/Traversable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/Undoable.scala b/src/library/scala/collection/mutable/Undoable.scala index 45d3121bd3..1a7f67acab 100644 --- a/src/library/scala/collection/mutable/Undoable.scala +++ b/src/library/scala/collection/mutable/Undoable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/WeakHashMap.scala b/src/library/scala/collection/mutable/WeakHashMap.scala index 929c3f8fed..75bc317f4a 100644 --- a/src/library/scala/collection/mutable/WeakHashMap.scala +++ b/src/library/scala/collection/mutable/WeakHashMap.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/WrappedArray.scala b/src/library/scala/collection/mutable/WrappedArray.scala index b9e803d8dc..6aea49ec9d 100644 --- a/src/library/scala/collection/mutable/WrappedArray.scala +++ b/src/library/scala/collection/mutable/WrappedArray.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala index 012a0be862..625f2d831f 100644 --- a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala +++ b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/script/Location.scala b/src/library/scala/collection/script/Location.scala index e7c2955b83..55ee613877 100644 --- a/src/library/scala/collection/script/Location.scala +++ b/src/library/scala/collection/script/Location.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/script/Message.scala b/src/library/scala/collection/script/Message.scala index 4c1c2e9f70..bf813a4d38 100644 --- a/src/library/scala/collection/script/Message.scala +++ b/src/library/scala/collection/script/Message.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/collection/script/Scriptable.scala b/src/library/scala/collection/script/Scriptable.scala index a4332b19fc..ccee3c43a9 100644 --- a/src/library/scala/collection/script/Scriptable.scala +++ b/src/library/scala/collection/script/Scriptable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.collection diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala index 7580d2cc0e..b6d7de2c56 100644 --- a/src/library/scala/compat/Platform.scala +++ b/src/library/scala/compat/Platform.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.compat diff --git a/src/library/scala/concurrent/Channel.scala b/src/library/scala/concurrent/Channel.scala index 147deac53e..865d0187f6 100644 --- a/src/library/scala/concurrent/Channel.scala +++ b/src/library/scala/concurrent/Channel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/DelayedLazyVal.scala b/src/library/scala/concurrent/DelayedLazyVal.scala index 7c5d43e70c..fbf799a6a6 100644 --- a/src/library/scala/concurrent/DelayedLazyVal.scala +++ b/src/library/scala/concurrent/DelayedLazyVal.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/JavaConversions.scala b/src/library/scala/concurrent/JavaConversions.scala index 1a4d61c4fb..c6cff19c28 100644 --- a/src/library/scala/concurrent/JavaConversions.scala +++ b/src/library/scala/concurrent/JavaConversions.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/Lock.scala b/src/library/scala/concurrent/Lock.scala index 584ce7d187..678d6fe307 100644 --- a/src/library/scala/concurrent/Lock.scala +++ b/src/library/scala/concurrent/Lock.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/MailBox.scala b/src/library/scala/concurrent/MailBox.scala index c23bbf1c80..7d2b2761d5 100644 --- a/src/library/scala/concurrent/MailBox.scala +++ b/src/library/scala/concurrent/MailBox.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/ManagedBlocker.scala b/src/library/scala/concurrent/ManagedBlocker.scala index dfda9ae487..68781a893c 100644 --- a/src/library/scala/concurrent/ManagedBlocker.scala +++ b/src/library/scala/concurrent/ManagedBlocker.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/SyncChannel.scala b/src/library/scala/concurrent/SyncChannel.scala index a1579afb6a..1c025bcfc3 100644 --- a/src/library/scala/concurrent/SyncChannel.scala +++ b/src/library/scala/concurrent/SyncChannel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/SyncVar.scala b/src/library/scala/concurrent/SyncVar.scala index 621bbe6803..46dc415e1f 100644 --- a/src/library/scala/concurrent/SyncVar.scala +++ b/src/library/scala/concurrent/SyncVar.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/TIMEOUT.scala b/src/library/scala/concurrent/TIMEOUT.scala index e6e9ce781f..cd2d861305 100644 --- a/src/library/scala/concurrent/TIMEOUT.scala +++ b/src/library/scala/concurrent/TIMEOUT.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/TaskRunner.scala b/src/library/scala/concurrent/TaskRunner.scala index f7d3002b83..b8791cf249 100644 --- a/src/library/scala/concurrent/TaskRunner.scala +++ b/src/library/scala/concurrent/TaskRunner.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/TaskRunners.scala b/src/library/scala/concurrent/TaskRunners.scala index 04d915bcd8..4936240f2f 100644 --- a/src/library/scala/concurrent/TaskRunners.scala +++ b/src/library/scala/concurrent/TaskRunners.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/ThreadPoolRunner.scala b/src/library/scala/concurrent/ThreadPoolRunner.scala index 9ad33f4c6c..74f376e87e 100644 --- a/src/library/scala/concurrent/ThreadPoolRunner.scala +++ b/src/library/scala/concurrent/ThreadPoolRunner.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/ThreadRunner.scala b/src/library/scala/concurrent/ThreadRunner.scala index 5cfc076699..2eb05840f4 100644 --- a/src/library/scala/concurrent/ThreadRunner.scala +++ b/src/library/scala/concurrent/ThreadRunner.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/ops.scala b/src/library/scala/concurrent/ops.scala index 49be1b882c..72e292d88c 100644 --- a/src/library/scala/concurrent/ops.scala +++ b/src/library/scala/concurrent/ops.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/concurrent/pilib.scala b/src/library/scala/concurrent/pilib.scala index b9f1617d6c..dab9db98ff 100644 --- a/src/library/scala/concurrent/pilib.scala +++ b/src/library/scala/concurrent/pilib.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.concurrent diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala index 79abe6a0ee..50a6601d00 100644 --- a/src/library/scala/deprecated.scala +++ b/src/library/scala/deprecated.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/inline.scala b/src/library/scala/inline.scala index 119f56ea93..1e91be2b17 100644 --- a/src/library/scala/inline.scala +++ b/src/library/scala/inline.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/io/BufferedSource.scala b/src/library/scala/io/BufferedSource.scala index 6b7afd0955..b4e0389e12 100644 --- a/src/library/scala/io/BufferedSource.scala +++ b/src/library/scala/io/BufferedSource.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/io/BytePickle.scala b/src/library/scala/io/BytePickle.scala index 77f66bbc49..3a51f2e0b8 100644 --- a/src/library/scala/io/BytePickle.scala +++ b/src/library/scala/io/BytePickle.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/io/Codec.scala b/src/library/scala/io/Codec.scala index 660a1553a4..2b74c67134 100644 --- a/src/library/scala/io/Codec.scala +++ b/src/library/scala/io/Codec.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/io/Position.scala b/src/library/scala/io/Position.scala index 0e5d4ffb7f..b0aaf228f2 100644 --- a/src/library/scala/io/Position.scala +++ b/src/library/scala/io/Position.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala index e88bfd0bf1..5b279d720c 100644 --- a/src/library/scala/io/Source.scala +++ b/src/library/scala/io/Source.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/io/UTF8Codec.scala b/src/library/scala/io/UTF8Codec.scala index 1a9d0f50ce..41563a9d44 100644 --- a/src/library/scala/io/UTF8Codec.scala +++ b/src/library/scala/io/UTF8Codec.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.io diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala index 67604e8b78..e1d44862e4 100644 --- a/src/library/scala/math/BigDecimal.scala +++ b/src/library/scala/math/BigDecimal.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math @@ -14,6 +13,8 @@ import java.{ lang => jl } import java.math.{ MathContext, BigDecimal => BigDec } import scala.collection.immutable.NumericRange +import annotation.migration + /** * @author Stephane Micheloud * @version 1.0 @@ -172,14 +173,15 @@ extends ScalaNumber with ScalaNumericConversions */ override def hashCode(): Int = if (isWhole) unifiedPrimitiveHashcode - else doubleValue.hashCode() + else doubleValue.## /** Compares this BigDecimal with the specified value for equality. */ override def equals (that: Any): Boolean = that match { - case that: BigDecimal => this equals that - case that: BigInt => this.toBigIntExact exists (that equals _) - case x => (this <= BigDecimal.MaxLong && this >= BigDecimal.MinLong) && unifiedPrimitiveEquals(x) + case that: BigDecimal => this equals that + case that: BigInt => this.toBigIntExact exists (that equals _) + case _: Float | _: Double => unifiedPrimitiveEquals(that) + case x => isWhole && this <= BigDecimal.MaxLong && this >= BigDecimal.MinLong && unifiedPrimitiveEquals(x) } protected[math] def isWhole = (this remainder 1) == BigDecimal(0) @@ -250,6 +252,10 @@ extends ScalaNumber with ScalaNumericConversions */ def remainder (that: BigDecimal): BigDecimal = this.bigDecimal.remainder(that.bigDecimal, mc) + /** Remainder after dividing this by that. + */ + def % (that: BigDecimal): BigDecimal = this.remainder(that) + /** Returns a BigDecimal whose value is this ** n. */ def pow (n: Int): BigDecimal = this.bigDecimal.pow(n, mc) diff --git a/src/library/scala/math/BigInt.scala b/src/library/scala/math/BigInt.scala index f0988f2934..79b377bc6c 100644 --- a/src/library/scala/math/BigInt.scala +++ b/src/library/scala/math/BigInt.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math @@ -117,7 +116,7 @@ class BigInt(val bigInteger: BigInteger) extends ScalaNumber with ScalaNumericCo /** Returns the hash code for this BigInt. */ override def hashCode(): Int = if (this >= BigInt.MinLong && this <= BigInt.MaxLong) unifiedPrimitiveHashcode - else bigInteger.hashCode + else bigInteger.## /** Compares this BigInt with the specified value for equality. */ diff --git a/src/library/scala/math/Equiv.scala b/src/library/scala/math/Equiv.scala index ee1e19fe50..a45b51af49 100644 --- a/src/library/scala/math/Equiv.scala +++ b/src/library/scala/math/Equiv.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/Fractional.scala b/src/library/scala/math/Fractional.scala index 7c888624d5..2205aded7f 100644 --- a/src/library/scala/math/Fractional.scala +++ b/src/library/scala/math/Fractional.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/Integral.scala b/src/library/scala/math/Integral.scala index 206e82c201..2914c9005b 100644 --- a/src/library/scala/math/Integral.scala +++ b/src/library/scala/math/Integral.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/Numeric.scala b/src/library/scala/math/Numeric.scala index 65f213a08e..673461132f 100644 --- a/src/library/scala/math/Numeric.scala +++ b/src/library/scala/math/Numeric.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/Ordered.scala b/src/library/scala/math/Ordered.scala index 5de733966e..30246c7b16 100644 --- a/src/library/scala/math/Ordered.scala +++ b/src/library/scala/math/Ordered.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/Ordering.scala b/src/library/scala/math/Ordering.scala index 04c2d96aba..4527e18338 100644 --- a/src/library/scala/math/Ordering.scala +++ b/src/library/scala/math/Ordering.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/PartialOrdering.scala b/src/library/scala/math/PartialOrdering.scala index 94a54b68e1..e40a3d29ad 100644 --- a/src/library/scala/math/PartialOrdering.scala +++ b/src/library/scala/math/PartialOrdering.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/PartiallyOrdered.scala b/src/library/scala/math/PartiallyOrdered.scala index d31497ad3b..2e863ec088 100644 --- a/src/library/scala/math/PartiallyOrdered.scala +++ b/src/library/scala/math/PartiallyOrdered.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.math diff --git a/src/library/scala/math/ScalaNumber.java b/src/library/scala/math/ScalaNumber.java index 8b0fcbd7ec..4aa920496c 100644 --- a/src/library/scala/math/ScalaNumber.java +++ b/src/library/scala/math/ScalaNumber.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: ScalaNumber.java 19428 2009-11-06 23:59:26Z extempore $ package scala.math; diff --git a/src/library/scala/math/ScalaNumericConversions.scala b/src/library/scala/math/ScalaNumericConversions.scala index 2e754c2584..34698ea39f 100644 --- a/src/library/scala/math/ScalaNumericConversions.scala +++ b/src/library/scala/math/ScalaNumericConversions.scala @@ -30,7 +30,7 @@ trait ScalaNumericConversions extends ScalaNumber { protected def unifiedPrimitiveHashcode() = { val lv = toLong if (lv >= Int.MinValue && lv <= Int.MaxValue) lv.toInt - else lv.hashCode + else lv.## } /** Should only be called after all known non-primitive diff --git a/src/library/scala/mobile/Code.scala b/src/library/scala/mobile/Code.scala index 81e608d97b..fb43de27ab 100644 --- a/src/library/scala/mobile/Code.scala +++ b/src/library/scala/mobile/Code.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.mobile diff --git a/src/library/scala/mobile/Location.scala b/src/library/scala/mobile/Location.scala index 36d5920553..4b5f13111d 100644 --- a/src/library/scala/mobile/Location.scala +++ b/src/library/scala/mobile/Location.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.mobile diff --git a/src/library/scala/native.scala b/src/library/scala/native.scala index 8aeffe1632..8f5f3e8319 100644 --- a/src/library/scala/native.scala +++ b/src/library/scala/native.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/noinline.scala b/src/library/scala/noinline.scala index b966f5b890..18270e7bc5 100644 --- a/src/library/scala/noinline.scala +++ b/src/library/scala/noinline.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/package.scala b/src/library/scala/package.scala index 9f31623bdf..b92d420391 100644 --- a/src/library/scala/package.scala +++ b/src/library/scala/package.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package object scala { diff --git a/src/library/scala/ref/PhantomReference.scala b/src/library/scala/ref/PhantomReference.scala index 73746a948f..0ae2bc229c 100644 --- a/src/library/scala/ref/PhantomReference.scala +++ b/src/library/scala/ref/PhantomReference.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/ref/Reference.scala b/src/library/scala/ref/Reference.scala index 3ff77ef39c..64a0dc9ab0 100644 --- a/src/library/scala/ref/Reference.scala +++ b/src/library/scala/ref/Reference.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/ref/ReferenceQueue.scala b/src/library/scala/ref/ReferenceQueue.scala index 5ef74bbc95..d019005b70 100644 --- a/src/library/scala/ref/ReferenceQueue.scala +++ b/src/library/scala/ref/ReferenceQueue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/ref/ReferenceWrapper.scala b/src/library/scala/ref/ReferenceWrapper.scala index 5661737053..d112dcdd9d 100644 --- a/src/library/scala/ref/ReferenceWrapper.scala +++ b/src/library/scala/ref/ReferenceWrapper.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/ref/SoftReference.scala b/src/library/scala/ref/SoftReference.scala index 1026a85023..a9beb5cc16 100644 --- a/src/library/scala/ref/SoftReference.scala +++ b/src/library/scala/ref/SoftReference.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/ref/WeakReference.scala b/src/library/scala/ref/WeakReference.scala index e6386d9f24..6fb03a314b 100644 --- a/src/library/scala/ref/WeakReference.scala +++ b/src/library/scala/ref/WeakReference.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.ref diff --git a/src/library/scala/reflect/BeanDescription.scala b/src/library/scala/reflect/BeanDescription.scala index d32f486bc1..74ce8f2d37 100644 --- a/src/library/scala/reflect/BeanDescription.scala +++ b/src/library/scala/reflect/BeanDescription.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/BeanDisplayName.scala b/src/library/scala/reflect/BeanDisplayName.scala index e3364f3644..414905ae93 100644 --- a/src/library/scala/reflect/BeanDisplayName.scala +++ b/src/library/scala/reflect/BeanDisplayName.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/BeanInfo.scala b/src/library/scala/reflect/BeanInfo.scala index 1677519f59..5153263f6f 100644 --- a/src/library/scala/reflect/BeanInfo.scala +++ b/src/library/scala/reflect/BeanInfo.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/BeanInfoSkip.scala b/src/library/scala/reflect/BeanInfoSkip.scala index ac02c4005a..f480f6c7b5 100644 --- a/src/library/scala/reflect/BeanInfoSkip.scala +++ b/src/library/scala/reflect/BeanInfoSkip.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/BeanProperty.scala b/src/library/scala/reflect/BeanProperty.scala index 17f40cfca1..d784774882 100644 --- a/src/library/scala/reflect/BeanProperty.scala +++ b/src/library/scala/reflect/BeanProperty.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/BooleanBeanProperty.scala b/src/library/scala/reflect/BooleanBeanProperty.scala index eebdb98d9f..f90f11f7cb 100644 --- a/src/library/scala/reflect/BooleanBeanProperty.scala +++ b/src/library/scala/reflect/BooleanBeanProperty.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/ClassManifest.scala b/src/library/scala/reflect/ClassManifest.scala index ded013a4b5..0337ed6aed 100644 --- a/src/library/scala/reflect/ClassManifest.scala +++ b/src/library/scala/reflect/ClassManifest.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect @@ -86,7 +85,7 @@ trait ClassManifest[T] extends OptManifest[T] with Equals { case m: ClassManifest[_] if m canEqual this => this.erasure == m.erasure case _ => false } - override def hashCode = this.erasure.hashCode + override def hashCode = this.erasure.## protected def arrayClass[T](tp: Predef.Class[_]): Predef.Class[Array[T]] = java.lang.reflect.Array.newInstance(tp, 0).getClass.asInstanceOf[Predef.Class[Array[T]]] diff --git a/src/library/scala/reflect/Code.scala b/src/library/scala/reflect/Code.scala index 61138f2495..36537ba447 100644 --- a/src/library/scala/reflect/Code.scala +++ b/src/library/scala/reflect/Code.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala index d718011ff9..6faa99c4c8 100644 --- a/src/library/scala/reflect/Manifest.scala +++ b/src/library/scala/reflect/Manifest.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect @@ -41,7 +40,7 @@ trait Manifest[T] extends ClassManifest[T] with Equals { case m: Manifest[_] if m canEqual this => (this <:< m) && (m <:< this) case _ => false } - override def hashCode = this.erasure.hashCode + override def hashCode = this.erasure.## } @serializable diff --git a/src/library/scala/reflect/NameTransformer.scala b/src/library/scala/reflect/NameTransformer.scala index 0629c3a2f8..31c789e33f 100755 --- a/src/library/scala/reflect/NameTransformer.scala +++ b/src/library/scala/reflect/NameTransformer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id: NameTransformer.scala 20028 2009-12-07 11:49:19Z cunei $ package scala.reflect diff --git a/src/library/scala/reflect/NoManifest.scala b/src/library/scala/reflect/NoManifest.scala index 29e485a914..d0497d4244 100644 --- a/src/library/scala/reflect/NoManifest.scala +++ b/src/library/scala/reflect/NoManifest.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/OptManifest.scala b/src/library/scala/reflect/OptManifest.scala index e82aa000bd..f3ccef5af0 100644 --- a/src/library/scala/reflect/OptManifest.scala +++ b/src/library/scala/reflect/OptManifest.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/Print.scala b/src/library/scala/reflect/Print.scala index f15a9583ba..adf3860f88 100644 --- a/src/library/scala/reflect/Print.scala +++ b/src/library/scala/reflect/Print.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/ScalaBeanInfo.scala b/src/library/scala/reflect/ScalaBeanInfo.scala index 89b85d0269..0ac47b6253 100644 --- a/src/library/scala/reflect/ScalaBeanInfo.scala +++ b/src/library/scala/reflect/ScalaBeanInfo.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/Symbol.scala b/src/library/scala/reflect/Symbol.scala index 733aa7bf2c..74960f3d1a 100644 --- a/src/library/scala/reflect/Symbol.scala +++ b/src/library/scala/reflect/Symbol.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/Tree.scala b/src/library/scala/reflect/Tree.scala index 0e6fe7153c..ff7fc73c8a 100644 --- a/src/library/scala/reflect/Tree.scala +++ b/src/library/scala/reflect/Tree.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/Type.scala b/src/library/scala/reflect/Type.scala index 1a09bf1e94..029bb3966e 100644 --- a/src/library/scala/reflect/Type.scala +++ b/src/library/scala/reflect/Type.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.reflect diff --git a/src/library/scala/reflect/generic/Constants.scala b/src/library/scala/reflect/generic/Constants.scala index 2fe9d24980..bf963a1aae 100755 --- a/src/library/scala/reflect/generic/Constants.scala +++ b/src/library/scala/reflect/generic/Constants.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id: Constants.scala 20028 2009-12-07 11:49:19Z cunei $ package scala.reflect package generic @@ -231,6 +230,6 @@ trait Constants { self: Universe => def symbolValue: Symbol = value.asInstanceOf[Symbol] override def hashCode: Int = - if (value == null) 0 else value.hashCode() * 41 + 17 + if (value == null) 0 else value.## * 41 + 17 } } diff --git a/src/library/scala/reflect/generic/PickleBuffer.scala b/src/library/scala/reflect/generic/PickleBuffer.scala index 2fab02bcfe..14190016b8 100755 --- a/src/library/scala/reflect/generic/PickleBuffer.scala +++ b/src/library/scala/reflect/generic/PickleBuffer.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id: PickleBuffer.scala 20028 2009-12-07 11:49:19Z cunei $ package scala.reflect package generic diff --git a/src/library/scala/reflect/generic/StandardDefinitions.scala b/src/library/scala/reflect/generic/StandardDefinitions.scala index 24dce7173a..c754fca808 100755 --- a/src/library/scala/reflect/generic/StandardDefinitions.scala +++ b/src/library/scala/reflect/generic/StandardDefinitions.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id: Definitions.scala 20619 2010-01-20 10:55:56Z rytz $ package scala.reflect package generic diff --git a/src/library/scala/reflect/generic/UnPickler.scala b/src/library/scala/reflect/generic/UnPickler.scala index d7eef770cc..ee021446bc 100755 --- a/src/library/scala/reflect/generic/UnPickler.scala +++ b/src/library/scala/reflect/generic/UnPickler.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Martin Odersky */ -// $Id: UnPickler.scala 20716 2010-01-28 14:14:20Z rytz $ package scala.reflect package generic diff --git a/src/library/scala/remote.scala b/src/library/scala/remote.scala index 6ccfa28fdc..bcbc597338 100644 --- a/src/library/scala/remote.scala +++ b/src/library/scala/remote.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/runtime/AbstractFunction1.scala b/src/library/scala/runtime/AbstractFunction1.scala index 64945e9f51..be125d1566 100644 --- a/src/library/scala/runtime/AbstractFunction1.scala +++ b/src/library/scala/runtime/AbstractFunction1.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction10.scala b/src/library/scala/runtime/AbstractFunction10.scala index d6f6a225c9..5e44dc7513 100644 --- a/src/library/scala/runtime/AbstractFunction10.scala +++ b/src/library/scala/runtime/AbstractFunction10.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction11.scala b/src/library/scala/runtime/AbstractFunction11.scala index 6ffb8e6a7e..c7e7d2de28 100644 --- a/src/library/scala/runtime/AbstractFunction11.scala +++ b/src/library/scala/runtime/AbstractFunction11.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction12.scala b/src/library/scala/runtime/AbstractFunction12.scala index 733a0cc81d..6ca4602d00 100644 --- a/src/library/scala/runtime/AbstractFunction12.scala +++ b/src/library/scala/runtime/AbstractFunction12.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction13.scala b/src/library/scala/runtime/AbstractFunction13.scala index 60242cae17..f5f4d6f89f 100644 --- a/src/library/scala/runtime/AbstractFunction13.scala +++ b/src/library/scala/runtime/AbstractFunction13.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction14.scala b/src/library/scala/runtime/AbstractFunction14.scala index 306a3a7f6f..686f0e42b8 100644 --- a/src/library/scala/runtime/AbstractFunction14.scala +++ b/src/library/scala/runtime/AbstractFunction14.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction15.scala b/src/library/scala/runtime/AbstractFunction15.scala index fd2a341388..62b70ba7f9 100644 --- a/src/library/scala/runtime/AbstractFunction15.scala +++ b/src/library/scala/runtime/AbstractFunction15.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction16.scala b/src/library/scala/runtime/AbstractFunction16.scala index 9d0b2512da..6bd555f2c5 100644 --- a/src/library/scala/runtime/AbstractFunction16.scala +++ b/src/library/scala/runtime/AbstractFunction16.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction17.scala b/src/library/scala/runtime/AbstractFunction17.scala index ebf76d3de8..d679dd5a82 100644 --- a/src/library/scala/runtime/AbstractFunction17.scala +++ b/src/library/scala/runtime/AbstractFunction17.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction18.scala b/src/library/scala/runtime/AbstractFunction18.scala index 4906c0f7cf..04d05157a4 100644 --- a/src/library/scala/runtime/AbstractFunction18.scala +++ b/src/library/scala/runtime/AbstractFunction18.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction19.scala b/src/library/scala/runtime/AbstractFunction19.scala index 1c8c87c0fd..0f0b4f847a 100644 --- a/src/library/scala/runtime/AbstractFunction19.scala +++ b/src/library/scala/runtime/AbstractFunction19.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction2.scala b/src/library/scala/runtime/AbstractFunction2.scala index 1dad0963b7..75dfc5e0a9 100644 --- a/src/library/scala/runtime/AbstractFunction2.scala +++ b/src/library/scala/runtime/AbstractFunction2.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction20.scala b/src/library/scala/runtime/AbstractFunction20.scala index e76d60e774..6df9fff32f 100644 --- a/src/library/scala/runtime/AbstractFunction20.scala +++ b/src/library/scala/runtime/AbstractFunction20.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction21.scala b/src/library/scala/runtime/AbstractFunction21.scala index 75f314aa46..44a81e0ba9 100644 --- a/src/library/scala/runtime/AbstractFunction21.scala +++ b/src/library/scala/runtime/AbstractFunction21.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction22.scala b/src/library/scala/runtime/AbstractFunction22.scala index bd9a3d1bbd..5fc2d331ea 100644 --- a/src/library/scala/runtime/AbstractFunction22.scala +++ b/src/library/scala/runtime/AbstractFunction22.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction3.scala b/src/library/scala/runtime/AbstractFunction3.scala index 3d479c99fa..77473dda6f 100644 --- a/src/library/scala/runtime/AbstractFunction3.scala +++ b/src/library/scala/runtime/AbstractFunction3.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction4.scala b/src/library/scala/runtime/AbstractFunction4.scala index 3492c91cbd..6aaabe22d4 100644 --- a/src/library/scala/runtime/AbstractFunction4.scala +++ b/src/library/scala/runtime/AbstractFunction4.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction5.scala b/src/library/scala/runtime/AbstractFunction5.scala index 5aab3f065f..aae3ff44a2 100644 --- a/src/library/scala/runtime/AbstractFunction5.scala +++ b/src/library/scala/runtime/AbstractFunction5.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction6.scala b/src/library/scala/runtime/AbstractFunction6.scala index e770603d69..1bef135b27 100644 --- a/src/library/scala/runtime/AbstractFunction6.scala +++ b/src/library/scala/runtime/AbstractFunction6.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction7.scala b/src/library/scala/runtime/AbstractFunction7.scala index 80eaf98de4..97ee37d0c2 100644 --- a/src/library/scala/runtime/AbstractFunction7.scala +++ b/src/library/scala/runtime/AbstractFunction7.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction8.scala b/src/library/scala/runtime/AbstractFunction8.scala index 9d844b7945..0a50727c6d 100644 --- a/src/library/scala/runtime/AbstractFunction8.scala +++ b/src/library/scala/runtime/AbstractFunction8.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/AbstractFunction9.scala b/src/library/scala/runtime/AbstractFunction9.scala index 1b90996a94..3685004fe1 100644 --- a/src/library/scala/runtime/AbstractFunction9.scala +++ b/src/library/scala/runtime/AbstractFunction9.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ // generated by genprod on Thu Apr 29 17:52:16 CEST 2010 diff --git a/src/library/scala/runtime/BooleanRef.java b/src/library/scala/runtime/BooleanRef.java index f4599219ef..bf43b470b4 100644 --- a/src/library/scala/runtime/BooleanRef.java +++ b/src/library/scala/runtime/BooleanRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; diff --git a/src/library/scala/runtime/Boxed.scala b/src/library/scala/runtime/Boxed.scala index fef180def0..46515a7997 100644 --- a/src/library/scala/runtime/Boxed.scala +++ b/src/library/scala/runtime/Boxed.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/BoxedUnit.java b/src/library/scala/runtime/BoxedUnit.java index 8ae4f650a9..2f1e56059f 100644 --- a/src/library/scala/runtime/BoxedUnit.java +++ b/src/library/scala/runtime/BoxedUnit.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; diff --git a/src/library/scala/runtime/BoxesRunTime.java b/src/library/scala/runtime/BoxesRunTime.java index 7c27835b5a..8bce46ea66 100644 --- a/src/library/scala/runtime/BoxesRunTime.java +++ b/src/library/scala/runtime/BoxesRunTime.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -33,13 +32,13 @@ public final class BoxesRunTime private static final int CHAR = 0, BYTE = 1, SHORT = 2, INT = 3, LONG = 4, FLOAT = 5, DOUBLE = 6, OTHER = 7; private static int typeCode(Object a) { - if (a instanceof Integer) return INT; - if (a instanceof Byte) return BYTE; - if (a instanceof Character) return CHAR; - if (a instanceof Long) return LONG; - if (a instanceof Double) return DOUBLE; - if (a instanceof Short) return SHORT; - if (a instanceof Float) return FLOAT; + if (a instanceof java.lang.Integer) return INT; + if (a instanceof java.lang.Byte) return BYTE; + if (a instanceof java.lang.Character) return CHAR; + if (a instanceof java.lang.Long) return LONG; + if (a instanceof java.lang.Double) return DOUBLE; + if (a instanceof java.lang.Short) return SHORT; + if (a instanceof java.lang.Float) return FLOAT; return OTHER; } @@ -49,80 +48,80 @@ public final class BoxesRunTime /* BOXING ... BOXING ... BOXING ... BOXING ... BOXING ... BOXING ... BOXING ... BOXING */ - public static Boolean boxToBoolean(boolean b) { - return Boolean.valueOf(b); + public static java.lang.Boolean boxToBoolean(boolean b) { + return java.lang.Boolean.valueOf(b); } - public static Character boxToCharacter(char c) { - return Character.valueOf(c); + public static java.lang.Character boxToCharacter(char c) { + return java.lang.Character.valueOf(c); } - public static Byte boxToByte(byte b) { - return Byte.valueOf(b); + public static java.lang.Byte boxToByte(byte b) { + return java.lang.Byte.valueOf(b); } - public static Short boxToShort(short s) { - return Short.valueOf(s); + public static java.lang.Short boxToShort(short s) { + return java.lang.Short.valueOf(s); } - public static Integer boxToInteger(int i) { - return Integer.valueOf(i); + public static java.lang.Integer boxToInteger(int i) { + return java.lang.Integer.valueOf(i); } - public static Long boxToLong(long l) { - return Long.valueOf(l); + public static java.lang.Long boxToLong(long l) { + return java.lang.Long.valueOf(l); } - public static Float boxToFloat(float f) { - return Float.valueOf(f); + public static java.lang.Float boxToFloat(float f) { + return java.lang.Float.valueOf(f); } - public static Double boxToDouble(double d) { - return Double.valueOf(d); + public static java.lang.Double boxToDouble(double d) { + return java.lang.Double.valueOf(d); } /* UNBOXING ... UNBOXING ... UNBOXING ... UNBOXING ... UNBOXING ... UNBOXING ... UNBOXING */ public static boolean unboxToBoolean(Object b) { - return b == null ? false : ((Boolean)b).booleanValue(); + return b == null ? false : ((java.lang.Boolean)b).booleanValue(); } public static char unboxToChar(Object c) { - return c == null ? 0 : ((Character)c).charValue(); + return c == null ? 0 : ((java.lang.Character)c).charValue(); } public static byte unboxToByte(Object b) { - return b == null ? 0 : ((Byte)b).byteValue(); + return b == null ? 0 : ((java.lang.Byte)b).byteValue(); } public static short unboxToShort(Object s) { - return s == null ? 0 : ((Short)s).shortValue(); + return s == null ? 0 : ((java.lang.Short)s).shortValue(); } public static int unboxToInt(Object i) { - return i == null ? 0 : ((Integer)i).intValue(); + return i == null ? 0 : ((java.lang.Integer)i).intValue(); } public static long unboxToLong(Object l) { - return l == null ? 0 : ((Long)l).longValue(); + return l == null ? 0 : ((java.lang.Long)l).longValue(); } public static float unboxToFloat(Object f) { - return f == null ? 0.0f : ((Float)f).floatValue(); + return f == null ? 0.0f : ((java.lang.Float)f).floatValue(); } public static double unboxToDouble(Object d) { - return d == null ? 0.0d : ((Double)d).doubleValue(); + return d == null ? 0.0d : ((java.lang.Double)d).doubleValue(); } /* COMPARISON ... COMPARISON ... COMPARISON ... COMPARISON ... COMPARISON ... COMPARISON */ private static int eqTypeCode(Number a) { - if ((a instanceof Integer) || (a instanceof Byte)) return INT; - if (a instanceof Long) return LONG; - if (a instanceof Double) return DOUBLE; - if (a instanceof Short) return INT; - if (a instanceof Float) return FLOAT; + if ((a instanceof java.lang.Integer) || (a instanceof java.lang.Byte)) return INT; + if (a instanceof java.lang.Long) return LONG; + if (a instanceof java.lang.Double) return DOUBLE; + if (a instanceof java.lang.Short) return INT; + if (a instanceof java.lang.Float) return FLOAT; return OTHER; } @@ -136,24 +135,24 @@ public final class BoxesRunTime * in any case, we dispatch to it as soon as we spot one on either side. */ public static boolean equals2(Object x, Object y) { - if (x instanceof Number) - return equalsNumObject((Number)x, y); - if (x instanceof Character) - return equalsCharObject((Character)x, y); + if (x instanceof java.lang.Number) + return equalsNumObject((java.lang.Number)x, y); + if (x instanceof java.lang.Character) + return equalsCharObject((java.lang.Character)x, y); return x.equals(y); } - public static boolean equalsNumObject(Number xn, Object y) { - if (y instanceof Number) - return equalsNumNum(xn, (Number)y); - else if (y instanceof Character) - return equalsNumChar(xn, (Character)y); + public static boolean equalsNumObject(java.lang.Number xn, Object y) { + if (y instanceof java.lang.Number) + return equalsNumNum(xn, (java.lang.Number)y); + else if (y instanceof java.lang.Character) + return equalsNumChar(xn, (java.lang.Character)y); return xn.equals(y); } - public static boolean equalsNumNum(Number xn, Number yn) { + public static boolean equalsNumNum(java.lang.Number xn, java.lang.Number yn) { int xcode = eqTypeCode(xn); int ycode = eqTypeCode(yn); switch (ycode > xcode ? ycode : xcode) { @@ -172,16 +171,16 @@ public final class BoxesRunTime return xn.equals(yn); } - public static boolean equalsCharObject(Character xc, Object y) { - if (y instanceof Character) - return xc.charValue() == ((Character)y).charValue(); - if (y instanceof Number) - return equalsNumChar((Number)y, xc); + public static boolean equalsCharObject(java.lang.Character xc, Object y) { + if (y instanceof java.lang.Character) + return xc.charValue() == ((java.lang.Character)y).charValue(); + if (y instanceof java.lang.Number) + return equalsNumChar((java.lang.Number)y, xc); return xc.equals(y); } - private static boolean equalsNumChar(Number xn, Character yc) { + private static boolean equalsNumChar(java.lang.Number xn, java.lang.Character yc) { char ch = yc.charValue(); switch (eqTypeCode(xn)) { case INT: @@ -224,33 +223,33 @@ public final class BoxesRunTime * Note: Among primitives, Float.NaN != Float.NaN, but the boxed * verisons are equal. This still needs reconciliation. */ - public static int hashFromLong(Long n) { + public static int hashFromLong(java.lang.Long n) { int iv = n.intValue(); if (iv == n.longValue()) return iv; else return n.hashCode(); } - public static int hashFromDouble(Double n) { + public static int hashFromDouble(java.lang.Double n) { int iv = n.intValue(); double dv = n.doubleValue(); if (iv == dv) return iv; long lv = n.longValue(); - if (lv == dv) return Long.valueOf(lv).hashCode(); + if (lv == dv) return java.lang.Long.valueOf(lv).hashCode(); else return n.hashCode(); } - public static int hashFromFloat(Float n) { + public static int hashFromFloat(java.lang.Float n) { int iv = n.intValue(); float fv = n.floatValue(); if (iv == fv) return iv; long lv = n.longValue(); - if (lv == fv) return Long.valueOf(lv).hashCode(); + if (lv == fv) return java.lang.Long.valueOf(lv).hashCode(); else return n.hashCode(); } - public static int hashFromNumber(Number n) { - if (n instanceof Long) return hashFromLong((Long)n); - else if (n instanceof Double) return hashFromDouble((Double)n); - else if (n instanceof Float) return hashFromFloat((Float)n); + public static int hashFromNumber(java.lang.Number n) { + if (n instanceof java.lang.Long) return hashFromLong((java.lang.Long)n); + else if (n instanceof java.lang.Double) return hashFromDouble((java.lang.Double)n); + else if (n instanceof java.lang.Float) return hashFromFloat((java.lang.Float)n); else return n.hashCode(); } public static int hashFromObject(Object a) { @@ -266,23 +265,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 + val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 + val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToFloat(val1 + val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToDouble(val1 + val2); } throw new NoSuchMethodException(); @@ -294,23 +293,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 - val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 - val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToFloat(val1 - val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToDouble(val1 - val2); } throw new NoSuchMethodException(); @@ -322,23 +321,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 * val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 * val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToFloat(val1 * val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToDouble(val1 * val2); } throw new NoSuchMethodException(); @@ -350,23 +349,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 / val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 / val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToFloat(val1 / val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToDouble(val1 / val2); } throw new NoSuchMethodException(); @@ -378,23 +377,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 % val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 % val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToFloat(val1 % val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToDouble(val1 % val2); } throw new NoSuchMethodException(); @@ -405,24 +404,24 @@ public final class BoxesRunTime int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 >> val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToInteger(val1 >> val2); } } if (code1 <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToLong(val1 >> val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 >> val2); } } @@ -434,24 +433,24 @@ public final class BoxesRunTime int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 << val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToInteger(val1 << val2); } } if (code1 <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToLong(val1 << val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 << val2); } } @@ -463,24 +462,24 @@ public final class BoxesRunTime int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 >>> val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToInteger(val1 >>> val2); } } if (code1 <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); if (code2 <= INT) { - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToLong(val1 >>> val2); } if (code2 <= LONG) { - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 >>> val2); } } @@ -491,19 +490,19 @@ public final class BoxesRunTime public static Object negate(Object arg) throws NoSuchMethodException { int code = typeCode(arg); if (code <= INT) { - int val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).intValue(); + int val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).intValue(); return boxToInteger(-val); } if (code <= LONG) { - long val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).longValue(); + long val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).longValue(); return boxToLong(-val); } if (code <= FLOAT) { - float val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).floatValue(); + float val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).floatValue(); return boxToFloat(-val); } if (code <= DOUBLE) { - double val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).doubleValue(); + double val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).doubleValue(); return boxToDouble(-val); } throw new NoSuchMethodException(); @@ -513,19 +512,19 @@ public final class BoxesRunTime public static Object positive(Object arg) throws NoSuchMethodException { int code = typeCode(arg); if (code <= INT) { - int val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).intValue(); + int val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).intValue(); return boxToInteger(+val); } if (code <= LONG) { - long val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).longValue(); + long val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).longValue(); return boxToLong(+val); } if (code <= FLOAT) { - float val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).floatValue(); + float val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).floatValue(); return boxToFloat(+val); } if (code <= DOUBLE) { - double val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).doubleValue(); + double val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).doubleValue(); return boxToDouble(+val); } throw new NoSuchMethodException(); @@ -537,19 +536,19 @@ public final class BoxesRunTime if (!((arg1 instanceof Boolean) && (arg2 instanceof Boolean))) { throw new NoSuchMethodException(); } - return boxToBoolean(((Boolean) arg1).booleanValue() & ((Boolean) arg2).booleanValue()); + return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() & ((java.lang.Boolean) arg2).booleanValue()); } int code1 = typeCode(arg1); int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 & val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 & val2); } throw new NoSuchMethodException(); @@ -561,19 +560,19 @@ public final class BoxesRunTime if (!((arg1 instanceof Boolean) && (arg2 instanceof Boolean))) { throw new NoSuchMethodException(); } - return boxToBoolean(((Boolean) arg1).booleanValue() | ((Boolean) arg2).booleanValue()); + return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() | ((java.lang.Boolean) arg2).booleanValue()); } int code1 = typeCode(arg1); int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 | val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 | val2); } throw new NoSuchMethodException(); @@ -585,19 +584,19 @@ public final class BoxesRunTime if (!((arg1 instanceof Boolean) && (arg2 instanceof Boolean))) { throw new NoSuchMethodException(); } - return boxToBoolean(((Boolean) arg1).booleanValue() ^ ((Boolean) arg2).booleanValue()); + return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() ^ ((java.lang.Boolean) arg2).booleanValue()); } int code1 = typeCode(arg1); int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToInteger(val1 ^ val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToLong(val1 ^ val2); } throw new NoSuchMethodException(); @@ -606,7 +605,7 @@ public final class BoxesRunTime /** arg1 && arg2 */ public static Object takeConditionalAnd(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) { - return boxToBoolean(((Boolean) arg1).booleanValue() && ((Boolean) arg2).booleanValue()); + return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() && ((java.lang.Boolean) arg2).booleanValue()); } throw new NoSuchMethodException(); } @@ -614,7 +613,7 @@ public final class BoxesRunTime /** arg1 || arg2 */ public static Object takeConditionalOr(Object arg1, Object arg2) throws NoSuchMethodException { if ((arg1 instanceof Boolean) && (arg2 instanceof Boolean)) { - return boxToBoolean(((Boolean) arg1).booleanValue() || ((Boolean) arg2).booleanValue()); + return boxToBoolean(((java.lang.Boolean) arg1).booleanValue() || ((java.lang.Boolean) arg2).booleanValue()); } throw new NoSuchMethodException(); } @@ -623,11 +622,11 @@ public final class BoxesRunTime public static Object complement(Object arg) throws NoSuchMethodException { int code = typeCode(arg); if (code <= INT) { - int val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).intValue(); + int val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).intValue(); return boxToInteger(~val); } if (code <= LONG) { - long val = (code == CHAR) ? ((Character) arg).charValue() : ((Number) arg).longValue(); + long val = (code == CHAR) ? ((java.lang.Character) arg).charValue() : ((java.lang.Number) arg).longValue(); return boxToLong(~val); } throw new NoSuchMethodException(); @@ -636,7 +635,7 @@ public final class BoxesRunTime /** !arg */ public static Object takeNot(Object arg) throws NoSuchMethodException { if (arg instanceof Boolean) { - return boxToBoolean(!((Boolean) arg).booleanValue()); + return boxToBoolean(!((java.lang.Boolean) arg).booleanValue()); } throw new NoSuchMethodException(); } @@ -654,23 +653,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToBoolean(val1 < val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToBoolean(val1 < val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToBoolean(val1 < val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToBoolean(val1 < val2); } throw new NoSuchMethodException(); @@ -681,23 +680,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToBoolean(val1 <= val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToBoolean(val1 <= val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToBoolean(val1 <= val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToBoolean(val1 <= val2); } throw new NoSuchMethodException(); @@ -708,23 +707,23 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToBoolean(val1 >= val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToBoolean(val1 >= val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToBoolean(val1 >= val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToBoolean(val1 >= val2); } throw new NoSuchMethodException(); @@ -735,109 +734,109 @@ public final class BoxesRunTime int code2 = typeCode(arg2); int maxcode = (code1 < code2) ? code2 : code1; if (maxcode <= INT) { - int val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).intValue(); - int val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).intValue(); + int val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).intValue(); + int val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).intValue(); return boxToBoolean(val1 > val2); } if (maxcode <= LONG) { - long val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).longValue(); - long val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).longValue(); + long val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).longValue(); + long val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).longValue(); return boxToBoolean(val1 > val2); } if (maxcode <= FLOAT) { - float val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).floatValue(); - float val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).floatValue(); + float val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).floatValue(); + float val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).floatValue(); return boxToBoolean(val1 > val2); } if (maxcode <= DOUBLE) { - double val1 = (code1 == CHAR) ? ((Character) arg1).charValue() : ((Number) arg1).doubleValue(); - double val2 = (code2 == CHAR) ? ((Character) arg2).charValue() : ((Number) arg2).doubleValue(); + double val1 = (code1 == CHAR) ? ((java.lang.Character) arg1).charValue() : ((java.lang.Number) arg1).doubleValue(); + double val2 = (code2 == CHAR) ? ((java.lang.Character) arg2).charValue() : ((java.lang.Number) arg2).doubleValue(); return boxToBoolean(val1 > val2); } throw new NoSuchMethodException(); } /** arg.toChar */ - public static Character toCharacter(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToCharacter((char)unboxToInt(arg)); - if (arg instanceof Short) return boxToCharacter((char)unboxToShort(arg)); - if (arg instanceof Character) return (Character)arg; - if (arg instanceof Long) return boxToCharacter((char)unboxToLong(arg)); - if (arg instanceof Byte) return boxToCharacter((char)unboxToByte(arg)); - if (arg instanceof Float) return boxToCharacter((char)unboxToFloat(arg)); - if (arg instanceof Double) return boxToCharacter((char)unboxToDouble(arg)); + public static java.lang.Character toCharacter(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToCharacter((char)unboxToInt(arg)); + if (arg instanceof java.lang.Short) return boxToCharacter((char)unboxToShort(arg)); + if (arg instanceof java.lang.Character) return (java.lang.Character)arg; + if (arg instanceof java.lang.Long) return boxToCharacter((char)unboxToLong(arg)); + if (arg instanceof java.lang.Byte) return boxToCharacter((char)unboxToByte(arg)); + if (arg instanceof java.lang.Float) return boxToCharacter((char)unboxToFloat(arg)); + if (arg instanceof java.lang.Double) return boxToCharacter((char)unboxToDouble(arg)); throw new NoSuchMethodException(); } /** arg.toByte */ - public static Byte toByte(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToByte((byte)unboxToInt(arg)); - if (arg instanceof Character) return boxToByte((byte)unboxToChar(arg)); - if (arg instanceof Byte) return (Byte)arg; - if (arg instanceof Long) return boxToByte((byte)unboxToLong(arg)); - if (arg instanceof Short) return boxToByte((byte)unboxToShort(arg)); - if (arg instanceof Float) return boxToByte((byte)unboxToFloat(arg)); - if (arg instanceof Double) return boxToByte((byte)unboxToDouble(arg)); + public static java.lang.Byte toByte(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToByte((byte)unboxToInt(arg)); + if (arg instanceof java.lang.Character) return boxToByte((byte)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return (java.lang.Byte)arg; + if (arg instanceof java.lang.Long) return boxToByte((byte)unboxToLong(arg)); + if (arg instanceof java.lang.Short) return boxToByte((byte)unboxToShort(arg)); + if (arg instanceof java.lang.Float) return boxToByte((byte)unboxToFloat(arg)); + if (arg instanceof java.lang.Double) return boxToByte((byte)unboxToDouble(arg)); throw new NoSuchMethodException(); } /** arg.toShort */ - public static Short toShort(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToShort((short)unboxToInt(arg)); - if (arg instanceof Long) return boxToShort((short)unboxToLong(arg)); - if (arg instanceof Character) return boxToShort((short)unboxToChar(arg)); - if (arg instanceof Byte) return boxToShort((short)unboxToByte(arg)); - if (arg instanceof Short) return (Short)arg; - if (arg instanceof Float) return boxToShort((short)unboxToFloat(arg)); - if (arg instanceof Double) return boxToShort((short)unboxToDouble(arg)); + public static java.lang.Short toShort(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToShort((short)unboxToInt(arg)); + if (arg instanceof java.lang.Long) return boxToShort((short)unboxToLong(arg)); + if (arg instanceof java.lang.Character) return boxToShort((short)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return boxToShort((short)unboxToByte(arg)); + if (arg instanceof java.lang.Short) return (java.lang.Short)arg; + if (arg instanceof java.lang.Float) return boxToShort((short)unboxToFloat(arg)); + if (arg instanceof java.lang.Double) return boxToShort((short)unboxToDouble(arg)); throw new NoSuchMethodException(); } /** arg.toInt */ - public static Integer toInteger(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return (Integer)arg; - if (arg instanceof Long) return boxToInteger((int)unboxToLong(arg)); - if (arg instanceof Double) return boxToInteger((int)unboxToDouble(arg)); - if (arg instanceof Float) return boxToInteger((int)unboxToFloat(arg)); - if (arg instanceof Character) return boxToInteger((int)unboxToChar(arg)); - if (arg instanceof Byte) return boxToInteger((int)unboxToByte(arg)); - if (arg instanceof Short) return boxToInteger((int)unboxToShort(arg)); + public static java.lang.Integer toInteger(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return (java.lang.Integer)arg; + if (arg instanceof java.lang.Long) return boxToInteger((int)unboxToLong(arg)); + if (arg instanceof java.lang.Double) return boxToInteger((int)unboxToDouble(arg)); + if (arg instanceof java.lang.Float) return boxToInteger((int)unboxToFloat(arg)); + if (arg instanceof java.lang.Character) return boxToInteger((int)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return boxToInteger((int)unboxToByte(arg)); + if (arg instanceof java.lang.Short) return boxToInteger((int)unboxToShort(arg)); throw new NoSuchMethodException(); } /** arg.toLong */ - public static Long toLong(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToLong((long)unboxToInt(arg)); - if (arg instanceof Double) return boxToLong((long)unboxToDouble(arg)); - if (arg instanceof Float) return boxToLong((long)unboxToFloat(arg)); - if (arg instanceof Long) return (Long)arg; - if (arg instanceof Character) return boxToLong((long)unboxToChar(arg)); - if (arg instanceof Byte) return boxToLong((long)unboxToByte(arg)); - if (arg instanceof Short) return boxToLong((long)unboxToShort(arg)); + public static java.lang.Long toLong(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToLong((long)unboxToInt(arg)); + if (arg instanceof java.lang.Double) return boxToLong((long)unboxToDouble(arg)); + if (arg instanceof java.lang.Float) return boxToLong((long)unboxToFloat(arg)); + if (arg instanceof java.lang.Long) return (java.lang.Long)arg; + if (arg instanceof java.lang.Character) return boxToLong((long)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return boxToLong((long)unboxToByte(arg)); + if (arg instanceof java.lang.Short) return boxToLong((long)unboxToShort(arg)); throw new NoSuchMethodException(); } /** arg.toFloat */ - public static Float toFloat(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToFloat((float)unboxToInt(arg)); - if (arg instanceof Long) return boxToFloat((float)unboxToLong(arg)); - if (arg instanceof Float) return (Float)arg; - if (arg instanceof Double) return boxToFloat((float)unboxToDouble(arg)); - if (arg instanceof Character) return boxToFloat((float)unboxToChar(arg)); - if (arg instanceof Byte) return boxToFloat((float)unboxToByte(arg)); - if (arg instanceof Short) return boxToFloat((float)unboxToShort(arg)); + public static java.lang.Float toFloat(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToFloat((float)unboxToInt(arg)); + if (arg instanceof java.lang.Long) return boxToFloat((float)unboxToLong(arg)); + if (arg instanceof java.lang.Float) return (java.lang.Float)arg; + if (arg instanceof java.lang.Double) return boxToFloat((float)unboxToDouble(arg)); + if (arg instanceof java.lang.Character) return boxToFloat((float)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return boxToFloat((float)unboxToByte(arg)); + if (arg instanceof java.lang.Short) return boxToFloat((float)unboxToShort(arg)); throw new NoSuchMethodException(); } /** arg.toDouble */ - public static Double toDouble(Object arg) throws NoSuchMethodException { - if (arg instanceof Integer) return boxToDouble((double)unboxToInt(arg)); - if (arg instanceof Float) return boxToDouble((double)unboxToFloat(arg)); - if (arg instanceof Double) return (Double)arg; - if (arg instanceof Long) return boxToDouble((double)unboxToLong(arg)); - if (arg instanceof Character) return boxToDouble((double)unboxToChar(arg)); - if (arg instanceof Byte) return boxToDouble((double)unboxToByte(arg)); - if (arg instanceof Short) return boxToDouble((double)unboxToShort(arg)); + public static java.lang.Double toDouble(Object arg) throws NoSuchMethodException { + if (arg instanceof java.lang.Integer) return boxToDouble((double)unboxToInt(arg)); + if (arg instanceof java.lang.Float) return boxToDouble((double)unboxToFloat(arg)); + if (arg instanceof java.lang.Double) return (java.lang.Double)arg; + if (arg instanceof java.lang.Long) return boxToDouble((double)unboxToLong(arg)); + if (arg instanceof java.lang.Character) return boxToDouble((double)unboxToChar(arg)); + if (arg instanceof java.lang.Byte) return boxToDouble((double)unboxToByte(arg)); + if (arg instanceof java.lang.Short) return boxToDouble((double)unboxToShort(arg)); throw new NoSuchMethodException(); } diff --git a/src/library/scala/runtime/ByteRef.java b/src/library/scala/runtime/ByteRef.java index 99cbf1827f..fc0b4c7442 100644 --- a/src/library/scala/runtime/ByteRef.java +++ b/src/library/scala/runtime/ByteRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class ByteRef implements java.io.Serializable { public byte elem; public ByteRef(byte elem) { this.elem = elem; } - public String toString() { return Byte.toString(elem); } + public String toString() { return java.lang.Byte.toString(elem); } } diff --git a/src/library/scala/runtime/CharRef.java b/src/library/scala/runtime/CharRef.java index a5803df34f..48d712b2b9 100644 --- a/src/library/scala/runtime/CharRef.java +++ b/src/library/scala/runtime/CharRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class CharRef implements java.io.Serializable { public char elem; public CharRef(char elem) { this.elem = elem; } - public String toString() { return Character.toString(elem); } + public String toString() { return java.lang.Character.toString(elem); } } diff --git a/src/library/scala/runtime/DoubleRef.java b/src/library/scala/runtime/DoubleRef.java index c97ffd78d5..d112841a72 100644 --- a/src/library/scala/runtime/DoubleRef.java +++ b/src/library/scala/runtime/DoubleRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class DoubleRef implements java.io.Serializable { public double elem; public DoubleRef(double elem) { this.elem = elem; } - public String toString() { return Double.toString(elem); } + public String toString() { return java.lang.Double.toString(elem); } } diff --git a/src/library/scala/runtime/FloatRef.java b/src/library/scala/runtime/FloatRef.java index 4e32cc352f..1fec0e5bfc 100644 --- a/src/library/scala/runtime/FloatRef.java +++ b/src/library/scala/runtime/FloatRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class FloatRef implements java.io.Serializable { public float elem; public FloatRef(float elem) { this.elem = elem; } - public String toString() { return Float.toString(elem); } + public String toString() { return java.lang.Float.toString(elem); } } diff --git a/src/library/scala/runtime/IntRef.java b/src/library/scala/runtime/IntRef.java index 74e71a2987..647cffed7a 100644 --- a/src/library/scala/runtime/IntRef.java +++ b/src/library/scala/runtime/IntRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class IntRef implements java.io.Serializable { public int elem; public IntRef(int elem) { this.elem = elem; } - public String toString() { return Integer.toString(elem); } + public String toString() { return java.lang.Integer.toString(elem); } } diff --git a/src/library/scala/runtime/LongRef.java b/src/library/scala/runtime/LongRef.java index 890c59b28e..708fc12ebe 100644 --- a/src/library/scala/runtime/LongRef.java +++ b/src/library/scala/runtime/LongRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; @@ -17,5 +16,5 @@ public class LongRef implements java.io.Serializable { public long elem; public LongRef(long elem) { this.elem = elem; } - public String toString() { return Long.toString(elem); } + public String toString() { return java.lang.Long.toString(elem); } } diff --git a/src/library/scala/runtime/MethodCache.scala b/src/library/scala/runtime/MethodCache.scala index c2146547b7..a98ae3ae03 100644 --- a/src/library/scala/runtime/MethodCache.scala +++ b/src/library/scala/runtime/MethodCache.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/NonLocalReturnControl.scala b/src/library/scala/runtime/NonLocalReturnControl.scala index 5591d4871b..f8843e9c64 100644 --- a/src/library/scala/runtime/NonLocalReturnControl.scala +++ b/src/library/scala/runtime/NonLocalReturnControl.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/NonLocalReturnException.scala b/src/library/scala/runtime/NonLocalReturnException.scala deleted file mode 100644 index 19a216be7c..0000000000 --- a/src/library/scala/runtime/NonLocalReturnException.scala +++ /dev/null @@ -1,19 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime - -import scala.util.control.ControlThrowable - -/** !!! This class has been replaced by NonLocalReturnControl and should be deleted. - * But, it can't be deleted until starr is updated to use the new name. - */ -class NonLocalReturnException[T](val key: AnyRef, val value: T) extends ControlThrowable diff --git a/src/library/scala/runtime/Nothing$.scala b/src/library/scala/runtime/Nothing$.scala index 88d360a9bb..fd66996518 100644 --- a/src/library/scala/runtime/Nothing$.scala +++ b/src/library/scala/runtime/Nothing$.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/Null$.scala b/src/library/scala/runtime/Null$.scala index 808dee46a7..25662e1810 100644 --- a/src/library/scala/runtime/Null$.scala +++ b/src/library/scala/runtime/Null$.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/ObjectRef.java b/src/library/scala/runtime/ObjectRef.java index 2393ea146e..a1567b6e48 100644 --- a/src/library/scala/runtime/ObjectRef.java +++ b/src/library/scala/runtime/ObjectRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; diff --git a/src/library/scala/runtime/RichBoolean.scala b/src/library/scala/runtime/RichBoolean.scala index 297ee305e1..bfff5dae94 100644 --- a/src/library/scala/runtime/RichBoolean.scala +++ b/src/library/scala/runtime/RichBoolean.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichByte.scala b/src/library/scala/runtime/RichByte.scala index a20c890779..52ec045217 100644 --- a/src/library/scala/runtime/RichByte.scala +++ b/src/library/scala/runtime/RichByte.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichChar.scala b/src/library/scala/runtime/RichChar.scala index 1c95186558..b8324fa221 100644 --- a/src/library/scala/runtime/RichChar.scala +++ b/src/library/scala/runtime/RichChar.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichDouble.scala b/src/library/scala/runtime/RichDouble.scala index 5a9451cee6..64976acb12 100644 --- a/src/library/scala/runtime/RichDouble.scala +++ b/src/library/scala/runtime/RichDouble.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichException.scala b/src/library/scala/runtime/RichException.scala index 8c023f64a1..a806a3cf5e 100644 --- a/src/library/scala/runtime/RichException.scala +++ b/src/library/scala/runtime/RichException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichFloat.scala b/src/library/scala/runtime/RichFloat.scala index 4858ea92d5..e8e351bdaa 100644 --- a/src/library/scala/runtime/RichFloat.scala +++ b/src/library/scala/runtime/RichFloat.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichInt.scala b/src/library/scala/runtime/RichInt.scala index c949ab8129..30fc010d17 100644 --- a/src/library/scala/runtime/RichInt.scala +++ b/src/library/scala/runtime/RichInt.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichLong.scala b/src/library/scala/runtime/RichLong.scala index 6b9ca76e7f..bf573abc62 100644 --- a/src/library/scala/runtime/RichLong.scala +++ b/src/library/scala/runtime/RichLong.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichShort.scala b/src/library/scala/runtime/RichShort.scala index 45f818b2c9..0fa34b27c4 100644 --- a/src/library/scala/runtime/RichShort.scala +++ b/src/library/scala/runtime/RichShort.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/RichUnit.scala b/src/library/scala/runtime/RichUnit.scala index bce60f90c6..982ec8b963 100644 --- a/src/library/scala/runtime/RichUnit.scala +++ b/src/library/scala/runtime/RichUnit.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala index a0bdd122e6..26dc0830e5 100644 --- a/src/library/scala/runtime/ScalaRunTime.scala +++ b/src/library/scala/runtime/ScalaRunTime.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime @@ -155,7 +154,7 @@ object ScalaRunTime { var i = 0 while (i < arr) { val elem = x.productElement(i) - code = code * 41 + (if (elem == null) 0 else elem.hashCode()) + code = code * 41 + (if (elem == null) 0 else elem.##) i += 1 } code @@ -176,6 +175,9 @@ object ScalaRunTime { } // hashcode ----------------------------------------------------------- + // + // Note that these are the implementations called by ##, so they + // must not call ## themselves. @inline def hash(x: Any): Int = if (x.isInstanceOf[java.lang.Number]) BoxesRunTime.hashFromNumber(x.asInstanceOf[java.lang.Number]) diff --git a/src/library/scala/runtime/ShortRef.java b/src/library/scala/runtime/ShortRef.java index b14b5b8e53..eadacaca19 100644 --- a/src/library/scala/runtime/ShortRef.java +++ b/src/library/scala/runtime/ShortRef.java @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.runtime; diff --git a/src/library/scala/runtime/StringAdd.scala b/src/library/scala/runtime/StringAdd.scala index 8325abddc2..5ec865eac8 100644 --- a/src/library/scala/runtime/StringAdd.scala +++ b/src/library/scala/runtime/StringAdd.scala @@ -6,7 +6,6 @@ ** ** \* */ -// $Id$ package scala.runtime diff --git a/src/library/scala/serializable.scala b/src/library/scala/serializable.scala index 48a04c5f1a..6269359cd8 100644 --- a/src/library/scala/serializable.scala +++ b/src/library/scala/serializable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/specialized.scala b/src/library/scala/specialized.scala index 4ac3037328..f4ce207c4b 100644 --- a/src/library/scala/specialized.scala +++ b/src/library/scala/specialized.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/testing/Benchmark.scala b/src/library/scala/testing/Benchmark.scala index bb7e50a3aa..8e29d740db 100644 --- a/src/library/scala/testing/Benchmark.scala +++ b/src/library/scala/testing/Benchmark.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.testing diff --git a/src/library/scala/testing/SUnit.scala b/src/library/scala/testing/SUnit.scala index d5d845cb98..1ea54f4982 100644 --- a/src/library/scala/testing/SUnit.scala +++ b/src/library/scala/testing/SUnit.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.testing diff --git a/src/library/scala/testing/Show.scala b/src/library/scala/testing/Show.scala index d5e932e6ff..f0efa691ac 100644 --- a/src/library/scala/testing/Show.scala +++ b/src/library/scala/testing/Show.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.testing diff --git a/src/library/scala/text/Document.scala b/src/library/scala/text/Document.scala index d201938832..b44741dfe8 100644 --- a/src/library/scala/text/Document.scala +++ b/src/library/scala/text/Document.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.text diff --git a/src/library/scala/throws.scala b/src/library/scala/throws.scala index b932ccc7ac..62dfc8fc96 100644 --- a/src/library/scala/throws.scala +++ b/src/library/scala/throws.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/transient.scala b/src/library/scala/transient.scala index aea7ba7b5f..12aa15fd1f 100644 --- a/src/library/scala/transient.scala +++ b/src/library/scala/transient.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/unchecked.scala b/src/library/scala/unchecked.scala index 3dbbc9dad0..7cdce63380 100644 --- a/src/library/scala/unchecked.scala +++ b/src/library/scala/unchecked.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/util/DynamicVariable.scala b/src/library/scala/util/DynamicVariable.scala index ff2f6206f6..52d1763123 100644 --- a/src/library/scala/util/DynamicVariable.scala +++ b/src/library/scala/util/DynamicVariable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util diff --git a/src/library/scala/util/JenkinsHash.scala b/src/library/scala/util/JenkinsHash.scala index fcd263f5c9..83df5ad834 100644 --- a/src/library/scala/util/JenkinsHash.scala +++ b/src/library/scala/util/JenkinsHash.scala @@ -124,7 +124,7 @@ object JenkinsHash { */ def hashSeq(xs: Seq[Any]): Int = { val (values, refs) = partitionValuesAndRefs(xs) - val refsSum = refs map (x => if (x == null) 0 else x.hashCode) sum + val refsSum = refs map (x => if (x == null) 0 else x.##) sum hashAnyValSeq(values) + refsSum } diff --git a/src/library/scala/util/Marshal.scala b/src/library/scala/util/Marshal.scala index e1cdce25bc..32c0a15ef3 100644 --- a/src/library/scala/util/Marshal.scala +++ b/src/library/scala/util/Marshal.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala index 3a08fa0482..e4da90ee28 100644 --- a/src/library/scala/util/Properties.scala +++ b/src/library/scala/util/Properties.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index cd9d5eed0e..69cb4bb48d 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util diff --git a/src/library/scala/util/Sorting.scala b/src/library/scala/util/Sorting.scala index 4189f2d912..8174a0e711 100644 --- a/src/library/scala/util/Sorting.scala +++ b/src/library/scala/util/Sorting.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util diff --git a/src/library/scala/util/automata/BaseBerrySethi.scala b/src/library/scala/util/automata/BaseBerrySethi.scala index ab7b97f188..63eb0aba9f 100644 --- a/src/library/scala/util/automata/BaseBerrySethi.scala +++ b/src/library/scala/util/automata/BaseBerrySethi.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/automata/DetWordAutom.scala b/src/library/scala/util/automata/DetWordAutom.scala index c69f39d212..e1e19589c2 100644 --- a/src/library/scala/util/automata/DetWordAutom.scala +++ b/src/library/scala/util/automata/DetWordAutom.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/automata/Inclusion.scala b/src/library/scala/util/automata/Inclusion.scala index 084b8bed9d..55ca4e0c37 100644 --- a/src/library/scala/util/automata/Inclusion.scala +++ b/src/library/scala/util/automata/Inclusion.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/automata/NondetWordAutom.scala b/src/library/scala/util/automata/NondetWordAutom.scala index 2363741b7a..4434ed395d 100644 --- a/src/library/scala/util/automata/NondetWordAutom.scala +++ b/src/library/scala/util/automata/NondetWordAutom.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/automata/SubsetConstruction.scala b/src/library/scala/util/automata/SubsetConstruction.scala index c8fba39f0e..d5b1a19083 100644 --- a/src/library/scala/util/automata/SubsetConstruction.scala +++ b/src/library/scala/util/automata/SubsetConstruction.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/automata/WordBerrySethi.scala b/src/library/scala/util/automata/WordBerrySethi.scala index b54fdc53f2..4a41cbbf5a 100644 --- a/src/library/scala/util/automata/WordBerrySethi.scala +++ b/src/library/scala/util/automata/WordBerrySethi.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.automata diff --git a/src/library/scala/util/control/Breaks.scala b/src/library/scala/util/control/Breaks.scala index 1f06f04418..dedf721cd4 100644 --- a/src/library/scala/util/control/Breaks.scala +++ b/src/library/scala/util/control/Breaks.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.control diff --git a/src/library/scala/util/control/ControlThrowable.scala b/src/library/scala/util/control/ControlThrowable.scala index 090bec4e98..dd09793b5f 100644 --- a/src/library/scala/util/control/ControlThrowable.scala +++ b/src/library/scala/util/control/ControlThrowable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.control diff --git a/src/library/scala/util/grammar/HedgeRHS.scala b/src/library/scala/util/grammar/HedgeRHS.scala index 6dc6a18936..6d72bbb5d5 100644 --- a/src/library/scala/util/grammar/HedgeRHS.scala +++ b/src/library/scala/util/grammar/HedgeRHS.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.grammar diff --git a/src/library/scala/util/grammar/TreeRHS.scala b/src/library/scala/util/grammar/TreeRHS.scala index 040a37b9e2..36f3884034 100644 --- a/src/library/scala/util/grammar/TreeRHS.scala +++ b/src/library/scala/util/grammar/TreeRHS.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.grammar diff --git a/src/library/scala/util/logging/ConsoleLogger.scala b/src/library/scala/util/logging/ConsoleLogger.scala index ec4148abc9..61950a315c 100644 --- a/src/library/scala/util/logging/ConsoleLogger.scala +++ b/src/library/scala/util/logging/ConsoleLogger.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.logging diff --git a/src/library/scala/util/logging/Logged.scala b/src/library/scala/util/logging/Logged.scala index b2461ea3d8..ecf25e230d 100644 --- a/src/library/scala/util/logging/Logged.scala +++ b/src/library/scala/util/logging/Logged.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.logging diff --git a/src/library/scala/util/matching/Regex.scala b/src/library/scala/util/matching/Regex.scala index 1384dfa47c..cf2c1d2cea 100644 --- a/src/library/scala/util/matching/Regex.scala +++ b/src/library/scala/util/matching/Regex.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.matching diff --git a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala index 4b80d198ce..1ba9270ec6 100644 --- a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala +++ b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator diff --git a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala index 6f15f54af8..02fb85e81a 100644 --- a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator diff --git a/src/library/scala/util/parsing/combinator/PackratParsers.scala b/src/library/scala/util/parsing/combinator/PackratParsers.scala index 4803ddd202..1e2975b615 100644 --- a/src/library/scala/util/parsing/combinator/PackratParsers.scala +++ b/src/library/scala/util/parsing/combinator/PackratParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator diff --git a/src/library/scala/util/parsing/combinator/Parsers.scala b/src/library/scala/util/parsing/combinator/Parsers.scala index d270757189..0df8871f82 100644 --- a/src/library/scala/util/parsing/combinator/Parsers.scala +++ b/src/library/scala/util/parsing/combinator/Parsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator diff --git a/src/library/scala/util/parsing/combinator/RegexParsers.scala b/src/library/scala/util/parsing/combinator/RegexParsers.scala index fd8ee60db0..ec056f9b4f 100644 --- a/src/library/scala/util/parsing/combinator/RegexParsers.scala +++ b/src/library/scala/util/parsing/combinator/RegexParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator diff --git a/src/library/scala/util/parsing/combinator/lexical/Lexical.scala b/src/library/scala/util/parsing/combinator/lexical/Lexical.scala index 7a35bcad7d..2a44a1c98c 100644 --- a/src/library/scala/util/parsing/combinator/lexical/Lexical.scala +++ b/src/library/scala/util/parsing/combinator/lexical/Lexical.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing diff --git a/src/library/scala/util/parsing/combinator/lexical/Scanners.scala b/src/library/scala/util/parsing/combinator/lexical/Scanners.scala index 96e9a76572..90e9fa9b82 100644 --- a/src/library/scala/util/parsing/combinator/lexical/Scanners.scala +++ b/src/library/scala/util/parsing/combinator/lexical/Scanners.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing diff --git a/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala b/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala index bc53e3731d..8d286d9aef 100644 --- a/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala +++ b/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing diff --git a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala index 31fa06035c..a3f7c24c0a 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing package combinator diff --git a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala index 5b62280b78..bc37ce7b4d 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing diff --git a/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala index ae4120b402..d9353b6b27 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing package combinator diff --git a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala index 3a024013c9..299736046e 100644 --- a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala +++ b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala @@ -1,4 +1,3 @@ -// $Id$ package scala.util.parsing.combinator.testing diff --git a/src/library/scala/util/parsing/combinator/testing/Tester.scala b/src/library/scala/util/parsing/combinator/testing/Tester.scala index 6ed86e77d7..7709cc0896 100644 --- a/src/library/scala/util/parsing/combinator/testing/Tester.scala +++ b/src/library/scala/util/parsing/combinator/testing/Tester.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.combinator.testing import scala.util.parsing.combinator._ diff --git a/src/library/scala/util/parsing/input/CharArrayReader.scala b/src/library/scala/util/parsing/input/CharArrayReader.scala index a58174df81..772dd533ae 100644 --- a/src/library/scala/util/parsing/input/CharArrayReader.scala +++ b/src/library/scala/util/parsing/input/CharArrayReader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/input/CharSequenceReader.scala b/src/library/scala/util/parsing/input/CharSequenceReader.scala index 3ae845a344..e47b213ad3 100644 --- a/src/library/scala/util/parsing/input/CharSequenceReader.scala +++ b/src/library/scala/util/parsing/input/CharSequenceReader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/input/NoPosition.scala b/src/library/scala/util/parsing/input/NoPosition.scala index e20f6ee3e6..311dde7b9a 100644 --- a/src/library/scala/util/parsing/input/NoPosition.scala +++ b/src/library/scala/util/parsing/input/NoPosition.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/input/PagedSeqReader.scala b/src/library/scala/util/parsing/input/PagedSeqReader.scala index c264be1dd6..71e1395f24 100644 --- a/src/library/scala/util/parsing/input/PagedSeqReader.scala +++ b/src/library/scala/util/parsing/input/PagedSeqReader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/input/Reader.scala b/src/library/scala/util/parsing/input/Reader.scala index 313097e860..2249f8867a 100644 --- a/src/library/scala/util/parsing/input/Reader.scala +++ b/src/library/scala/util/parsing/input/Reader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/input/StreamReader.scala b/src/library/scala/util/parsing/input/StreamReader.scala index 3c98d0e8df..6dc15f25c8 100644 --- a/src/library/scala/util/parsing/input/StreamReader.scala +++ b/src/library/scala/util/parsing/input/StreamReader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.input diff --git a/src/library/scala/util/parsing/json/JSON.scala b/src/library/scala/util/parsing/json/JSON.scala index 1900044698..1be8a10931 100644 --- a/src/library/scala/util/parsing/json/JSON.scala +++ b/src/library/scala/util/parsing/json/JSON.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.json diff --git a/src/library/scala/util/parsing/json/Lexer.scala b/src/library/scala/util/parsing/json/Lexer.scala index 0415624524..347d317f11 100644 --- a/src/library/scala/util/parsing/json/Lexer.scala +++ b/src/library/scala/util/parsing/json/Lexer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.json diff --git a/src/library/scala/util/parsing/json/Parser.scala b/src/library/scala/util/parsing/json/Parser.scala index 46a556c0ee..0d573edce4 100644 --- a/src/library/scala/util/parsing/json/Parser.scala +++ b/src/library/scala/util/parsing/json/Parser.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.parsing.json diff --git a/src/library/scala/util/regexp/Base.scala b/src/library/scala/util/regexp/Base.scala index 6ab20ec7d3..359416b20b 100644 --- a/src/library/scala/util/regexp/Base.scala +++ b/src/library/scala/util/regexp/Base.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.regexp diff --git a/src/library/scala/util/regexp/PointedHedgeExp.scala b/src/library/scala/util/regexp/PointedHedgeExp.scala index e147733fd5..83b9dbff06 100644 --- a/src/library/scala/util/regexp/PointedHedgeExp.scala +++ b/src/library/scala/util/regexp/PointedHedgeExp.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.regexp diff --git a/src/library/scala/util/regexp/SyntaxError.scala b/src/library/scala/util/regexp/SyntaxError.scala index 8fc472b2fc..367d2d1295 100644 --- a/src/library/scala/util/regexp/SyntaxError.scala +++ b/src/library/scala/util/regexp/SyntaxError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.regexp diff --git a/src/library/scala/util/regexp/WordExp.scala b/src/library/scala/util/regexp/WordExp.scala index 0a58d6399f..411a588297 100644 --- a/src/library/scala/util/regexp/WordExp.scala +++ b/src/library/scala/util/regexp/WordExp.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.util.regexp diff --git a/src/library/scala/volatile.scala b/src/library/scala/volatile.scala index 005cd6628c..7c9d9726bd 100644 --- a/src/library/scala/volatile.scala +++ b/src/library/scala/volatile.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala diff --git a/src/library/scala/xml/Atom.scala b/src/library/scala/xml/Atom.scala index 7c66995573..8d8667eae6 100644 --- a/src/library/scala/xml/Atom.scala +++ b/src/library/scala/xml/Atom.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Attribute.scala b/src/library/scala/xml/Attribute.scala index 3259526d98..17780fc024 100644 --- a/src/library/scala/xml/Attribute.scala +++ b/src/library/scala/xml/Attribute.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Comment.scala b/src/library/scala/xml/Comment.scala index 9608748601..f52f626c57 100644 --- a/src/library/scala/xml/Comment.scala +++ b/src/library/scala/xml/Comment.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Document.scala b/src/library/scala/xml/Document.scala index 6c73252a37..60e4790139 100644 --- a/src/library/scala/xml/Document.scala +++ b/src/library/scala/xml/Document.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Elem.scala b/src/library/scala/xml/Elem.scala index 9c58177417..c65608f5fb 100644 --- a/src/library/scala/xml/Elem.scala +++ b/src/library/scala/xml/Elem.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/EntityRef.scala b/src/library/scala/xml/EntityRef.scala index fbc1f351cf..cd84fca7f4 100644 --- a/src/library/scala/xml/EntityRef.scala +++ b/src/library/scala/xml/EntityRef.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Equality.scala b/src/library/scala/xml/Equality.scala index d09ae10b2d..210029b3bd 100644 --- a/src/library/scala/xml/Equality.scala +++ b/src/library/scala/xml/Equality.scala @@ -74,7 +74,7 @@ trait Equality extends scala.Equals { def strict_==(other: Equality): Boolean def strict_!=(other: Equality) = !strict_==(other) - private def hashOf(x: Any) = if (x == null) 1 else x.hashCode() + private def hashOf(x: Any) = if (x == null) 1 else x.## /** We insist we're only equal to other xml.Equality implementors, * which heads off a lot of inconsistency up front. diff --git a/src/library/scala/xml/Group.scala b/src/library/scala/xml/Group.scala index 8b714d2813..614adc98a9 100644 --- a/src/library/scala/xml/Group.scala +++ b/src/library/scala/xml/Group.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/HasKeyValue.scala b/src/library/scala/xml/HasKeyValue.scala index 6a79adadee..1ec117a6b6 100644 --- a/src/library/scala/xml/HasKeyValue.scala +++ b/src/library/scala/xml/HasKeyValue.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/MalformedAttributeException.scala b/src/library/scala/xml/MalformedAttributeException.scala index fab4ba0d2a..a85995d960 100644 --- a/src/library/scala/xml/MalformedAttributeException.scala +++ b/src/library/scala/xml/MalformedAttributeException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/MetaData.scala b/src/library/scala/xml/MetaData.scala index 744b662fb8..ab3d476deb 100644 --- a/src/library/scala/xml/MetaData.scala +++ b/src/library/scala/xml/MetaData.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/NamespaceBinding.scala b/src/library/scala/xml/NamespaceBinding.scala index 47ca8fed87..3b29f2e90a 100644 --- a/src/library/scala/xml/NamespaceBinding.scala +++ b/src/library/scala/xml/NamespaceBinding.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Node.scala b/src/library/scala/xml/Node.scala index 5117bb9282..6e3c2acebf 100644 --- a/src/library/scala/xml/Node.scala +++ b/src/library/scala/xml/Node.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/NodeBuffer.scala b/src/library/scala/xml/NodeBuffer.scala index 2cf999e8a4..e9c82b0451 100644 --- a/src/library/scala/xml/NodeBuffer.scala +++ b/src/library/scala/xml/NodeBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml @@ -39,9 +38,10 @@ class NodeBuffer extends scala.collection.mutable.ArrayBuffer[Node] { def &+(o: Any): NodeBuffer = { o match { case null | _: Unit | Text("") => // ignore - case it: Iterator[_] => it foreach (this &+ _) + case it: Iterator[_] => it foreach &+ case n: Node => super.+=(n) case ns: Iterable[_] => this &+ ns.iterator + case ns: Array[_] => this &+ ns.iterator case d => super.+=(new Atom(d)) } this diff --git a/src/library/scala/xml/NodeSeq.scala b/src/library/scala/xml/NodeSeq.scala index 0cab5422b6..cf343c55e8 100644 --- a/src/library/scala/xml/NodeSeq.scala +++ b/src/library/scala/xml/NodeSeq.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Null.scala b/src/library/scala/xml/Null.scala index d6f06fc3cd..6d2939a9a1 100644 --- a/src/library/scala/xml/Null.scala +++ b/src/library/scala/xml/Null.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/PCData.scala b/src/library/scala/xml/PCData.scala index fa44591496..330ad897f9 100644 --- a/src/library/scala/xml/PCData.scala +++ b/src/library/scala/xml/PCData.scala @@ -1,4 +1,3 @@ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/PrefixedAttribute.scala b/src/library/scala/xml/PrefixedAttribute.scala index d7c04ab6ad..c739dbe1fa 100644 --- a/src/library/scala/xml/PrefixedAttribute.scala +++ b/src/library/scala/xml/PrefixedAttribute.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/PrettyPrinter.scala b/src/library/scala/xml/PrettyPrinter.scala index 77199ca367..5927ae0d11 100644 --- a/src/library/scala/xml/PrettyPrinter.scala +++ b/src/library/scala/xml/PrettyPrinter.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/ProcInstr.scala b/src/library/scala/xml/ProcInstr.scala index 051fd499f4..72b9ba00f2 100644 --- a/src/library/scala/xml/ProcInstr.scala +++ b/src/library/scala/xml/ProcInstr.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml @@ -35,5 +34,5 @@ case class ProcInstr(target: String, proctext: String) extends SpecialNode * to this stringbuffer. */ override def buildString(sb: StringBuilder) = - sb append "<?%s%s?>".format(target, (if (proctext.isEmpty) "" else " " + proctext)) + sb append "<?%s%s?>".format(target, (if (proctext == "") "" else " " + proctext)) } diff --git a/src/library/scala/xml/QNode.scala b/src/library/scala/xml/QNode.scala index f7cec9b894..331f138f25 100644 --- a/src/library/scala/xml/QNode.scala +++ b/src/library/scala/xml/QNode.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/SpecialNode.scala b/src/library/scala/xml/SpecialNode.scala index 1688cd1e15..1b5a8a7d9a 100644 --- a/src/library/scala/xml/SpecialNode.scala +++ b/src/library/scala/xml/SpecialNode.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Text.scala b/src/library/scala/xml/Text.scala index 5f0b010c9f..aebb0d4897 100644 --- a/src/library/scala/xml/Text.scala +++ b/src/library/scala/xml/Text.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/TextBuffer.scala b/src/library/scala/xml/TextBuffer.scala index 84c6c24146..265851a04b 100644 --- a/src/library/scala/xml/TextBuffer.scala +++ b/src/library/scala/xml/TextBuffer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/TopScope.scala b/src/library/scala/xml/TopScope.scala index 8b3c1383c9..33b7bbfa01 100644 --- a/src/library/scala/xml/TopScope.scala +++ b/src/library/scala/xml/TopScope.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/TypeSymbol.scala b/src/library/scala/xml/TypeSymbol.scala index d9b4d092dc..b9bd6960cc 100644 --- a/src/library/scala/xml/TypeSymbol.scala +++ b/src/library/scala/xml/TypeSymbol.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Unparsed.scala b/src/library/scala/xml/Unparsed.scala index d3c63172e8..7911310363 100644 --- a/src/library/scala/xml/Unparsed.scala +++ b/src/library/scala/xml/Unparsed.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/UnprefixedAttribute.scala b/src/library/scala/xml/UnprefixedAttribute.scala index a8720f13e1..a4bbef37b0 100644 --- a/src/library/scala/xml/UnprefixedAttribute.scala +++ b/src/library/scala/xml/UnprefixedAttribute.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala index 8637148489..65d7179fa2 100644 --- a/src/library/scala/xml/Utility.scala +++ b/src/library/scala/xml/Utility.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml @@ -262,14 +261,14 @@ object Utility extends AnyRef with parsing.TokenTests * @param children */ def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) = ( - ( if(pre ne null) {41 * pre.hashCode() % 7} else {0}) - + label.hashCode() * 53 + ( if(pre ne null) {41 * pre.## % 7} else {0}) + + label.## * 53 + attribHashCode * 7 + scpeHash * 31 + { var c = 0 val i = children.iterator - while(i.hasNext) c = c * 41 + i.next.hashCode + while(i.hasNext) c = c * 41 + i.next.## c } ) diff --git a/src/library/scala/xml/XML.scala b/src/library/scala/xml/XML.scala index dd85b58e50..b3ecc6ba7b 100644 --- a/src/library/scala/xml/XML.scala +++ b/src/library/scala/xml/XML.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/Xhtml.scala b/src/library/scala/xml/Xhtml.scala index 162ea5696a..4dc01a5b45 100644 --- a/src/library/scala/xml/Xhtml.scala +++ b/src/library/scala/xml/Xhtml.scala @@ -1,4 +1,3 @@ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/dtd/ContentModel.scala b/src/library/scala/xml/dtd/ContentModel.scala index 772d8ec599..d864d4630d 100644 --- a/src/library/scala/xml/dtd/ContentModel.scala +++ b/src/library/scala/xml/dtd/ContentModel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/dtd/ContentModelParser.scala b/src/library/scala/xml/dtd/ContentModelParser.scala index 2b0df3f6a5..199aa3492d 100644 --- a/src/library/scala/xml/dtd/ContentModelParser.scala +++ b/src/library/scala/xml/dtd/ContentModelParser.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/DTD.scala b/src/library/scala/xml/dtd/DTD.scala index 0fde1188f3..bfb9ad19ba 100644 --- a/src/library/scala/xml/dtd/DTD.scala +++ b/src/library/scala/xml/dtd/DTD.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/Decl.scala b/src/library/scala/xml/dtd/Decl.scala index 2ac3d42a67..0badde91c4 100644 --- a/src/library/scala/xml/dtd/Decl.scala +++ b/src/library/scala/xml/dtd/Decl.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/DocType.scala b/src/library/scala/xml/dtd/DocType.scala index 7da38b3e73..9aa2e7504d 100644 --- a/src/library/scala/xml/dtd/DocType.scala +++ b/src/library/scala/xml/dtd/DocType.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/ElementValidator.scala b/src/library/scala/xml/dtd/ElementValidator.scala index 9ebed8d87c..872fb58393 100644 --- a/src/library/scala/xml/dtd/ElementValidator.scala +++ b/src/library/scala/xml/dtd/ElementValidator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml @@ -48,7 +47,7 @@ class ElementValidator() extends Function1[Node,Boolean] { def setMetaData(adecls: List[AttrDecl]) { this.adecls = adecls } def getIterable(nodes: Seq[Node], skipPCDATA: Boolean): Iterable[ElemName] = { - def isAllWhitespace(a: Atom[_]) = cond(a.data) { case s: String if s.trim.isEmpty => true } + def isAllWhitespace(a: Atom[_]) = cond(a.data) { case s: String if s.trim == "" => true } nodes.filter { case y: SpecialNode => y match { diff --git a/src/library/scala/xml/dtd/ExternalID.scala b/src/library/scala/xml/dtd/ExternalID.scala index b0d311e54a..df5d611690 100644 --- a/src/library/scala/xml/dtd/ExternalID.scala +++ b/src/library/scala/xml/dtd/ExternalID.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/Scanner.scala b/src/library/scala/xml/dtd/Scanner.scala index 7b3e2acfe0..b8dc2b070b 100644 --- a/src/library/scala/xml/dtd/Scanner.scala +++ b/src/library/scala/xml/dtd/Scanner.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package dtd diff --git a/src/library/scala/xml/dtd/Tokens.scala b/src/library/scala/xml/dtd/Tokens.scala index 9c3bfbc992..94f6b9aa11 100644 --- a/src/library/scala/xml/dtd/Tokens.scala +++ b/src/library/scala/xml/dtd/Tokens.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/dtd/ValidationException.scala b/src/library/scala/xml/dtd/ValidationException.scala index 692d501d10..09142e9770 100644 --- a/src/library/scala/xml/dtd/ValidationException.scala +++ b/src/library/scala/xml/dtd/ValidationException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/factory/Binder.scala b/src/library/scala/xml/factory/Binder.scala index 3996ef2d36..b0e38a39cb 100644 --- a/src/library/scala/xml/factory/Binder.scala +++ b/src/library/scala/xml/factory/Binder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/factory/LoggedNodeFactory.scala b/src/library/scala/xml/factory/LoggedNodeFactory.scala index 647ea57e36..2159f8c106 100644 --- a/src/library/scala/xml/factory/LoggedNodeFactory.scala +++ b/src/library/scala/xml/factory/LoggedNodeFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml @@ -59,7 +58,7 @@ with scala.util.logging.Logged { if (logNode) log("[makeNode for "+label+"]"); - val hash = Utility.hashCode(pre, label, attrSeq.hashCode(), scope.hashCode(), children) + val hash = Utility.hashCode(pre, label, attrSeq.##, scope.##, children) /* if(logCompressLevel >= FULL) { diff --git a/src/library/scala/xml/factory/NodeFactory.scala b/src/library/scala/xml/factory/NodeFactory.scala index 2dd52242db..4178a38cd9 100644 --- a/src/library/scala/xml/factory/NodeFactory.scala +++ b/src/library/scala/xml/factory/NodeFactory.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package factory @@ -41,7 +40,7 @@ trait NodeFactory[A <: Node] eqElements(n.child, children) def makeNode(pre: String, name: String, attrSeq: MetaData, scope: NamespaceBinding, children: Seq[Node]): A = { - val hash = Utility.hashCode( pre, name, attrSeq.hashCode(), scope.hashCode(), children) + val hash = Utility.hashCode( pre, name, attrSeq.##, scope.##, children) def cons(old: List[A]) = construct(hash, old, pre, name, attrSeq, scope, children) (cache get hash) match { diff --git a/src/library/scala/xml/factory/XMLLoader.scala b/src/library/scala/xml/factory/XMLLoader.scala index 6321c10e97..006edca054 100644 --- a/src/library/scala/xml/factory/XMLLoader.scala +++ b/src/library/scala/xml/factory/XMLLoader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package factory @@ -24,17 +23,13 @@ trait XMLLoader[T <: Node] import scala.xml.Source._ def adapter: FactoryAdapter = new NoBindingFactoryAdapter() - private val saxFactory = { + /* Override this to use a different SAXParser. */ + def parser: SAXParser = { val f = SAXParserFactory.newInstance() f.setNamespaceAware(false) - // Discovered at: http://www.jdom.org/docs/faq.html#a0350 (see ticket #2725) - f.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) - f + f.newSAXParser() } - /* Override this to use a different SAXParser. */ - def parser: SAXParser = saxFactory.newSAXParser() - /** Loads XML from the given InputSource, using the supplied parser. * The methods available in scala.xml.XML use the XML parser in the JDK. */ diff --git a/src/library/scala/xml/include/CircularIncludeException.scala b/src/library/scala/xml/include/CircularIncludeException.scala index a2b4fd7681..5c6e327de9 100644 --- a/src/library/scala/xml/include/CircularIncludeException.scala +++ b/src/library/scala/xml/include/CircularIncludeException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include diff --git a/src/library/scala/xml/include/UnavailableResourceException.scala b/src/library/scala/xml/include/UnavailableResourceException.scala index aa313cabec..da1c5d452c 100644 --- a/src/library/scala/xml/include/UnavailableResourceException.scala +++ b/src/library/scala/xml/include/UnavailableResourceException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include diff --git a/src/library/scala/xml/include/XIncludeException.scala b/src/library/scala/xml/include/XIncludeException.scala index a671f32dca..3faf587cd9 100644 --- a/src/library/scala/xml/include/XIncludeException.scala +++ b/src/library/scala/xml/include/XIncludeException.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include diff --git a/src/library/scala/xml/include/sax/EncodingHeuristics.scala b/src/library/scala/xml/include/sax/EncodingHeuristics.scala index 6b04e859b8..95fe240635 100644 --- a/src/library/scala/xml/include/sax/EncodingHeuristics.scala +++ b/src/library/scala/xml/include/sax/EncodingHeuristics.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include.sax diff --git a/src/library/scala/xml/include/sax/Main.scala b/src/library/scala/xml/include/sax/Main.scala index 60031b4b6a..ed2e5ebf37 100644 --- a/src/library/scala/xml/include/sax/Main.scala +++ b/src/library/scala/xml/include/sax/Main.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include.sax diff --git a/src/library/scala/xml/include/sax/XIncludeFilter.scala b/src/library/scala/xml/include/sax/XIncludeFilter.scala index b5c468dc81..ce0fc4bf50 100644 --- a/src/library/scala/xml/include/sax/XIncludeFilter.scala +++ b/src/library/scala/xml/include/sax/XIncludeFilter.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include.sax diff --git a/src/library/scala/xml/include/sax/XIncluder.scala b/src/library/scala/xml/include/sax/XIncluder.scala index 8bc3c4e41a..64d91b21ca 100644 --- a/src/library/scala/xml/include/sax/XIncluder.scala +++ b/src/library/scala/xml/include/sax/XIncluder.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package include.sax diff --git a/src/library/scala/xml/parsing/ConstructingHandler.scala b/src/library/scala/xml/parsing/ConstructingHandler.scala index 319483752a..f2dd7e58fd 100644 --- a/src/library/scala/xml/parsing/ConstructingHandler.scala +++ b/src/library/scala/xml/parsing/ConstructingHandler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/ConstructingParser.scala b/src/library/scala/xml/parsing/ConstructingParser.scala index 00f195e9fd..e54e411587 100644 --- a/src/library/scala/xml/parsing/ConstructingParser.scala +++ b/src/library/scala/xml/parsing/ConstructingParser.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/DefaultMarkupHandler.scala b/src/library/scala/xml/parsing/DefaultMarkupHandler.scala index 0a8bd7c4d6..c215b8b639 100644 --- a/src/library/scala/xml/parsing/DefaultMarkupHandler.scala +++ b/src/library/scala/xml/parsing/DefaultMarkupHandler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/ExternalSources.scala b/src/library/scala/xml/parsing/ExternalSources.scala index 4081fa9722..e0a0f6b986 100644 --- a/src/library/scala/xml/parsing/ExternalSources.scala +++ b/src/library/scala/xml/parsing/ExternalSources.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/FactoryAdapter.scala b/src/library/scala/xml/parsing/FactoryAdapter.scala index 6960e05d25..0e8ea2c5b6 100644 --- a/src/library/scala/xml/parsing/FactoryAdapter.scala +++ b/src/library/scala/xml/parsing/FactoryAdapter.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/FatalError.scala b/src/library/scala/xml/parsing/FatalError.scala index 73634298fa..d2d6cf32b4 100644 --- a/src/library/scala/xml/parsing/FatalError.scala +++ b/src/library/scala/xml/parsing/FatalError.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/MarkupHandler.scala b/src/library/scala/xml/parsing/MarkupHandler.scala index bcb0e03a07..d53e5d3319 100644 --- a/src/library/scala/xml/parsing/MarkupHandler.scala +++ b/src/library/scala/xml/parsing/MarkupHandler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/NoBindingFactoryAdapter.scala b/src/library/scala/xml/parsing/NoBindingFactoryAdapter.scala index 083465bc41..3854f66683 100644 --- a/src/library/scala/xml/parsing/NoBindingFactoryAdapter.scala +++ b/src/library/scala/xml/parsing/NoBindingFactoryAdapter.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package parsing diff --git a/src/library/scala/xml/parsing/TokenTests.scala b/src/library/scala/xml/parsing/TokenTests.scala index 13500e8510..88a9ac3756 100644 --- a/src/library/scala/xml/parsing/TokenTests.scala +++ b/src/library/scala/xml/parsing/TokenTests.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala b/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala index 00126c4881..c02d1e1242 100644 --- a/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala +++ b/src/library/scala/xml/parsing/ValidatingMarkupHandler.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/parsing/XhtmlEntities.scala b/src/library/scala/xml/parsing/XhtmlEntities.scala index 6e35aa9606..5ca2cf2b0c 100644 --- a/src/library/scala/xml/parsing/XhtmlEntities.scala +++ b/src/library/scala/xml/parsing/XhtmlEntities.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package parsing diff --git a/src/library/scala/xml/parsing/XhtmlParser.scala b/src/library/scala/xml/parsing/XhtmlParser.scala index 464c543f30..0647addf8b 100644 --- a/src/library/scala/xml/parsing/XhtmlParser.scala +++ b/src/library/scala/xml/parsing/XhtmlParser.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package parsing diff --git a/src/library/scala/xml/persistent/CachedFileStorage.scala b/src/library/scala/xml/persistent/CachedFileStorage.scala index 8715944794..dfd675f36a 100644 --- a/src/library/scala/xml/persistent/CachedFileStorage.scala +++ b/src/library/scala/xml/persistent/CachedFileStorage.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package persistent diff --git a/src/library/scala/xml/persistent/Index.scala b/src/library/scala/xml/persistent/Index.scala index 7468efeb93..92825f92c7 100644 --- a/src/library/scala/xml/persistent/Index.scala +++ b/src/library/scala/xml/persistent/Index.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/persistent/SetStorage.scala b/src/library/scala/xml/persistent/SetStorage.scala index cedd01063f..a49858487c 100644 --- a/src/library/scala/xml/persistent/SetStorage.scala +++ b/src/library/scala/xml/persistent/SetStorage.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package persistent diff --git a/src/library/scala/xml/pull/XMLEvent.scala b/src/library/scala/xml/pull/XMLEvent.scala index 4fa30836b8..3de618e3a7 100644 --- a/src/library/scala/xml/pull/XMLEvent.scala +++ b/src/library/scala/xml/pull/XMLEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/pull/XMLEventReader.scala b/src/library/scala/xml/pull/XMLEventReader.scala index deff8e75ff..90c19f9c0b 100644 --- a/src/library/scala/xml/pull/XMLEventReader.scala +++ b/src/library/scala/xml/pull/XMLEventReader.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml package pull diff --git a/src/library/scala/xml/transform/BasicTransformer.scala b/src/library/scala/xml/transform/BasicTransformer.scala index 33819e12ef..242549ebb2 100644 --- a/src/library/scala/xml/transform/BasicTransformer.scala +++ b/src/library/scala/xml/transform/BasicTransformer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/transform/RewriteRule.scala b/src/library/scala/xml/transform/RewriteRule.scala index fbf52c39a4..1b6a0cb16b 100644 --- a/src/library/scala/xml/transform/RewriteRule.scala +++ b/src/library/scala/xml/transform/RewriteRule.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/library/scala/xml/transform/RuleTransformer.scala b/src/library/scala/xml/transform/RuleTransformer.scala index 80cc7bb067..2105d1437b 100644 --- a/src/library/scala/xml/transform/RuleTransformer.scala +++ b/src/library/scala/xml/transform/RuleTransformer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.xml diff --git a/src/manual/scala/man1/Command.scala b/src/manual/scala/man1/Command.scala index f86502e043..abc2b42b95 100644 --- a/src/manual/scala/man1/Command.scala +++ b/src/manual/scala/man1/Command.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/fsc.scala b/src/manual/scala/man1/fsc.scala index 3c1c3ae96f..c778038618 100644 --- a/src/manual/scala/man1/fsc.scala +++ b/src/manual/scala/man1/fsc.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/sbaz.scala b/src/manual/scala/man1/sbaz.scala index 1cfbc076ef..41675c84ff 100644 --- a/src/manual/scala/man1/sbaz.scala +++ b/src/manual/scala/man1/sbaz.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/scala.scala b/src/manual/scala/man1/scala.scala index 70627c87b8..0530185c30 100644 --- a/src/manual/scala/man1/scala.scala +++ b/src/manual/scala/man1/scala.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index fab0336c84..d2f6183356 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/scaladoc.scala b/src/manual/scala/man1/scaladoc.scala index ab17e14c28..77a2b88ce7 100644 --- a/src/manual/scala/man1/scaladoc.scala +++ b/src/manual/scala/man1/scaladoc.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/man1/scalap.scala b/src/manual/scala/man1/scalap.scala index 9c1b4dd705..d9fc6d162d 100644 --- a/src/manual/scala/man1/scalap.scala +++ b/src/manual/scala/man1/scalap.scala @@ -2,7 +2,6 @@ * Copyright 2005-2010 LAMP/EPFL * @author Stephane Micheloud */ -//$Id$ package scala.man1 diff --git a/src/manual/scala/tools/docutil/EmitHtml.scala b/src/manual/scala/tools/docutil/EmitHtml.scala index a4b2f463d0..20348ad303 100644 --- a/src/manual/scala/tools/docutil/EmitHtml.scala +++ b/src/manual/scala/tools/docutil/EmitHtml.scala @@ -3,7 +3,6 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ package scala.tools.docutil diff --git a/src/manual/scala/tools/docutil/EmitManPage.scala b/src/manual/scala/tools/docutil/EmitManPage.scala index 785aa3434a..2183ae3cb9 100644 --- a/src/manual/scala/tools/docutil/EmitManPage.scala +++ b/src/manual/scala/tools/docutil/EmitManPage.scala @@ -3,7 +3,6 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ package scala.tools.docutil diff --git a/src/manual/scala/tools/docutil/ManPage.scala b/src/manual/scala/tools/docutil/ManPage.scala index c35b24d532..83790e18d3 100644 --- a/src/manual/scala/tools/docutil/ManPage.scala +++ b/src/manual/scala/tools/docutil/ManPage.scala @@ -3,7 +3,6 @@ * @author Stephane Micheloud * Adapted from Lex Spoon's sbaz manual */ -//$Id$ package scala.tools.docutil diff --git a/src/msil/ch/epfl/lamp/compiler/msil/Assembly.java b/src/msil/ch/epfl/lamp/compiler/msil/Assembly.java index 509575b26e..0d7102c305 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/Assembly.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/Assembly.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/AssemblyName.java b/src/msil/ch/epfl/lamp/compiler/msil/AssemblyName.java index 3e1b6a6f57..acdcb32e33 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/AssemblyName.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/AssemblyName.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java b/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java index 0a9ef6929e..aefb6fdaf1 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/BindingFlags.java b/src/msil/ch/epfl/lamp/compiler/msil/BindingFlags.java index c9a024409c..cac2319b50 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/BindingFlags.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/BindingFlags.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/CallingConventions.java b/src/msil/ch/epfl/lamp/compiler/msil/CallingConventions.java index 925c5b8693..50bf9fb5d5 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/CallingConventions.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/CallingConventions.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/ConstructorInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/ConstructorInfo.java index 3dea39c2cf..99e5c5fe69 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/ConstructorInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/ConstructorInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/CustomAttributeProvider.java b/src/msil/ch/epfl/lamp/compiler/msil/CustomAttributeProvider.java index 32a50fdf9b..0e58c18114 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/CustomAttributeProvider.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/CustomAttributeProvider.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/EventAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/EventAttributes.java index f931f7bad6..a183993cb9 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/EventAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/EventAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/EventInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/EventInfo.java index e2bea10f7f..3ccba7900b 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/EventInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/EventInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/FieldAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/FieldAttributes.java index 5e6cc84f1e..d7d1bb3d54 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/FieldAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/FieldAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/FieldInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/FieldInfo.java index bd08e4a3e1..9649dabd4e 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/FieldInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/FieldInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/ICustomAttributeProvider.java b/src/msil/ch/epfl/lamp/compiler/msil/ICustomAttributeProvider.java index 4eafc37ef3..927185962c 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/ICustomAttributeProvider.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/ICustomAttributeProvider.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MemberInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/MemberInfo.java index 14aac59e84..65ff1b290b 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MemberInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MemberInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MemberTypes.java b/src/msil/ch/epfl/lamp/compiler/msil/MemberTypes.java index 4536dc997f..5f49ad3323 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MemberTypes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MemberTypes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MethodAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/MethodAttributes.java index 3e8b658d49..a703c38fb8 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MethodAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MethodAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MethodBase.java b/src/msil/ch/epfl/lamp/compiler/msil/MethodBase.java index 699edab6e3..793ee362e9 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MethodBase.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MethodBase.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MethodImplAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/MethodImplAttributes.java index 1ad3f2a133..8e8d879593 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MethodImplAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MethodImplAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/MethodInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/MethodInfo.java index 22b174d77b..5e227fba35 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/MethodInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/MethodInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/Module.java b/src/msil/ch/epfl/lamp/compiler/msil/Module.java index bd06c32223..8dd5e7119f 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/Module.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/Module.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PEAssembly.java b/src/msil/ch/epfl/lamp/compiler/msil/PEAssembly.java index 2d6d498bb0..a31db16c92 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PEAssembly.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PEAssembly.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java b/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java index 457a1d8c2b..f84598e20b 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PEModule.java b/src/msil/ch/epfl/lamp/compiler/msil/PEModule.java index 78c17038cb..18e9c37bb4 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PEModule.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PEModule.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PEType.java b/src/msil/ch/epfl/lamp/compiler/msil/PEType.java index 67686baad2..ace364d2ed 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PEType.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PEType.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/ParameterAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/ParameterAttributes.java index 7c48637d9f..d4360363fc 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/ParameterAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/ParameterAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/ParameterInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/ParameterInfo.java index df3b5f96da..877d7aa8a5 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/ParameterInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/ParameterInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PropertyAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/PropertyAttributes.java index ca137ba99f..b1bec64aff 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PropertyAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PropertyAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/PropertyInfo.java b/src/msil/ch/epfl/lamp/compiler/msil/PropertyInfo.java index ba3d67be2e..4b7cef8bc1 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/PropertyInfo.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/PropertyInfo.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/Type.java b/src/msil/ch/epfl/lamp/compiler/msil/Type.java index 55125f0d96..dbeaa1184a 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/Type.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/Type.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; @@ -813,7 +812,7 @@ public abstract class Type extends MemberInfo { if (k >= 0) cname = cname.substring(k + 1); return "[" + t.Assembly().GetName() + "]" + t + - "(" + cname + "#" + Integer.toHexString(t.hashCode()) + ")"; + "(" + cname + "#" + Integer.toHexString(t.##) + ")"; } private static String dumpType(Type t) { StringBuffer str = new StringBuffer(); diff --git a/src/msil/ch/epfl/lamp/compiler/msil/TypeAttributes.java b/src/msil/ch/epfl/lamp/compiler/msil/TypeAttributes.java index 45ef487e24..8f489fa46f 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/TypeAttributes.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/TypeAttributes.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/Version.java b/src/msil/ch/epfl/lamp/compiler/msil/Version.java index 7276498258..ad4b09b163 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/Version.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/Version.java @@ -2,7 +2,6 @@ * System.Reflection-like API for access to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/AssemblyBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/AssemblyBuilder.scala index 834b2b3a74..2c4011eeb0 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/AssemblyBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/AssemblyBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ConstructorBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ConstructorBuilder.scala index cfb54844c9..ddd4708ecd 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ConstructorBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ConstructorBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/FieldBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/FieldBuilder.scala index 1306148975..3ea06382e5 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/FieldBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/FieldBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ICustomAttributeSetter.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ICustomAttributeSetter.scala index 88587a143d..5d74d3aa95 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ICustomAttributeSetter.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ICustomAttributeSetter.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ILGenerator.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ILGenerator.scala index ea93d6c606..4ef7069254 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ILGenerator.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ILGenerator.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ILPrinterVisitor.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ILPrinterVisitor.scala index 0e0e337ceb..ef1e3bc86a 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ILPrinterVisitor.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ILPrinterVisitor.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies in MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/Label.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/Label.scala index 113121a5c1..22c1b1150b 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/Label.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/Label.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/LocalBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/LocalBuilder.scala index d19475401e..73bca4639f 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/LocalBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/LocalBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/MethodBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/MethodBuilder.scala index a1c5091547..237d8fd728 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/MethodBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/MethodBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ModuleBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ModuleBuilder.scala index 5b42d6df76..a2d284865f 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ModuleBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ModuleBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/MultipleFilesILPrinterVisitor.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/MultipleFilesILPrinterVisitor.scala index b1b6d41eb5..afd2d5d556 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/MultipleFilesILPrinterVisitor.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/MultipleFilesILPrinterVisitor.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies in MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala index 835bdcadd0..ef9e002495 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCodes.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCodes.scala index 557b022f54..db2a6fedc7 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCodes.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCodes.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/ParameterBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/ParameterBuilder.scala index 5a68f8f0ae..8f9d81a8b0 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/ParameterBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/ParameterBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/SingleFileILPrinterVisitor.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/SingleFileILPrinterVisitor.scala index 7a880f2ac6..7288cf41a7 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/SingleFileILPrinterVisitor.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/SingleFileILPrinterVisitor.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies in MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/TypeBuilder.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/TypeBuilder.scala index 2c0ab29b90..8667098cdb 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/TypeBuilder.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/TypeBuilder.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitable.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitable.scala index 963c587bc7..28ec801dd4 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitable.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitable.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitor.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitor.scala index dc71123f85..d4b84cdd4e 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitor.scala +++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/Visitor.scala @@ -2,7 +2,6 @@ * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ -// $Id$ package ch.epfl.lamp.compiler.msil.emit diff --git a/src/msil/ch/epfl/lamp/compiler/msil/tests/CustomAttributesTest.java b/src/msil/ch/epfl/lamp/compiler/msil/tests/CustomAttributesTest.java index 5067489693..9a6e28a545 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/tests/CustomAttributesTest.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/tests/CustomAttributesTest.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.compiler.msil.tests; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/tests/JavaTypeTest.java b/src/msil/ch/epfl/lamp/compiler/msil/tests/JavaTypeTest.java index 0c2d12aa0f..96ec1bfeea 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/tests/JavaTypeTest.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/tests/JavaTypeTest.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.compiler.msil.tests; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/tests/MembersTest.java b/src/msil/ch/epfl/lamp/compiler/msil/tests/MembersTest.java index 4f20632ce3..37a5c6ea90 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/tests/MembersTest.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/tests/MembersTest.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.compiler.msil.tests; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/tests/TableDump.java b/src/msil/ch/epfl/lamp/compiler/msil/tests/TableDump.java index 1d3764dff2..1df389b011 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/tests/TableDump.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/tests/TableDump.java @@ -1,4 +1,3 @@ -// $Id$ package ch.epfl.lamp.compiler.msil.tests; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/tests/Test.java b/src/msil/ch/epfl/lamp/compiler/msil/tests/Test.java index d1c81f4fb5..2c5946a734 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/tests/Test.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/tests/Test.java @@ -1,4 +1,3 @@ -// $Id$ package test; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/util/PESection.java b/src/msil/ch/epfl/lamp/compiler/msil/util/PESection.java index 84f604af53..454a94e55c 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/util/PESection.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/util/PESection.java @@ -2,7 +2,6 @@ * System.Reflection-like API for acces to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil.util; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java b/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java index 4feb0f7b1e..ef043875ec 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java @@ -2,7 +2,6 @@ * System.Reflection-like API for acces to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil.util; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/util/Signature.java b/src/msil/ch/epfl/lamp/compiler/msil/util/Signature.java index ded2dd64a7..1b16508be5 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/util/Signature.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/util/Signature.java @@ -2,7 +2,6 @@ * System.Reflection-like API for acces to .NET assemblies (DLL & EXE) */ -// $Id$ package ch.epfl.lamp.compiler.msil.util; diff --git a/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java b/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java index a4860c369f..ba9d317dcf 100644 --- a/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java +++ b/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java @@ -2,7 +2,6 @@ * System.Reflection-like API for acces to .NET Assemblies */ -// $Id$ package ch.epfl.lamp.compiler.msil.util; diff --git a/src/partest-alternative/scala/tools/partest/Properties.scala b/src/partest-alternative/scala/tools/partest/Properties.scala index 4eeb0359ec..a1ad1e5cbc 100644 --- a/src/partest-alternative/scala/tools/partest/Properties.scala +++ b/src/partest-alternative/scala/tools/partest/Properties.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools package partest diff --git a/src/partest-alternative/scala/tools/partest/io/Diff.java b/src/partest-alternative/scala/tools/partest/io/Diff.java index c7a3d42f30..69428d7e7a 100644 --- a/src/partest-alternative/scala/tools/partest/io/Diff.java +++ b/src/partest-alternative/scala/tools/partest/io/Diff.java @@ -1,4 +1,3 @@ -// $Id$ package scala.tools.partest.io; diff --git a/src/partest-alternative/scala/tools/partest/io/DiffPrint.java b/src/partest-alternative/scala/tools/partest/io/DiffPrint.java index 2b2ad93ec7..273b6cba52 100644 --- a/src/partest-alternative/scala/tools/partest/io/DiffPrint.java +++ b/src/partest-alternative/scala/tools/partest/io/DiffPrint.java @@ -1,4 +1,3 @@ -// $Id$ package scala.tools.partest.io; diff --git a/src/partest/scala/tools/partest/nest/AntRunner.scala b/src/partest/scala/tools/partest/nest/AntRunner.scala index cb819720fc..6c3dbb876e 100644 --- a/src/partest/scala/tools/partest/nest/AntRunner.scala +++ b/src/partest/scala/tools/partest/nest/AntRunner.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.partest package nest diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala index eae79f23af..33f575c0a0 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala @@ -15,7 +15,6 @@ import RunnerUtils._ import scala.tools.nsc.Properties.{ versionMsg, setProp } import scala.tools.nsc.util.CommandLineParser import scala.tools.nsc.io -import scala.tools.nsc.interpreter.returning import io.{ Path, Process } class ConsoleRunner extends DirectRunner { diff --git a/src/partest/scala/tools/partest/nest/Diff.java b/src/partest/scala/tools/partest/nest/Diff.java index abd09d0293..f780712b6b 100644 --- a/src/partest/scala/tools/partest/nest/Diff.java +++ b/src/partest/scala/tools/partest/nest/Diff.java @@ -1,4 +1,3 @@ -// $Id$ package scala.tools.partest.nest; diff --git a/src/partest/scala/tools/partest/nest/DiffPrint.java b/src/partest/scala/tools/partest/nest/DiffPrint.java index 494bc06e4a..eeb0dd5a09 100644 --- a/src/partest/scala/tools/partest/nest/DiffPrint.java +++ b/src/partest/scala/tools/partest/nest/DiffPrint.java @@ -1,4 +1,3 @@ -// $Id$ package scala.tools.partest.nest; diff --git a/src/partest/scala/tools/partest/utils/Properties.scala b/src/partest/scala/tools/partest/utils/Properties.scala index 237ddea14e..bc72995f8b 100644 --- a/src/partest/scala/tools/partest/utils/Properties.scala +++ b/src/partest/scala/tools/partest/utils/Properties.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.tools.partest package utils diff --git a/src/scalap/scala/tools/scalap/Arguments.scala b/src/scalap/scala/tools/scalap/Arguments.scala index 8443a390d2..39f74cbfac 100644 --- a/src/scalap/scala/tools/scalap/Arguments.scala +++ b/src/scalap/scala/tools/scalap/Arguments.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/ByteArrayReader.scala b/src/scalap/scala/tools/scalap/ByteArrayReader.scala index d3fe7d0411..8b3d5ff5b1 100644 --- a/src/scalap/scala/tools/scalap/ByteArrayReader.scala +++ b/src/scalap/scala/tools/scalap/ByteArrayReader.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Classfile.scala b/src/scalap/scala/tools/scalap/Classfile.scala index c4f273c5aa..6526d90473 100644 --- a/src/scalap/scala/tools/scalap/Classfile.scala +++ b/src/scalap/scala/tools/scalap/Classfile.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Classfiles.scala b/src/scalap/scala/tools/scalap/Classfiles.scala index a87b086ccc..2919ba5a0f 100644 --- a/src/scalap/scala/tools/scalap/Classfiles.scala +++ b/src/scalap/scala/tools/scalap/Classfiles.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/CodeWriter.scala b/src/scalap/scala/tools/scalap/CodeWriter.scala index c5355156c5..aee7e84e97 100644 --- a/src/scalap/scala/tools/scalap/CodeWriter.scala +++ b/src/scalap/scala/tools/scalap/CodeWriter.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Decode.scala b/src/scalap/scala/tools/scalap/Decode.scala index 5189009584..b289e476aa 100644 --- a/src/scalap/scala/tools/scalap/Decode.scala +++ b/src/scalap/scala/tools/scalap/Decode.scala @@ -72,7 +72,7 @@ object Decode { } yield { val f: PartialFunction[Symbol, List[String]] = - if (inner.isEmpty) { + if (inner == "") { case x: MethodSymbol if x.isCaseAccessor && (x.name endsWith " ") => List(x.name dropRight 1) } else { diff --git a/src/scalap/scala/tools/scalap/JavaWriter.scala b/src/scalap/scala/tools/scalap/JavaWriter.scala index c6d129920d..b539dd5fda 100644 --- a/src/scalap/scala/tools/scalap/JavaWriter.scala +++ b/src/scalap/scala/tools/scalap/JavaWriter.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Main.scala b/src/scalap/scala/tools/scalap/Main.scala index 69a91dafce..88b6c53c46 100644 --- a/src/scalap/scala/tools/scalap/Main.scala +++ b/src/scalap/scala/tools/scalap/Main.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap @@ -127,9 +126,6 @@ object Main { } } - - - /**Executes scalap with the given arguments and classpath for the * class denoted by <code>classname</code>. * @@ -158,18 +154,6 @@ object Main { val clazz = new Classfile(reader) processJavaClassFile(clazz) } - // if the class corresponds to the artificial class scala.All. - // (to be removed after update of the STARR libraries) - } else if (classname == "scala.All") { - Console.println("package scala") - Console.println("/* Deprecated. Use scala.Nothing instead. */") - Console.println("sealed abstract class All") - // if the class corresponds to the artificial class scala.AllRef. - // (to be removed after update of the STARR libraries) - } else if (classname == "scala.AllRef") { - Console.println("package scala") - Console.println("/* Deprecated. Use scala.Null instead. */") - Console.println("sealed abstract class AllRef") // if the class corresponds to the artificial class scala.Any. // (see member list in class scala.tool.nsc.symtab.Definitions) } else if (classname == "scala.Any") { diff --git a/src/scalap/scala/tools/scalap/MetaParser.scala b/src/scalap/scala/tools/scalap/MetaParser.scala index 200f8c3c5d..2b75d97349 100644 --- a/src/scalap/scala/tools/scalap/MetaParser.scala +++ b/src/scalap/scala/tools/scalap/MetaParser.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Names.scala b/src/scalap/scala/tools/scalap/Names.scala index 15aac661ab..a916ea1220 100644 --- a/src/scalap/scala/tools/scalap/Names.scala +++ b/src/scalap/scala/tools/scalap/Names.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/Properties.scala b/src/scalap/scala/tools/scalap/Properties.scala index 315b81cb3e..4cdbe69d01 100644 --- a/src/scalap/scala/tools/scalap/Properties.scala +++ b/src/scalap/scala/tools/scalap/Properties.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala index e0f95c8bbb..d2e50deae3 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap package scalax diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala index 354e3131e8..915087a256 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala @@ -5,7 +5,6 @@ ** */ -// $Id$ package scala.tools.scalap package scalax diff --git a/src/swing/scala/swing/AbstractButton.scala b/src/swing/scala/swing/AbstractButton.scala index 5de0283e22..ee26a6da31 100644 --- a/src/swing/scala/swing/AbstractButton.scala +++ b/src/swing/scala/swing/AbstractButton.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Action.scala b/src/swing/scala/swing/Action.scala index 613038abe2..4c3e92bff7 100644 --- a/src/swing/scala/swing/Action.scala +++ b/src/swing/scala/swing/Action.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Alignment.scala b/src/swing/scala/swing/Alignment.scala index f0622da6ff..a864afe91b 100644 --- a/src/swing/scala/swing/Alignment.scala +++ b/src/swing/scala/swing/Alignment.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Applet.scala b/src/swing/scala/swing/Applet.scala index f7b921d6b1..ab6bb50e0a 100644 --- a/src/swing/scala/swing/Applet.scala +++ b/src/swing/scala/swing/Applet.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/BorderPanel.scala b/src/swing/scala/swing/BorderPanel.scala index 01fe873f93..392c205376 100644 --- a/src/swing/scala/swing/BorderPanel.scala +++ b/src/swing/scala/swing/BorderPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/BoxPanel.scala b/src/swing/scala/swing/BoxPanel.scala index cc6f42a66b..f976813e59 100644 --- a/src/swing/scala/swing/BoxPanel.scala +++ b/src/swing/scala/swing/BoxPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/BufferWrapper.scala b/src/swing/scala/swing/BufferWrapper.scala index eac53c5d77..75b86aa2a7 100644 --- a/src/swing/scala/swing/BufferWrapper.scala +++ b/src/swing/scala/swing/BufferWrapper.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Button.scala b/src/swing/scala/swing/Button.scala index 90a497be15..45dc703c68 100644 --- a/src/swing/scala/swing/Button.scala +++ b/src/swing/scala/swing/Button.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ButtonGroup.scala b/src/swing/scala/swing/ButtonGroup.scala index d9c8d43a88..477f7a1372 100644 --- a/src/swing/scala/swing/ButtonGroup.scala +++ b/src/swing/scala/swing/ButtonGroup.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/CheckBox.scala b/src/swing/scala/swing/CheckBox.scala index a13d952e8b..d528fa1428 100644 --- a/src/swing/scala/swing/CheckBox.scala +++ b/src/swing/scala/swing/CheckBox.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ComboBox.scala b/src/swing/scala/swing/ComboBox.scala index fabbcf2d35..a9800693d4 100644 --- a/src/swing/scala/swing/ComboBox.scala +++ b/src/swing/scala/swing/ComboBox.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Component.scala b/src/swing/scala/swing/Component.scala index 851192843d..62344bdb45 100644 --- a/src/swing/scala/swing/Component.scala +++ b/src/swing/scala/swing/Component.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Container.scala b/src/swing/scala/swing/Container.scala index 82de2e92a2..33201eba51 100644 --- a/src/swing/scala/swing/Container.scala +++ b/src/swing/scala/swing/Container.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/EditorPane.scala b/src/swing/scala/swing/EditorPane.scala index 884da6a371..9302650d50 100644 --- a/src/swing/scala/swing/EditorPane.scala +++ b/src/swing/scala/swing/EditorPane.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/FileChooser.scala b/src/swing/scala/swing/FileChooser.scala index 7e13dff7e4..f9eda4a182 100644 --- a/src/swing/scala/swing/FileChooser.scala +++ b/src/swing/scala/swing/FileChooser.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/FlowPanel.scala b/src/swing/scala/swing/FlowPanel.scala index 65833940f5..25f128d1ee 100644 --- a/src/swing/scala/swing/FlowPanel.scala +++ b/src/swing/scala/swing/FlowPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/FormattedTextField.scala b/src/swing/scala/swing/FormattedTextField.scala index 1a2d1dacb4..0253750134 100644 --- a/src/swing/scala/swing/FormattedTextField.scala +++ b/src/swing/scala/swing/FormattedTextField.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/GUIApplication.scala b/src/swing/scala/swing/GUIApplication.scala index 3e10434ae5..95cc8cbfea 100644 --- a/src/swing/scala/swing/GUIApplication.scala +++ b/src/swing/scala/swing/GUIApplication.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/GridBagPanel.scala b/src/swing/scala/swing/GridBagPanel.scala index 412ec3f4f5..586d94158f 100644 --- a/src/swing/scala/swing/GridBagPanel.scala +++ b/src/swing/scala/swing/GridBagPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/GridPanel.scala b/src/swing/scala/swing/GridPanel.scala index 608b8810a2..acba29e753 100644 --- a/src/swing/scala/swing/GridPanel.scala +++ b/src/swing/scala/swing/GridPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Label.scala b/src/swing/scala/swing/Label.scala index 31b2b0c87c..00b1b2898a 100644 --- a/src/swing/scala/swing/Label.scala +++ b/src/swing/scala/swing/Label.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/LayoutContainer.scala b/src/swing/scala/swing/LayoutContainer.scala index 8e94bf565f..1b16ba9466 100644 --- a/src/swing/scala/swing/LayoutContainer.scala +++ b/src/swing/scala/swing/LayoutContainer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ListView.scala b/src/swing/scala/swing/ListView.scala index 9c7b7d6d19..7a94ff112f 100644 --- a/src/swing/scala/swing/ListView.scala +++ b/src/swing/scala/swing/ListView.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/MainFrame.scala b/src/swing/scala/swing/MainFrame.scala index ec4e74958b..4bc855d1c3 100644 --- a/src/swing/scala/swing/MainFrame.scala +++ b/src/swing/scala/swing/MainFrame.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Menu.scala b/src/swing/scala/swing/Menu.scala index 55773320c6..21d1d7ae12 100644 --- a/src/swing/scala/swing/Menu.scala +++ b/src/swing/scala/swing/Menu.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Orientable.scala b/src/swing/scala/swing/Orientable.scala index 5a5bc829a2..8aac30f339 100644 --- a/src/swing/scala/swing/Orientable.scala +++ b/src/swing/scala/swing/Orientable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Orientation.scala b/src/swing/scala/swing/Orientation.scala index 38d37d51a3..e017b2374f 100644 --- a/src/swing/scala/swing/Orientation.scala +++ b/src/swing/scala/swing/Orientation.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Oriented.scala b/src/swing/scala/swing/Oriented.scala index 5bc5672cbf..b19a5f898d 100644 --- a/src/swing/scala/swing/Oriented.scala +++ b/src/swing/scala/swing/Oriented.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Panel.scala b/src/swing/scala/swing/Panel.scala index 9716c405e7..1671915074 100644 --- a/src/swing/scala/swing/Panel.scala +++ b/src/swing/scala/swing/Panel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/PasswordField.scala b/src/swing/scala/swing/PasswordField.scala index 568cc3b927..aac9c393b9 100644 --- a/src/swing/scala/swing/PasswordField.scala +++ b/src/swing/scala/swing/PasswordField.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ProgressBar.scala b/src/swing/scala/swing/ProgressBar.scala index c6c2ae25d3..557d7b89c3 100644 --- a/src/swing/scala/swing/ProgressBar.scala +++ b/src/swing/scala/swing/ProgressBar.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Publisher.scala b/src/swing/scala/swing/Publisher.scala index cf60293ada..3fa9fc7e56 100644 --- a/src/swing/scala/swing/Publisher.scala +++ b/src/swing/scala/swing/Publisher.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing @@ -81,7 +80,7 @@ private[swing] trait SingleRefCollection[+A <: AnyRef] extends Iterable[A] { sel trait Ref[+A <: AnyRef] extends Reference[A] { override def hashCode() = { val v = get - if (v == None) 0 else v.get.hashCode + if (v == None) 0 else v.get.## } override def equals(that: Any) = that match { case that: ReferenceWrapper[_] => diff --git a/src/swing/scala/swing/RadioButton.scala b/src/swing/scala/swing/RadioButton.scala index 3b3e60816b..c030b3c92e 100644 --- a/src/swing/scala/swing/RadioButton.scala +++ b/src/swing/scala/swing/RadioButton.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Reactions.scala b/src/swing/scala/swing/Reactions.scala index 14d4deb981..a30cb9f5a4 100644 --- a/src/swing/scala/swing/Reactions.scala +++ b/src/swing/scala/swing/Reactions.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Reactor.scala b/src/swing/scala/swing/Reactor.scala index 119ca6d954..8fdd6cf911 100644 --- a/src/swing/scala/swing/Reactor.scala +++ b/src/swing/scala/swing/Reactor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/RichWindow.scala b/src/swing/scala/swing/RichWindow.scala index a28794c6c1..10e396247e 100644 --- a/src/swing/scala/swing/RichWindow.scala +++ b/src/swing/scala/swing/RichWindow.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/RootPanel.scala b/src/swing/scala/swing/RootPanel.scala index c18b68a306..86bfd090d9 100644 --- a/src/swing/scala/swing/RootPanel.scala +++ b/src/swing/scala/swing/RootPanel.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ScrollBar.scala b/src/swing/scala/swing/ScrollBar.scala index 28245edda7..cd2fbdc973 100644 --- a/src/swing/scala/swing/ScrollBar.scala +++ b/src/swing/scala/swing/ScrollBar.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ScrollPane.scala b/src/swing/scala/swing/ScrollPane.scala index 41d00045e5..a840bf2751 100644 --- a/src/swing/scala/swing/ScrollPane.scala +++ b/src/swing/scala/swing/ScrollPane.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Scrollable.scala b/src/swing/scala/swing/Scrollable.scala index 54ba9aef57..34c0261ef3 100644 --- a/src/swing/scala/swing/Scrollable.scala +++ b/src/swing/scala/swing/Scrollable.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Separator.scala b/src/swing/scala/swing/Separator.scala index 4fdf0edb70..f5eaa5d43f 100644 --- a/src/swing/scala/swing/Separator.scala +++ b/src/swing/scala/swing/Separator.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/SequentialContainer.scala b/src/swing/scala/swing/SequentialContainer.scala index 9bba8f5a2b..ba2b105b2b 100644 --- a/src/swing/scala/swing/SequentialContainer.scala +++ b/src/swing/scala/swing/SequentialContainer.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/SimpleGUIApplication.scala b/src/swing/scala/swing/SimpleGUIApplication.scala index e26a0263f8..fec8dbfef7 100644 --- a/src/swing/scala/swing/SimpleGUIApplication.scala +++ b/src/swing/scala/swing/SimpleGUIApplication.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Slider.scala b/src/swing/scala/swing/Slider.scala index 10b79f37cc..47065afe4a 100644 --- a/src/swing/scala/swing/Slider.scala +++ b/src/swing/scala/swing/Slider.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/SplitPane.scala b/src/swing/scala/swing/SplitPane.scala index fc090e2a6d..583e480beb 100644 --- a/src/swing/scala/swing/SplitPane.scala +++ b/src/swing/scala/swing/SplitPane.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Swing.scala b/src/swing/scala/swing/Swing.scala index 3ca36a38a1..551c1541cd 100644 --- a/src/swing/scala/swing/Swing.scala +++ b/src/swing/scala/swing/Swing.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/SwingActor.scala b/src/swing/scala/swing/SwingActor.scala index 6b1ad01faa..01df831f2e 100644 --- a/src/swing/scala/swing/SwingActor.scala +++ b/src/swing/scala/swing/SwingActor.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/TabbedPane.scala b/src/swing/scala/swing/TabbedPane.scala index 21671e9da8..f87209f00d 100644 --- a/src/swing/scala/swing/TabbedPane.scala +++ b/src/swing/scala/swing/TabbedPane.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Table.scala b/src/swing/scala/swing/Table.scala index 2993f1d84e..0a9eb6379a 100644 --- a/src/swing/scala/swing/Table.scala +++ b/src/swing/scala/swing/Table.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/TextArea.scala b/src/swing/scala/swing/TextArea.scala index 201e4ab674..fe2baa6952 100644 --- a/src/swing/scala/swing/TextArea.scala +++ b/src/swing/scala/swing/TextArea.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/TextComponent.scala b/src/swing/scala/swing/TextComponent.scala index f249d57d0e..61ff33009e 100644 --- a/src/swing/scala/swing/TextComponent.scala +++ b/src/swing/scala/swing/TextComponent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/TextField.scala b/src/swing/scala/swing/TextField.scala index 2f63da7f00..dc5a4a326a 100644 --- a/src/swing/scala/swing/TextField.scala +++ b/src/swing/scala/swing/TextField.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/ToggleButton.scala b/src/swing/scala/swing/ToggleButton.scala index 59f310dc23..45a2f8982f 100644 --- a/src/swing/scala/swing/ToggleButton.scala +++ b/src/swing/scala/swing/ToggleButton.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/UIElement.scala b/src/swing/scala/swing/UIElement.scala index 737833dc95..8ba9493b8c 100644 --- a/src/swing/scala/swing/UIElement.scala +++ b/src/swing/scala/swing/UIElement.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/Window.scala b/src/swing/scala/swing/Window.scala index dab2ad6b94..4eeefc0329 100644 --- a/src/swing/scala/swing/Window.scala +++ b/src/swing/scala/swing/Window.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ActionEvent.scala b/src/swing/scala/swing/event/ActionEvent.scala index 9d9700c39f..83df36ad7d 100644 --- a/src/swing/scala/swing/event/ActionEvent.scala +++ b/src/swing/scala/swing/event/ActionEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/AdjustingEvent.scala b/src/swing/scala/swing/event/AdjustingEvent.scala index 0124583d87..55e51d79f6 100644 --- a/src/swing/scala/swing/event/AdjustingEvent.scala +++ b/src/swing/scala/swing/event/AdjustingEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/BackgroundChanged.scala b/src/swing/scala/swing/event/BackgroundChanged.scala index 6c70b3a528..3b6a71ba3a 100644 --- a/src/swing/scala/swing/event/BackgroundChanged.scala +++ b/src/swing/scala/swing/event/BackgroundChanged.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ButtonClicked.scala b/src/swing/scala/swing/event/ButtonClicked.scala index 4bfdee9b18..b5bd5ebbbc 100644 --- a/src/swing/scala/swing/event/ButtonClicked.scala +++ b/src/swing/scala/swing/event/ButtonClicked.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/CaretUpdate.scala b/src/swing/scala/swing/event/CaretUpdate.scala index 3e1a0e1250..0560159038 100644 --- a/src/swing/scala/swing/event/CaretUpdate.scala +++ b/src/swing/scala/swing/event/CaretUpdate.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ComponentEvent.scala b/src/swing/scala/swing/event/ComponentEvent.scala index 1f834e8ed2..582932ae61 100644 --- a/src/swing/scala/swing/event/ComponentEvent.scala +++ b/src/swing/scala/swing/event/ComponentEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ContainerEvent.scala b/src/swing/scala/swing/event/ContainerEvent.scala index 0b18ece66b..5eecf6a551 100644 --- a/src/swing/scala/swing/event/ContainerEvent.scala +++ b/src/swing/scala/swing/event/ContainerEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/EditDone.scala b/src/swing/scala/swing/event/EditDone.scala index 5f4b5f50a6..250cf6f9ff 100644 --- a/src/swing/scala/swing/event/EditDone.scala +++ b/src/swing/scala/swing/event/EditDone.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/Event.scala b/src/swing/scala/swing/event/Event.scala index 302dc9f2f0..3e04ae6bd2 100644 --- a/src/swing/scala/swing/event/Event.scala +++ b/src/swing/scala/swing/event/Event.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/FocusEvent.scala b/src/swing/scala/swing/event/FocusEvent.scala index 96fc1f60ec..7f74000ea0 100644 --- a/src/swing/scala/swing/event/FocusEvent.scala +++ b/src/swing/scala/swing/event/FocusEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/FontChanged.scala b/src/swing/scala/swing/event/FontChanged.scala index fcfddf1c43..701d2792a4 100644 --- a/src/swing/scala/swing/event/FontChanged.scala +++ b/src/swing/scala/swing/event/FontChanged.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ForegroundChanged.scala b/src/swing/scala/swing/event/ForegroundChanged.scala index d01dd395e4..4a11de8d04 100644 --- a/src/swing/scala/swing/event/ForegroundChanged.scala +++ b/src/swing/scala/swing/event/ForegroundChanged.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/InputEvent.scala b/src/swing/scala/swing/event/InputEvent.scala index b221f91716..69cbdbaf74 100644 --- a/src/swing/scala/swing/event/InputEvent.scala +++ b/src/swing/scala/swing/event/InputEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/Key.scala b/src/swing/scala/swing/event/Key.scala index ffccca8761..5bc3ad6c4a 100644 --- a/src/swing/scala/swing/event/Key.scala +++ b/src/swing/scala/swing/event/Key.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/KeyEvent.scala b/src/swing/scala/swing/event/KeyEvent.scala index 4e47e43a8d..ff0da501b9 100644 --- a/src/swing/scala/swing/event/KeyEvent.scala +++ b/src/swing/scala/swing/event/KeyEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ListEvent.scala b/src/swing/scala/swing/event/ListEvent.scala index f904f04bcc..b0dfc70318 100644 --- a/src/swing/scala/swing/event/ListEvent.scala +++ b/src/swing/scala/swing/event/ListEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/MouseEvent.scala b/src/swing/scala/swing/event/MouseEvent.scala index ebacf2e7b4..8176a2a291 100644 --- a/src/swing/scala/swing/event/MouseEvent.scala +++ b/src/swing/scala/swing/event/MouseEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/SelectionEvent.scala b/src/swing/scala/swing/event/SelectionEvent.scala index f6ccbc6c54..898713aef8 100644 --- a/src/swing/scala/swing/event/SelectionEvent.scala +++ b/src/swing/scala/swing/event/SelectionEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/TableEvent.scala b/src/swing/scala/swing/event/TableEvent.scala index e12322fa18..600346400e 100644 --- a/src/swing/scala/swing/event/TableEvent.scala +++ b/src/swing/scala/swing/event/TableEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/UIEvent.scala b/src/swing/scala/swing/event/UIEvent.scala index 491da1fd8c..0373268dbc 100644 --- a/src/swing/scala/swing/event/UIEvent.scala +++ b/src/swing/scala/swing/event/UIEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/ValueChanged.scala b/src/swing/scala/swing/event/ValueChanged.scala index 06e0061f7e..5f32c0339a 100644 --- a/src/swing/scala/swing/event/ValueChanged.scala +++ b/src/swing/scala/swing/event/ValueChanged.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowActivated.scala b/src/swing/scala/swing/event/WindowActivated.scala index 0d910de5bf..3c0fae4c5e 100644 --- a/src/swing/scala/swing/event/WindowActivated.scala +++ b/src/swing/scala/swing/event/WindowActivated.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowClosing.scala b/src/swing/scala/swing/event/WindowClosing.scala index b180489a4e..7d878f0199 100644 --- a/src/swing/scala/swing/event/WindowClosing.scala +++ b/src/swing/scala/swing/event/WindowClosing.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowDeactivated.scala b/src/swing/scala/swing/event/WindowDeactivated.scala index de02560388..08f0f63590 100644 --- a/src/swing/scala/swing/event/WindowDeactivated.scala +++ b/src/swing/scala/swing/event/WindowDeactivated.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowDeiconified.scala b/src/swing/scala/swing/event/WindowDeiconified.scala index ec8f3d0b57..2abeb731a4 100644 --- a/src/swing/scala/swing/event/WindowDeiconified.scala +++ b/src/swing/scala/swing/event/WindowDeiconified.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowEvent.scala b/src/swing/scala/swing/event/WindowEvent.scala index dc9e6d0822..d1be47d617 100644 --- a/src/swing/scala/swing/event/WindowEvent.scala +++ b/src/swing/scala/swing/event/WindowEvent.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowIconified.scala b/src/swing/scala/swing/event/WindowIconified.scala index 1bf2e5af6d..82ec8ab1fe 100644 --- a/src/swing/scala/swing/event/WindowIconified.scala +++ b/src/swing/scala/swing/event/WindowIconified.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/event/WindowOpened.scala b/src/swing/scala/swing/event/WindowOpened.scala index 199891cd6d..54684c3415 100644 --- a/src/swing/scala/swing/event/WindowOpened.scala +++ b/src/swing/scala/swing/event/WindowOpened.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing diff --git a/src/swing/scala/swing/model/Matrix.scala b/src/swing/scala/swing/model/Matrix.scala index 18479a8cc5..f91512a284 100644 --- a/src/swing/scala/swing/model/Matrix.scala +++ b/src/swing/scala/swing/model/Matrix.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ -// $Id$ package scala.swing package model |