diff options
Diffstat (limited to 'src')
27 files changed, 80 insertions, 610 deletions
diff --git a/src/actors-migration/scala/actors/migration/ActorDSL.scala b/src/actors-migration/scala/actors/migration/ActorDSL.scala deleted file mode 100644 index b8cb8ec998..0000000000 --- a/src/actors-migration/scala/actors/migration/ActorDSL.scala +++ /dev/null @@ -1,56 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2005-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.actors -package migration - -import scala.actors.{ Actor, ActorRef, InternalActorRef } -import scala.collection.immutable -import scala.reflect.ClassTag - -object ActorDSL { - - private[migration] val contextStack = new ThreadLocal[immutable.Stack[Boolean]] { - override def initialValue() = immutable.Stack[Boolean]() - } - - private[this] def withCleanContext(block: => ActorRef): ActorRef = { - // push clean marker - val old = contextStack.get - contextStack.set(old.push(true)) - try { - val instance = block - - if (instance eq null) - throw new Exception("ActorRef can't be 'null'") - - instance - } finally { - val stackAfter = contextStack.get - if (stackAfter.nonEmpty) - contextStack.set(if (!stackAfter.head) stackAfter.pop.pop else stackAfter.pop) - } - } - - /** - * Create an actor from the given thunk which must produce an [[scala.actors.Actor]]. - * - * @param ctor is a by-name argument which captures an [[scala.actors.Actor]] - * factory; <b>do not make the generated object accessible to code - * outside and do not return the same object upon subsequent invocations.</b> - */ - def actor[T <: InternalActor: ClassTag](ctor: ⇒ T): ActorRef = { - withCleanContext { - val newActor = ctor - val newRef = new InternalActorRef(newActor) - newActor.start() - newRef - } - } - -} diff --git a/src/actors-migration/scala/actors/migration/Pattern.scala b/src/actors-migration/scala/actors/migration/Pattern.scala deleted file mode 100644 index 25ba191ce7..0000000000 --- a/src/actors-migration/scala/actors/migration/Pattern.scala +++ /dev/null @@ -1,27 +0,0 @@ -package scala.actors.migration - -import scala.actors._ -import scala.concurrent.duration.Duration -import language.implicitConversions - -object pattern { - - implicit def ask(ar: ActorRef): AskableActorRef = - new AskableActorRef(ar) -} - -/** - * ActorRef with support for ask(?) operation. - */ -class AskableActorRef(val ar: ActorRef) extends ActorRef { - - def !(message: Any)(implicit sender: ActorRef = null): Unit = ar.!(message)(sender) - - def ?(message: Any)(implicit timeout: Timeout): scala.concurrent.Future[Any] = ar.?(message, timeout.duration) - - private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any] = ar.?(message, timeout) - - def forward(message: Any) = ar.forward(message) - - private[actors] def localActor: AbstractActor = ar.localActor -} diff --git a/src/actors-migration/scala/actors/migration/Props.scala b/src/actors-migration/scala/actors/migration/Props.scala deleted file mode 100644 index 00bc9d93f8..0000000000 --- a/src/actors-migration/scala/actors/migration/Props.scala +++ /dev/null @@ -1,14 +0,0 @@ -package scala.actors.migration - -import scala.actors._ - -/** - * ActorRef configuration object. It represents the minimal subset of Akka Props class. - */ -case class Props(creator: () ⇒ InternalActor, dispatcher: String) { - - /** - * Returns a new Props with the specified creator set - */ - final def withCreator(c: ⇒ InternalActor) = copy(creator = () ⇒ c) -} diff --git a/src/actors-migration/scala/actors/migration/StashingActor.scala b/src/actors-migration/scala/actors/migration/StashingActor.scala deleted file mode 100644 index 12bad2ed1c..0000000000 --- a/src/actors-migration/scala/actors/migration/StashingActor.scala +++ /dev/null @@ -1,257 +0,0 @@ -package scala.actors.migration - -import scala.actors._ -import scala.actors.Actor._ -import scala.collection._ -import scala.concurrent.duration.Duration -import java.util.concurrent.TimeUnit -import scala.language.implicitConversions - -object StashingActor extends Combinators { - implicit def mkBody[A](body: => A) = new InternalActor.Body[A] { - def andThen[B](other: => B): Unit = Actor.rawSelf.seq(body, other) - } -} - -@deprecated("Scala Actors are being removed from the standard library. Please refer to the migration guide.", "2.10.0") -trait StashingActor extends InternalActor { - type Receive = PartialFunction[Any, Unit] - - // checks if StashingActor is created within the actorOf block - creationCheck() - - private[actors] val ref = new InternalActorRef(this) - - val self: ActorRef = ref - - protected[this] val context: ActorContext = new ActorContext(this) - - @volatile - private var myTimeout: Option[Long] = None - - private val stash = new MQueue[Any]("Stash") - - /** - * Migration notes: - * this method replaces receiveWithin, receive and react methods from Scala Actors. - */ - def receive: Receive - - /** - * User overridable callback. - * <p/> - * Is called when an Actor is started by invoking 'actor'. - */ - def preStart() {} - - /** - * User overridable callback. - * <p/> - * Is called when 'actor.stop()' is invoked. - */ - def postStop() {} - - /** - * User overridable callback. - * <p/> - * Is called on a crashed Actor right BEFORE it is restarted to allow clean - * up of resources before Actor is terminated. - * By default it calls postStop() - */ - def preRestart(reason: Throwable, message: Option[Any]) { postStop() } - - /** - * Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. - * Puts the behavior on top of the hotswap stack. - * If "discardOld" is true, an unbecome will be issued prior to pushing the new behavior to the stack - */ - private def become(behavior: Receive, discardOld: Boolean = true) { - if (discardOld) unbecome() - behaviorStack = behaviorStack.push(wrapWithSystemMessageHandling(behavior)) - } - - /** - * Reverts the Actor behavior to the previous one in the hotswap stack. - */ - private def unbecome() { - // never unbecome the initial behavior - if (behaviorStack.size > 1) - behaviorStack = behaviorStack.pop - } - - /** - * User overridable callback. - * <p/> - * Is called when a message isn't handled by the current behavior of the actor - * by default it does: EventHandler.warning(self, message) - */ - def unhandled(message: Any) { - message match { - case Terminated(dead) ⇒ throw new DeathPactException(dead) - case _ ⇒ System.err.println("Unhandeled message " + message) - } - } - - protected def sender: ActorRef = new OutputChannelRef(internalSender) - - override def act(): Unit = internalAct() - - override def start(): StashingActor = { - super.start() - this - } - - override def receive[R](f: PartialFunction[Any, R]): R - - /* - * Internal implementation. - */ - - private[actors] var behaviorStack = immutable.Stack[PartialFunction[Any, Unit]]() - - /* - * Checks that StashingActor instances can only be created using the ActorDSL. - */ - private[this] def creationCheck(): Unit = { - // creation check (see ActorRef) - val context = ActorDSL.contextStack.get - if (context.isEmpty) - throw new RuntimeException("In order to create a StashingActor one must use the ActorDSL object") - else { - if (!context.head) - throw new RuntimeException("Cannot create more than one actor") - else - ActorDSL.contextStack.set(context.push(false)) - } - - } - - private[actors] override def preAct() { - preStart() - } - - /** - * Adds message to a stash, to be processed later. Stashed messages can be fed back into the $actor's - * mailbox using <code>unstashAll()</code>. - * - * Temporarily stashing away messages that the $actor does not (yet) handle simplifies implementing - * certain messaging protocols. - */ - final def stash(msg: Any): Unit = { - stash.append(msg, null) - } - - final def unstashAll(): Unit = { - mailbox.prepend(stash) - stash.clear() - } - - /** - * Wraps any partial function with Exit message handling. - */ - private[actors] def wrapWithSystemMessageHandling(pf: PartialFunction[Any, Unit]): PartialFunction[Any, Unit] = { - - def swapExitHandler(pf: PartialFunction[Any, Unit]) = new PartialFunction[Any, Unit] { - def swapExit(v: Any) = v match { - case Exit(from, reason) => - Terminated(new InternalActorRef(from.asInstanceOf[InternalActor])) - case v => v - } - - def isDefinedAt(v: Any) = pf.isDefinedAt(swapExit(v)) - def apply(v: Any) = pf(swapExit(v)) - } - - swapExitHandler(pf orElse { - case m => unhandled(m) - }) - } - - /** - * Method that models the behavior of Akka actors. - */ - private[actors] def internalAct() { - trapExit = true - behaviorStack = behaviorStack.push(wrapWithSystemMessageHandling(receive)) - loop { - if (myTimeout.isDefined) - reactWithin(myTimeout.get)(behaviorStack.top) - else - react(behaviorStack.top) - } - } - - private[actors] override def internalPostStop() = postStop() - - // Used for pattern matching statement similar to Akka - lazy val ReceiveTimeout = TIMEOUT - - /** - * Used to simulate Akka context behavior. Should be used only for migration purposes. - */ - protected[actors] class ActorContext(val actr: StashingActor) { - - /** - * Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. - * Puts the behavior on top of the hotswap stack. - * If "discardOld" is true, an unbecome will be issued prior to pushing the new behavior to the stack - */ - def become(behavior: Receive, discardOld: Boolean = true) = actr.become(behavior, discardOld) - - /** - * Reverts the Actor behavior to the previous one in the hotswap stack. - */ - def unbecome() = actr.unbecome() - - /** - * Shuts down the actor its dispatcher and message queue. - */ - def stop(subject: ActorRef): Nothing = if (subject != ref) - throw new RuntimeException("Only stoping of self is allowed during migration.") - else - actr.exit() - - /** - * Registers this actor as a Monitor for the provided ActorRef. - * @return the provided ActorRef - */ - def watch(subject: ActorRef): ActorRef = { - actr.watch(subject) - subject - } - - /** - * Unregisters this actor as Monitor for the provided ActorRef. - * @return the provided ActorRef - */ - def unwatch(subject: ActorRef): ActorRef = { - actr unwatch subject - subject - } - - /** - * Defines the receiver timeout value. - */ - final def setReceiveTimeout(timeout: Duration): Unit = - actr.myTimeout = Some(timeout.toMillis) - - /** - * Gets the current receiveTimeout - */ - final def receiveTimeout: Option[Duration] = - actr.myTimeout.map(Duration(_, TimeUnit.MILLISECONDS)) - - } -} - -/** - * This message is thrown by default when an Actor does not handle termination. - */ -class DeathPactException(ref: ActorRef = null) extends Exception { - override def fillInStackTrace() = this //Don't waste cycles generating stack trace -} - -/** - * Message that is sent to a watching actor when the watched actor terminates. - */ -case class Terminated(actor: ActorRef) diff --git a/src/actors-migration/scala/actors/migration/Timeout.scala b/src/actors-migration/scala/actors/migration/Timeout.scala deleted file mode 100644 index 32ea5f20fc..0000000000 --- a/src/actors-migration/scala/actors/migration/Timeout.scala +++ /dev/null @@ -1,40 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2005-2011, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.actors.migration - -import scala.concurrent.duration.Duration -import java.util.concurrent.TimeUnit -import scala.language.implicitConversions - -case class Timeout(duration: Duration) { - def this(timeout: Long) = this(Duration(timeout, TimeUnit.MILLISECONDS)) - def this(length: Long, unit: TimeUnit) = this(Duration(length, unit)) -} - -object Timeout { - - /** - * A timeout with zero duration, will cause most requests to always timeout. - */ - val zero = new Timeout(Duration.Zero) - - /** - * A Timeout with infinite duration. Will never timeout. Use extreme caution with this - * as it may cause memory leaks, blocked threads, or may not even be supported by - * the receiver, which would result in an exception. - */ - val never = new Timeout(Duration.Inf) - - def apply(timeout: Long) = new Timeout(timeout) - def apply(length: Long, unit: TimeUnit) = new Timeout(length, unit) - - implicit def durationToTimeout(duration: Duration) = new Timeout(duration) - implicit def intToTimeout(timeout: Int) = new Timeout(timeout) - implicit def longToTimeout(timeout: Long) = new Timeout(timeout) -} diff --git a/src/actors/scala/actors/ActorRef.scala b/src/actors/scala/actors/ActorRef.scala index cca78b0832..5c1790669b 100644 --- a/src/actors/scala/actors/ActorRef.scala +++ b/src/actors/scala/actors/ActorRef.scala @@ -2,8 +2,6 @@ package scala.actors import java.util.concurrent.TimeoutException import scala.concurrent.duration.Duration -import scala.concurrent.Promise -import scala.concurrent.ExecutionContext.Implicits.global /** * Trait used for migration of Scala actors to Akka. @@ -43,78 +41,6 @@ trait ActorRef { } -private[actors] class OutputChannelRef(val actor: OutputChannel[Any]) extends ActorRef { - - override private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any] = - throw new UnsupportedOperationException("Output channel does not support ?") - - /** - * Sends a one-way asynchronous message. E.g. fire-and-forget semantics. - * <p/> - * - * <p/> - * <pre> - * actor ! message - * </pre> - * <p/> - */ - def !(message: Any)(implicit sender: ActorRef = null): Unit = - if (sender != null) - actor.send(message, sender.localActor) - else - actor ! message - - override def equals(that: Any) = - that.isInstanceOf[OutputChannelRef] && that.asInstanceOf[OutputChannelRef].actor == this.actor - - private[actors] override def localActor: AbstractActor = - throw new UnsupportedOperationException("Output channel does not have an instance of the actor") - - def forward(message: Any): Unit = throw new UnsupportedOperationException("OutputChannel does not support forward.") - -} - -private[actors] class ReactorRef(override val actor: Reactor[Any]) extends OutputChannelRef(actor) { - - /** - * Forwards the message and passes the original sender actor as the sender. - * <p/> - * Works with '!' and '?'. - */ - override def forward(message: Any) = actor.forward(message) - -} - -private[actors] final class InternalActorRef(override val actor: InternalActor) extends ReactorRef(actor) { - - /** - * Sends a message asynchronously, returning a future which may eventually hold the reply. - */ - override private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any] = { - val dur = if (timeout.isFinite()) timeout.toMillis else (java.lang.Long.MAX_VALUE >> 2) - val replyPromise = Promise[Any] - scala.concurrent.future { - scala.concurrent.blocking { - actor !? (dur, message) - } match { - case Some(x) => replyPromise success x - case None => replyPromise failure new AskTimeoutException("? operation timed out.") - } - } - replyPromise.future - } - - override def !(message: Any)(implicit sender: ActorRef = null): Unit = - if (message == PoisonPill) - actor.stop('normal) - else if (sender != null) - actor.send(message, sender.localActor) - else - actor ! message - - private[actors] override def localActor: InternalActor = this.actor -} - /** * This is what is used to complete a Future that is returned from an ask/? call, * when it times out. diff --git a/src/actors/scala/actors/remote/NetKernel.scala b/src/actors/scala/actors/remote/NetKernel.scala index c6b2d8b8cd..8338f9a6a6 100644 --- a/src/actors/scala/actors/remote/NetKernel.scala +++ b/src/actors/scala/actors/remote/NetKernel.scala @@ -60,7 +60,7 @@ private[remote] class NetKernel(service: Service) { send(node, name, msg, 'nosession) def send(node: Node, name: Symbol, msg: AnyRef, session: Symbol) { - val senderLoc = Locator(service.node, getOrCreateName(Actor.self)) + val senderLoc = Locator(service.node, getOrCreateName(Actor.self(Scheduler))) val receiverLoc = Locator(node, name) namedSend(senderLoc, receiverLoc, msg, session) } diff --git a/src/actors/scala/actors/remote/RemoteActor.scala b/src/actors/scala/actors/remote/RemoteActor.scala index 23cbae8532..571cb67e95 100644 --- a/src/actors/scala/actors/remote/RemoteActor.scala +++ b/src/actors/scala/actors/remote/RemoteActor.scala @@ -40,7 +40,7 @@ package remote */ object RemoteActor { - private val kernels = new scala.collection.mutable.HashMap[Actor, NetKernel] + private val kernels = new scala.collection.mutable.HashMap[InternalActor, NetKernel] /* If set to <code>null</code> (default), the default class loader * of <code>java.io.ObjectInputStream</code> is used for deserializing @@ -62,7 +62,7 @@ object RemoteActor { private def createNetKernelOnPort(port: Int): NetKernel = { val serv = TcpService(port, cl) val kern = serv.kernel - val s = Actor.self + val s = Actor.self(Scheduler) kernels += Pair(s, kern) s.onTerminate { @@ -86,10 +86,10 @@ object RemoteActor { * node. */ def register(name: Symbol, a: Actor): Unit = synchronized { - val kernel = kernels.get(Actor.self) match { + val kernel = kernels.get(Actor.self(Scheduler)) match { case None => val serv = TcpService(TcpService.generatePort, cl) - kernels += Pair(Actor.self, serv.kernel) + kernels += Pair(Actor.self(Scheduler), serv.kernel) serv.kernel case Some(k) => k @@ -97,7 +97,7 @@ object RemoteActor { kernel.register(name, a) } - private def selfKernel = kernels.get(Actor.self) match { + private def selfKernel = kernels.get(Actor.self(Scheduler)) match { case None => // establish remotely accessible // return path (sender) diff --git a/src/build/bnd/scala-actors-migration.bnd b/src/build/bnd/scala-actors-migration.bnd deleted file mode 100644 index 2cddfb620a..0000000000 --- a/src/build/bnd/scala-actors-migration.bnd +++ /dev/null @@ -1,5 +0,0 @@ -Bundle-Name: Scala Actors Migration -Bundle-SymbolicName: org.scala-lang.scala-actors-migration -ver: @VERSION@ -Bundle-Version: ${ver} -Export-Package: *;version=${ver} diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml index 131358f0f3..bd946bf0f3 100644 --- a/src/build/maven/maven-deploy.xml +++ b/src/build/maven/maven-deploy.xml @@ -113,7 +113,6 @@ <deploy-local-plugin name="continuations" version="@{version}" repository="@{repository}"/> <deploy-local name="scala-reflect" version="@{version}" repository="@{repository}" /> <deploy-local name="scala-actors" version="@{version}" repository="@{repository}" /> - <deploy-local name="scala-actors-migration" version="@{version}" repository="@{repository}" /> <deploy-local name="scala-swing" version="@{version}" repository="@{repository}"/> <deploy-local name="scalap" version="@{version}" repository="@{repository}"/> <deploy-local name="scala-partest" version="@{version}" repository="@{repository}"/> @@ -175,7 +174,6 @@ <deploy-remote name="scala-compiler" version="@{version}" repository="@{repository}" /> <deploy-remote name="scala-swing" version="@{version}" repository="@{repository}"/> <deploy-remote name="scala-actors" version="@{version}" repository="@{repository}"/> - <deploy-remote name="scala-actors-migration" version="@{version}" repository="@{repository}"/> <deploy-remote name="scalap" version="@{version}" repository="@{repository}"/> <deploy-remote name="scala-partest" version="@{version}" repository="@{repository}"/> <deploy-remote-plugin name="continuations" version="@{version}" repository="@{repository}"/> @@ -244,7 +242,6 @@ <deploy-remote-signed name="scala-compiler" version="@{version}" repository="@{repository}" /> <deploy-remote-signed name="scala-swing" version="@{version}" repository="@{repository}"/> <deploy-remote-signed name="scala-actors" version="@{version}" repository="@{repository}"/> - <deploy-remote-signed name="scala-actors-migration" version="@{version}" repository="@{repository}"/> <deploy-remote-signed name="scalap" version="@{version}" repository="@{repository}"/> <deploy-remote-signed name="scala-partest" version="@{version}" repository="@{repository}"/> </sequential> diff --git a/src/build/maven/scala-actors-migration-pom.xml b/src/build/maven/scala-actors-migration-pom.xml deleted file mode 100644 index 93fc34ece9..0000000000 --- a/src/build/maven/scala-actors-migration-pom.xml +++ /dev/null @@ -1,66 +0,0 @@ -<project - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.scala-lang</groupId> - <artifactId>scala-actors-migration</artifactId> - <packaging>jar</packaging> - <version>@VERSION@</version> - <name>Scala Migration Kit</name> - <description>Migration kit that enables easy transition from the Scala Actors to Akka.</description> - <url>http://www.scala-lang.org/</url> - <inceptionYear>2012</inceptionYear> - <organization> - <name>LAMP/EPFL</name> - <url>http://lamp.epfl.ch/</url> - </organization> - <licenses> - <license> - <name>BSD-like</name> - <url>http://www.scala-lang.org/downloads/license.html - </url> - <distribution>repo</distribution> - </license> - </licenses> - <scm> - <connection>scm:git:git://github.com/scala/scala.git</connection> - <url>https://github.com/scala/scala.git</url> - </scm> - <issueManagement> - <system>JIRA</system> - <url>https://issues.scala-lang.org/</url> - </issueManagement> - <dependencies> - <dependency> - <groupId>org.scala-lang</groupId> - <artifactId>scala-library</artifactId> - <version>@VERSION@</version> - </dependency> - <dependency> - <groupId>org.scala-lang</groupId> - <artifactId>scala-actors</artifactId> - <version>@VERSION@</version> - </dependency> - </dependencies> - <distributionManagement> - <repository> - <id>scala-tools.org</id> - <url>@RELEASE_REPOSITORY@</url> - </repository> - <snapshotRepository> - <id>scala-tools.org</id> - <url>@SNAPSHOT_REPOSITORY@</url> - <uniqueVersion>false</uniqueVersion> - </snapshotRepository> - </distributionManagement> - <developers> - <developer> - <id>lamp</id> - <name>EPFL LAMP</name> - </developer> - <developer> - <id>Typesafe</id> - <name>Typesafe, Inc.</name> - </developer> - </developers> -</project> diff --git a/src/build/pack.xml b/src/build/pack.xml index 1735b93f3f..79611b55a2 100644 --- a/src/build/pack.xml +++ b/src/build/pack.xml @@ -155,7 +155,6 @@ MAIN DISTRIBUTION PACKAGING <mvn-copy-lib mvn.artifact.name="scala-compiler"/> <mvn-copy-lib mvn.artifact.name="scala-swing"/> <mvn-copy-lib mvn.artifact.name="scala-actors"/> - <mvn-copy-lib mvn.artifact.name="scala-actors-migration"/> <mvn-copy-lib mvn.artifact.name="scala-partest"/> <mvn-copy-lib mvn.artifact.name="scalap"/> </target> @@ -218,10 +217,6 @@ MAIN DISTRIBUTION PACKAGING basedir="${build-docs.dir}/continuations-plugin"> <include name="**/*"/> </jar> - <jar destfile="${dists.dir}/maven/${version.number}/scala-actors-migration/scala-actors-migration-docs.jar" - basedir="${build-docs.dir}/actors-migration"> - <include name="**/*"/> - </jar> <!-- TODO - Scala swing and actors should maybe have thier own jar, but creating it is SLOW. --> <copy tofile="${dists.dir}/maven/${version.number}/scala-swing/scala-swing-docs.jar" diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index f9eeb41e6d..6d7948f0a9 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -558,7 +558,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { def innerClassSymbolFor(s: Symbol): Symbol = if (s.isClass) s else if (s.isModule) s.moduleClass else NoSymbol - /** Return the a name of this symbol that can be used on the Java platform. It removes spaces from names. + /** Return the name of this symbol that can be used on the Java platform. It removes spaces from names. * * Special handling: * scala.Nothing erases to scala.runtime.Nothing$ @@ -607,7 +607,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case None => reverseJavaName.put(internalName, trackedSym) case Some(oldsym) => - assert((oldsym == trackedSym) || (oldsym == RuntimeNothingClass) || (oldsym == RuntimeNullClass), // In contrast, neither NothingClass nor NullClass show up bytecode-level. + assert((oldsym == trackedSym) || (oldsym == RuntimeNothingClass) || (oldsym == RuntimeNullClass) || + (oldsym.isModuleClass && (oldsym.sourceModule == trackedSym.sourceModule)), // In contrast, neither NothingClass nor NullClass show up bytecode-level. "how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: " + internalName) } } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 8fd8dfaf83..9caafe6912 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -94,7 +94,10 @@ abstract class ClassfileParser { pushBusy(root) { this.in = new AbstractFileReader(file) this.clazz = if (root.isModule) root.companionClass else root - this.staticModule = clazz.companionModule + // WARNING! do no use clazz.companionModule to find staticModule. + // In a situation where root can be defined, but its companionClass not, + // this would give incorrect results (see SI-5031 in separate compilation scenario) + this.staticModule = if (root.isModule) root else root.companionModule this.isScala = false parseHeader diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 2b0520592b..80900a1a0a 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -481,7 +481,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { /** The typer */ private var localTyper: erasure.Typer = _ - private def typedPos(pos: Position)(tree: Tree) = localTyper typed { atPos(pos)(tree) } + private def typedPos(pos: Position)(tree: Tree): Tree = localTyper.typedPos(pos)(tree) private def localTyped(pos: Position, tree: Tree, pt: Type) = localTyper.typed(atPos(pos)(tree), pt) /** Map lazy values to the fields they should null after initialization. */ diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index 97e86d183e..aa507efe5a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -321,7 +321,9 @@ abstract class Duplicators extends Analyzer { // we use the symbol name instead of the tree name because the symbol may have been // name mangled, rendering the tree name obsolete // log(tree) - val t = super.typed(atPos(tree.pos)(Select(This(newClassOwner), tree.symbol.name)), mode, pt) + val t = super.typedPos(tree.pos, mode, pt) { + Select(This(newClassOwner), tree.symbol.name) + } // log("typed to: " + t + "; tpe = " + t.tpe + "; " + inspectTpe(t.tpe)) t @@ -331,7 +333,7 @@ abstract class Duplicators extends Analyzer { val tree1 = This(newClassOwner) // log("tree1: " + tree1) debuglog("mapped " + tree + " to " + tree1) - super.typed(atPos(tree.pos)(tree1), mode, pt) + super.typedPos(tree.pos, mode, pt)(tree1) case This(_) => debuglog("selection on this, plain: " + tree) @@ -368,7 +370,7 @@ abstract class Duplicators extends Analyzer { cases } - super.typed(atPos(tree.pos)(Match(scrut, cases1)), mode, pt) + super.typedPos(tree.pos, mode, pt)(Match(scrut, cases1)) case EmptyTree => // no need to do anything, in particular, don't set the type to null, EmptyTree.tpe_= asserts diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 7852ff49e1..99301cebcf 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1172,7 +1172,7 @@ trait Implicits { } try { - val tree1 = typed(atPos(pos.focus)(arg)) + val tree1 = typedPos(pos.focus)(arg) if (context.hasErrors) processMacroExpansionError(context.errBuffer.head.errPos, context.errBuffer.head.errMsg) else new SearchResult(tree1, EmptyTreeTypeSubstituter) } catch { diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index cc3d980cf1..001acc7a80 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -36,11 +36,31 @@ trait SyntheticMethods extends ast.TreeDSL { import definitions._ import CODE._ + private lazy val productSymbols = List(Product_productPrefix, Product_productArity, Product_productElement, Product_iterator, Product_canEqual) + private lazy val valueSymbols = List(Any_hashCode, Any_equals) + private lazy val caseSymbols = List(Object_hashCode, Object_toString) ::: productSymbols + private lazy val caseValueSymbols = Any_toString :: valueSymbols ::: productSymbols + private lazy val caseObjectSymbols = Object_equals :: caseSymbols + private def symbolsToSynthesize(clazz: Symbol): List[Symbol] = { + if (clazz.isCase) { + if (clazz.isDerivedValueClass) caseValueSymbols + else if (clazz.isModuleClass) caseSymbols + else caseObjectSymbols + } + else if (clazz.isDerivedValueClass) valueSymbols + else Nil + } + /** Add the synthetic methods to case classes. */ def addSyntheticMethods(templ: Template, clazz0: Symbol, context: Context): Template = { - - if (phase.erasedTypes) + val syntheticsOk = (phase.id <= currentRun.typerPhase.id) && { + symbolsToSynthesize(clazz0) filter (_ matchingSymbol clazz0.info isSynthetic) match { + case Nil => true + case syms => log("Not adding synthetic methods: already has " + syms.mkString(", ")) ; false + } + } + if (!syntheticsOk) return templ val synthesizer = new ClassMethodSynthesis( @@ -94,9 +114,9 @@ trait SyntheticMethods extends ast.TreeDSL { Apply(gen.mkAttributedRef(method), args.toList) } - // Any member, including private + // Any concrete member, including private def hasConcreteImpl(name: Name) = - clazz.info.member(name).alternatives exists (m => !m.isDeferred && !m.isSynthetic) + clazz.info.member(name).alternatives exists (m => !m.isDeferred) def hasOverridingImplementation(meth: Symbol) = { val sym = clazz.info nonPrivateMember meth.name @@ -347,8 +367,7 @@ trait SyntheticMethods extends ast.TreeDSL { (lb ++= templ.body ++= synthesize()).toList } - if (phase.id > currentRun.typerPhase.id) templ - else deriveTemplate(templ)(body => + deriveTemplate(templ)(body => if (clazz.isCase) caseTemplateBody() else synthesize() match { case Nil => body // avoiding unnecessary copy diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index f82786da35..c5bd92a943 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1049,7 +1049,9 @@ trait Typers extends Modes with Adaptations with Tags { case other => other } - typed(atPos(tree.pos)(Select(qual setPos tree.pos.makeTransparent, nme.apply)), mode, pt) + typedPos(tree.pos, mode, pt) { + Select(qual setPos tree.pos.makeTransparent, nme.apply) + } } // begin adapt @@ -1147,11 +1149,15 @@ trait Typers extends Modes with Adaptations with Tags { if (sym == UnitClass && tree.tpe <:< AnyClass.tpe) { // (12) if (settings.warnValueDiscard.value) context.unit.warning(tree.pos, "discarded non-Unit value") - return typed(atPos(tree.pos)(Block(List(tree), Literal(Constant()))), mode, pt) + return typedPos(tree.pos, mode, pt) { + Block(List(tree), Literal(Constant())) + } } else if (isNumericValueClass(sym) && isNumericSubType(tree.tpe, pt)) { if (settings.warnNumericWiden.value) context.unit.warning(tree.pos, "implicit numeric widening") - return typed(atPos(tree.pos)(Select(tree, "to" + sym.name)), mode, pt) + return typedPos(tree.pos, mode, pt) { + Select(tree, "to" + sym.name) + } } case AnnotatedType(_, _, _) if canAdaptAnnotations(tree, mode, pt) => // (13) return typed(adaptAnnotations(tree, mode, pt), mode, pt) @@ -2590,7 +2596,17 @@ trait Typers extends Modes with Adaptations with Tags { def translated = if (members.head eq EmptyTree) setError(tree) - else typed(atPos(tree.pos)(Block(List(ClassDef(anonClass, NoMods, ListOfNil, ListOfNil, members, tree.pos.focus)), atPos(tree.pos.focus)(New(anonClass.tpe)))), mode, pt) + else { + val typedBlock = typedPos(tree.pos, mode, pt) { + Block(ClassDef(anonClass, NoMods, ListOfNil, ListOfNil, members, tree.pos.focus), atPos(tree.pos.focus)(New(anonClass.tpe))) + } + // Don't leak implementation details into the type, see SI-6575 + if (isPartial && !typedBlock.isErrorTyped) + typedPos(tree.pos, mode, pt) { + Typed(typedBlock, TypeTree(typedBlock.tpe baseType PartialFunctionClass)) + } + else typedBlock + } } // Function(params, Match(sel, cases)) ==> new <Partial>Function { def apply<OrElse>(params) = `translateMatch('sel match { cases }')` } @@ -5494,6 +5510,7 @@ trait Typers extends Modes with Adaptations with Tags { ret } + def typedPos(pos: Position, mode: Int, pt: Type)(tree: Tree) = typed(atPos(pos)(tree), mode, pt) def typedPos(pos: Position)(tree: Tree) = typed(atPos(pos)(tree)) // TODO: see if this formulation would impose any penalty, since // it makes for a lot less casting. diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala index 54a0079f40..4482bf2b7c 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala @@ -193,12 +193,12 @@ abstract class SelectiveCPSTransform extends PluginComponent with val pos = catches.head.pos val funSym = currentOwner.newValueParameter(cpsNames.catches, pos).setInfo(appliedType(PartialFunctionClass.tpe, List(ThrowableClass.tpe, targettp))) - val funDef = localTyper.typed(atPos(pos) { + val funDef = localTyper.typedPos(pos) { ValDef(funSym, Match(EmptyTree, catches1)) - }) - val expr2 = localTyper.typed(atPos(pos) { + } + val expr2 = localTyper.typedPos(pos) { Apply(Select(expr1, expr1.tpe.member(cpsNames.flatMapCatch)), List(Ident(funSym))) - }) + } val exSym = currentOwner.newValueParameter(cpsNames.ex, pos).setInfo(ThrowableClass.tpe) @@ -223,7 +223,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with val pos = finalizer.pos val finalizer2 = duplicateTree(finalizer1) val fun = Function(List(), finalizer2) - val expr3 = localTyper.typed(atPos(pos) { Apply(Select(expr2, expr2.tpe.member("mapFinally")), List(fun)) }) + val expr3 = localTyper.typedPos(pos) { Apply(Select(expr2, expr2.tpe.member("mapFinally")), List(fun)) } val chown = new ChangeOwnerTraverser(currentOwner, fun.symbol) chown.traverse(finalizer2) @@ -290,7 +290,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with val body1 = (new TreeSymSubstituter(List(vd.symbol), List(ctxValSym)))(body) - val body2 = localTyper.typed(atPos(vd.symbol.pos) { body1 }) + val body2 = localTyper.typedPos(vd.symbol.pos) { body1 } // in theory it would be nicer to look for an @cps annotation instead // of testing for Context @@ -304,7 +304,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with def applyCombinatorFun(ctxR: Tree, body: Tree) = { val arg = currentOwner.newValueParameter(name, ctxR.pos).setInfo(tpe) val body1 = (new TreeSymSubstituter(List(vd.symbol), List(arg)))(body) - val fun = localTyper.typed(atPos(vd.symbol.pos) { Function(List(ValDef(arg)), body1) }) // types body as well + val fun = localTyper.typedPos(vd.symbol.pos) { Function(List(ValDef(arg)), body1) } // types body as well arg.owner = fun.symbol body1.changeOwner(currentOwner -> fun.symbol) @@ -328,9 +328,9 @@ abstract class SelectiveCPSTransform extends PluginComponent with debuglog("will use method:"+methodName) - localTyper.typed(atPos(vd.symbol.pos) { + localTyper.typedPos(vd.symbol.pos) { Apply(Select(ctxR, ctxR.tpe.member(methodName)), List(fun)) - }) + } } def mkBlock(stms: List[Tree], expr: Tree) = if (stms.nonEmpty) Block(stms, expr) else expr @@ -352,12 +352,12 @@ abstract class SelectiveCPSTransform extends PluginComponent with def ctxRef = localTyper.typed(Ident(ctxSym)) val argSym = currentOwner.newValue(vd.symbol.name).setInfo(tpe) val argDef = localTyper.typed(ValDef(argSym, Select(ctxRef, ctxRef.tpe.member(cpsNames.getTrivialValue)))) - val switchExpr = localTyper.typed(atPos(vd.symbol.pos) { + val switchExpr = localTyper.typedPos(vd.symbol.pos) { val body2 = mkBlock(bodyStms, bodyExpr).duplicate // dup before typing! If(Select(ctxRef, ctxSym.tpe.member(cpsNames.isTrivial)), applyTrivial(argSym, mkBlock(argDef::bodyStms, bodyExpr)), applyCombinatorFun(ctxRef, body2)) - }) + } (List(ctxDef), switchExpr) } else { // ctx.flatMap { <lhs> => ... } diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 959d682872..99ffbb5905 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -325,16 +325,6 @@ class PartestTask extends Task with CompilationPathProperty { } } getOrElse sys.error("Provided classpath does not contain a Scala actors.") - val scalaActorsMigration = { - (classpath.list map { fs => new File(fs) }) find { f => - f.getName match { - case "scala-actors-migration.jar" => true - case "actors-migration" if (f.getParentFile.getName == "classes") => true - case _ => false - } - } - } getOrElse sys.error("Provided classpath does not contain a Scala actors.") - def scalacArgsFlat: Option[Seq[String]] = scalacArgs map (_ flatMap { a => val parts = a.getParts if(parts eq null) Seq[String]() else parts.toSeq @@ -362,7 +352,6 @@ class PartestTask extends Task with CompilationPathProperty { antFileManager.LATEST_COMP = scalaCompiler.getAbsolutePath antFileManager.LATEST_PARTEST = scalaPartest.getAbsolutePath antFileManager.LATEST_ACTORS = scalaActors.getAbsolutePath - antFileManager.LATEST_ACTORS_MIGRATION = scalaActorsMigration.getAbsolutePath javacmd foreach (x => antFileManager.JAVACMD = x.getAbsolutePath) javaccmd foreach (x => antFileManager.JAVAC_CMD = x.getAbsolutePath) diff --git a/src/partest/scala/tools/partest/nest/AntRunner.scala b/src/partest/scala/tools/partest/nest/AntRunner.scala index ee644c5315..8c2d7029ba 100644 --- a/src/partest/scala/tools/partest/nest/AntRunner.scala +++ b/src/partest/scala/tools/partest/nest/AntRunner.scala @@ -24,7 +24,6 @@ class AntRunner extends DirectRunner { var LATEST_COMP: String = _ var LATEST_PARTEST: String = _ var LATEST_ACTORS: String = _ - var LATEST_ACTORS_MIGRATION: String = _ val testRootPath: String = "test" val testRootDir: Directory = Directory(testRootPath) } diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala index 32f14872ec..442c0e8427 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala @@ -84,7 +84,6 @@ class ConsoleFileManager extends FileManager { latestFile = testClassesDir.parent / "bin" latestLibFile = testClassesDir / "library" latestActorsFile = testClassesDir / "library" / "actors" - latestActMigFile = testClassesDir / "actors-migration" latestReflectFile = testClassesDir / "reflect" latestCompFile = testClassesDir / "compiler" latestPartestFile = testClassesDir / "partest" @@ -96,7 +95,6 @@ class ConsoleFileManager extends FileManager { latestFile = dir / "bin" latestLibFile = dir / "lib/scala-library.jar" latestActorsFile = dir / "lib/scala-actors.jar" - latestActMigFile = dir / "lib/scala-actors-migration.jar" latestReflectFile = dir / "lib/scala-reflect.jar" latestCompFile = dir / "lib/scala-compiler.jar" latestPartestFile = dir / "lib/scala-partest.jar" @@ -108,7 +106,6 @@ class ConsoleFileManager extends FileManager { latestFile = prefixFile("build/quick/bin") latestLibFile = prefixFile("build/quick/classes/library") latestActorsFile = prefixFile("build/quick/classes/library/actors") - latestActMigFile = prefixFile("build/quick/classes/actors-migration") latestReflectFile = prefixFile("build/quick/classes/reflect") latestCompFile = prefixFile("build/quick/classes/compiler") latestPartestFile = prefixFile("build/quick/classes/partest") @@ -120,7 +117,6 @@ class ConsoleFileManager extends FileManager { latestFile = prefixFileWith(p, "bin") latestLibFile = prefixFileWith(p, "lib/scala-library.jar") latestActorsFile = prefixFileWith(p, "lib/scala-actors.jar") - latestActMigFile = prefixFileWith(p, "lib/scala-actors-migration.jar") latestReflectFile = prefixFileWith(p, "lib/scala-reflect.jar") latestCompFile = prefixFileWith(p, "lib/scala-compiler.jar") latestPartestFile = prefixFileWith(p, "lib/scala-partest.jar") @@ -131,7 +127,6 @@ class ConsoleFileManager extends FileManager { latestFile = prefixFile("dists/latest/bin") latestLibFile = prefixFile("dists/latest/lib/scala-library.jar") latestActorsFile = prefixFile("dists/latest/lib/scala-actors.jar") - latestActMigFile = prefixFile("dists/latest/lib/scala-actors-migration.jar") latestReflectFile = prefixFile("dists/latest/lib/scala-reflect.jar") latestCompFile = prefixFile("dists/latest/lib/scala-compiler.jar") latestPartestFile = prefixFile("dists/latest/lib/scala-partest.jar") @@ -142,7 +137,6 @@ class ConsoleFileManager extends FileManager { latestFile = prefixFile("build/pack/bin") latestLibFile = prefixFile("build/pack/lib/scala-library.jar") latestActorsFile = prefixFile("build/pack/lib/scala-actors.jar") - latestActMigFile = prefixFile("build/pack/lib/scala-actors-migration.jar") latestReflectFile = prefixFile("build/pack/lib/scala-reflect.jar") latestCompFile = prefixFile("build/pack/lib/scala-compiler.jar") latestPartestFile = prefixFile("build/pack/lib/scala-partest.jar") @@ -180,7 +174,6 @@ class ConsoleFileManager extends FileManager { LATEST_COMP = latestCompFile.getAbsolutePath LATEST_PARTEST = latestPartestFile.getAbsolutePath LATEST_ACTORS = latestActorsFile.getAbsolutePath - LATEST_ACTORS_MIGRATION = latestActMigFile.getAbsolutePath } var LATEST_LIB: String = "" @@ -188,12 +181,10 @@ class ConsoleFileManager extends FileManager { var LATEST_COMP: String = "" var LATEST_PARTEST: String = "" var LATEST_ACTORS: String = "" - var LATEST_ACTORS_MIGRATION: String = "" var latestFile: File = _ var latestLibFile: File = _ var latestActorsFile: File = _ - var latestActMigFile: File = _ var latestReflectFile: File = _ var latestCompFile: File = _ var latestPartestFile: File = _ diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala index a890a57f14..0f926ee69e 100644 --- a/src/partest/scala/tools/partest/nest/DirectRunner.scala +++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala @@ -49,10 +49,9 @@ trait DirectRunner { val latestLibFile = new File(fileManager.LATEST_LIB) val latestPartestFile = new File(fileManager.LATEST_PARTEST) val latestActorsFile = new File(fileManager.LATEST_ACTORS) - val latestActMigFile = new File(fileManager.LATEST_ACTORS_MIGRATION) val scalacheckURL = PathSettings.scalaCheck.toURL val scalaCheckParentClassLoader = ScalaClassLoader.fromURLs( - scalacheckURL :: (List(latestCompFile, latestReflectFile, latestLibFile, latestActorsFile, latestActMigFile, latestPartestFile).map(_.toURI.toURL)) + scalacheckURL :: (List(latestCompFile, latestReflectFile, latestLibFile, latestActorsFile, latestPartestFile).map(_.toURI.toURL)) ) val kindFiles = onlyValidTestPaths(_kindFiles) diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala index 512c718040..b6d89177ca 100644 --- a/src/partest/scala/tools/partest/nest/FileManager.scala +++ b/src/partest/scala/tools/partest/nest/FileManager.scala @@ -64,7 +64,6 @@ trait FileManager extends FileUtil { var LATEST_COMP: String var LATEST_PARTEST: String var LATEST_ACTORS: String - var LATEST_ACTORS_MIGRATION: String var showDiff = false var updateCheck = false diff --git a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala index 838bf56d73..99043d8f95 100644 --- a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala +++ b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala @@ -48,9 +48,9 @@ class ReflectiveRunner { new ConsoleFileManager import fileManager. - { latestCompFile, latestReflectFile, latestLibFile, latestPartestFile, latestFjbgFile, latestScalapFile, latestActorsFile, latestActMigFile } + { latestCompFile, latestReflectFile, latestLibFile, latestPartestFile, latestFjbgFile, latestScalapFile, latestActorsFile } val files = - Array(latestCompFile, latestReflectFile, latestLibFile, latestPartestFile, latestFjbgFile, latestScalapFile, latestActorsFile, latestActMigFile) map (x => io.File(x)) + Array(latestCompFile, latestReflectFile, latestLibFile, latestPartestFile, latestFjbgFile, latestScalapFile, latestActorsFile) map (x => io.File(x)) val sepUrls = files map (_.toURL) var sepLoader = new URLClassLoader(sepUrls, null) diff --git a/src/partest/scala/tools/partest/nest/SBTRunner.scala b/src/partest/scala/tools/partest/nest/SBTRunner.scala index 206ee19c76..b0ce6579ac 100644 --- a/src/partest/scala/tools/partest/nest/SBTRunner.scala +++ b/src/partest/scala/tools/partest/nest/SBTRunner.scala @@ -17,7 +17,6 @@ object SBTRunner extends DirectRunner { var LATEST_COMP: String = _ var LATEST_PARTEST: String = _ var LATEST_ACTORS: String = _ - var LATEST_ACTORS_MIGRATION: String = _ val testRootPath: String = "test" val testRootDir: Directory = Directory(testRootPath) } @@ -61,7 +60,6 @@ object SBTRunner extends DirectRunner { fileManager.LATEST_COMP = findClasspath("scala-compiler", "scala-compiler") getOrElse sys.error("No scala-compiler found! Classpath = " + fileManager.CLASSPATH) fileManager.LATEST_PARTEST = findClasspath("scala-partest", "partest") getOrElse sys.error("No scala-partest found! Classpath = " + fileManager.CLASSPATH) fileManager.LATEST_ACTORS = findClasspath("scala-actors", "actors") getOrElse sys.error("No scala-actors found! Classpath = " + fileManager.CLASSPATH) - fileManager.LATEST_ACTORS_MIGRATION = findClasspath("scala-actors-migration", "actors-migration") getOrElse sys.error("No scala-actors-migration found! Classpath = " + fileManager.CLASSPATH) // TODO - Do something useful here!!! fileManager.JAVAC_CMD = "javac" |