summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2009-11-05 16:51:35 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2009-11-05 16:51:35 +0000
commit679d4590d96b896d24c7ae75ef1afdab02c78c31 (patch)
treeb606a2a749982e772dc374a6df3bf0e2c57cfa9f /src/compiler
parent74ffca5b102553f990b233a53445f6368205a184 (diff)
downloadscala-679d4590d96b896d24c7ae75ef1afdab02c78c31.tar.gz
scala-679d4590d96b896d24c7ae75ef1afdab02c78c31.tar.bz2
scala-679d4590d96b896d24c7ae75ef1afdab02c78c31.zip
BuildManagerTest no longer throws npe when some...
BuildManagerTest no longer throws npe when some of the files do not exist
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/BuildManager.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
index c269c0eace..e56bfec433 100644
--- a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
@@ -56,8 +56,16 @@ object BuildManagerTest extends EvalLoop {
}
def main(args: Array[String]) {
- implicit def filesToSet(fs: List[String]): Set[AbstractFile] =
- Set.empty ++ (fs map AbstractFile.getFile)
+ implicit def filesToSet(fs: List[String]): Set[AbstractFile] = {
+ def partition(s: String, r: Tuple2[List[AbstractFile], List[String]])= {
+ val v = AbstractFile.getFile(s)
+ if (v == null) (r._1, s::r._2) else (v::r._1, r._2)
+ }
+ val result = fs.foldRight((List[AbstractFile](), List[String]()))(partition)
+ if (!result._2.isEmpty)
+ println("No such file(s): " + result._2.mkString(","))
+ Set.empty ++ result._1
+ }
val settings = new Settings(error)
val command = new CompilerCommand(args.toList, settings, error, false)