summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-10 17:26:50 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-10 17:26:50 +0000
commitc141a84b496f6317f7fee6c18ccdd2c3ce294dfb (patch)
treeff51cdd6f7e119560dee1b0f7921c4efc491b00a
parent20af4df51a6393718744c20131db8fca6a938c44 (diff)
downloadscala-c141a84b496f6317f7fee6c18ccdd2c3ce294dfb.tar.gz
scala-c141a84b496f6317f7fee6c18ccdd2c3ce294dfb.tar.bz2
scala-c141a84b496f6317f7fee6c18ccdd2c3ce294dfb.zip
Corrected a bug when entering an empty string f...
Corrected a bug when entering an empty string for the check, stop or skip attribute.
-rw-r--r--sources/scala/tools/nsc/ant/NSC.scala19
1 files changed, 10 insertions, 9 deletions
diff --git a/sources/scala/tools/nsc/ant/NSC.scala b/sources/scala/tools/nsc/ant/NSC.scala
index 8dbac4fa5c..4f7bd6969e 100644
--- a/sources/scala/tools/nsc/ant/NSC.scala
+++ b/sources/scala/tools/nsc/ant/NSC.scala
@@ -398,9 +398,10 @@ package scala.tools.nsc.ant {
* @param input The value for <code>force</code>.
*/
def setStop (input: String) = {
- if (CompilerPhase.isPermissible(input))
- stop = Some(input);
- else error("Phase '" + input + "' in stop does not exist.");
+ if (CompilerPhase.isPermissible(input)) {
+ if (input != "")
+ stop = Some(input);
+ } else error("Phase '" + input + "' in stop does not exist.");
}
/**
@@ -408,10 +409,10 @@ package scala.tools.nsc.ant {
* @param input The value for <code>force</code>.
*/
def setSkip (input: String) = {
- skip = List.fromArray(input.split(",")).map(s:String=>{
+ skip = List.fromArray(input.split(",")).flatMap(s:String=>{
val st = s.trim();
- if (CompilerPhase.isPermissible(st)) st
- else {error("Phase '" + st + "' in skip does not exist."); ""}
+ if (CompilerPhase.isPermissible(st)) (if (input != "") List(st) else Nil)
+ else {error("Phase '" + st + "' in skip does not exist."); Nil}
});
}
@@ -420,10 +421,10 @@ package scala.tools.nsc.ant {
* @param input The value for <code>force</code>.
*/
def setCheck (input: String) = {
- check = List.fromArray(input.split(",")).map(s:String=>{
+ check = List.fromArray(input.split(",")).flatMap(s:String=>{
val st = s.trim();
- if (CompilerPhase.isPermissible(st)) st
- else {error("Phase " + st + " in check does not exist."); ""}
+ if (CompilerPhase.isPermissible(st)) (if (input != "") List(st) else Nil)
+ else {error("Phase " + st + " in check does not exist."); Nil}
});
}