summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-22 00:16:03 +0000
committerPaul Phillips <paulp@improving.org>2010-02-22 00:16:03 +0000
commit6e061d6f2597a3e4bdc7fcf192abbdb419917b70 (patch)
treea1ec1f729ad5f548c4a18cdd4647bc6d0b181380
parent91cdb1531656d9240e9ee64509ab528d727d1b51 (diff)
downloadscala-6e061d6f2597a3e4bdc7fcf192abbdb419917b70.tar.gz
scala-6e061d6f2597a3e4bdc7fcf192abbdb419917b70.tar.bz2
scala-6e061d6f2597a3e4bdc7fcf192abbdb419917b70.zip
Some deprecation patrol and minor cleanups.
-rw-r--r--src/actors/scala/actors/Reaction.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala6
-rw-r--r--src/partest/scala/tools/partest/nest/DirectRunner.scala8
-rw-r--r--src/partest/scala/tools/partest/nest/FileManager.scala9
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala2
-rw-r--r--test/files/pos/bug432.scala2
-rw-r--r--test/files/run/iterators.scala4
-rw-r--r--test/files/run/lists.scala4
-rwxr-xr-xtools/truncate (renamed from truncate)0
9 files changed, 16 insertions, 21 deletions
diff --git a/src/actors/scala/actors/Reaction.scala b/src/actors/scala/actors/Reaction.scala
index 65584880f7..a8364bc8fb 100644
--- a/src/actors/scala/actors/Reaction.scala
+++ b/src/actors/scala/actors/Reaction.scala
@@ -25,7 +25,7 @@ private[actors] class KillActorException extends Throwable with ControlException
*
* @author Philipp Haller
*/
-@deprecated
+@deprecated("This class will be removed in a future release")
class Reaction(a: Actor, f: PartialFunction[Any, Any], msg: Any) extends ActorTask(a, () => {
if (f == null)
a.act()
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 8f11d26b8a..bcc58ec448 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -111,9 +111,9 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
(from.hasFlag(Flags.MODULE) == to.hasFlag(Flags.MODULE))
// For testing purposes only, order irrelevant for compilation
- def toStringSet(set: Set[AbstractFile]): String = {
- val s = (set.toList).sort(_.name < _.name)
- s.mkString("Set(", ", ", ")")
+ def toStringSet(set: Set[AbstractFile]): String = {
+ val s = set.toList sortBy (_.name)
+ s.mkString("Set(", ", ", ")")
}
def update0(files: Set[AbstractFile]): Unit = if (!files.isEmpty) {
diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala
index 0853a9a84b..3778a927df 100644
--- a/src/partest/scala/tools/partest/nest/DirectRunner.scala
+++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala
@@ -57,13 +57,13 @@ trait DirectRunner {
workers foreach { w =>
receiveWithin(3600 * 1000) {
case Results(res, logs, outdirs) =>
- logsToDelete = logsToDelete ::: logs.filter(_.toDelete)
- outdirsToDelete = outdirsToDelete ::: outdirs
- results = results ++ res
+ logsToDelete :::= logs filter (_.toDelete)
+ outdirsToDelete :::= outdirs
+ results ++= res
case TIMEOUT =>
// add at least one failure
NestUI.verbose("worker timed out; adding failed test")
- results = results + ("worker timed out; adding failed test" -> 2)
+ results += ("worker timed out; adding failed test" -> 2)
}
}
if (!isPartestDebug) {
diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala
index df7a8e129c..ffeba6bbe3 100644
--- a/src/partest/scala/tools/partest/nest/FileManager.scala
+++ b/src/partest/scala/tools/partest/nest/FileManager.scala
@@ -12,16 +12,11 @@ import java.io.{File, FilenameFilter, IOException, StringWriter,
FileInputStream, FileOutputStream, BufferedReader,
FileReader, PrintWriter, FileWriter}
import java.net.URI
-import scala.tools.nsc.io.Directory
+import scala.tools.nsc.io.{ Path, Directory }
trait FileManager {
- def basename(name: String): String = {
- val inx = name.lastIndexOf(".")
- if (inx < 0) name else name.substring(0, inx)
- }
-
- def deleteRecursive(dir: File) { Directory(dir).deleteRecursively() }
+ def basename(name: String): String = Path(name).stripExtension
/**
* Compares two files using a Java implementation of the GNU diff
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index 9d990ef1ac..7a947b3298 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -973,7 +973,7 @@ class Worker(val fileManager: FileManager) extends Actor {
try {
// delete log file only if test was successful
- if (good && !logFile.isEmpty)
+ if (good && !logFile.isEmpty && !isPartestDebug)
logFile.get.toDelete = true
writers match {
diff --git a/test/files/pos/bug432.scala b/test/files/pos/bug432.scala
index 8e3097ac9d..087fd70aba 100644
--- a/test/files/pos/bug432.scala
+++ b/test/files/pos/bug432.scala
@@ -1,2 +1,2 @@
-case class Tata
+case class Tata()
object Tata
diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala
index 5879d38df3..b7dc16237a 100644
--- a/test/files/run/iterators.scala
+++ b/test/files/run/iterators.scala
@@ -93,8 +93,8 @@ object Test {
}
def check_findIndexOf: String = {
- val i = List(1, 2, 3, 4, 5).findIndexOf { x: Int => x >= 4 }
- val j = List(1, 2, 3, 4, 5).findIndexOf { x: Int => x >= 16 }
+ val i = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 4 }
+ val j = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 16 }
"" + i + "x" + j
}
diff --git a/test/files/run/lists.scala b/test/files/run/lists.scala
index 695d5a0336..6c9b55961e 100644
--- a/test/files/run/lists.scala
+++ b/test/files/run/lists.scala
@@ -126,8 +126,8 @@ object Test1 extends TestCase("ctor") with Assert {
assertEquals("check_forall", true, b1 & b2)
}
{
- val ys1 = xs1 remove { e => e % 2 != 0 }
- val ys2 = xs4 remove { e => e < 5 }
+ val ys1 = xs1 filterNot { e => e % 2 != 0 }
+ val ys2 = xs4 filterNot { e => e < 5 }
assertEquals("check_remove", 3, ys1.length + ys2.length)
}
{
diff --git a/truncate b/tools/truncate
index b7f410e25d..b7f410e25d 100755
--- a/truncate
+++ b/tools/truncate