diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-07-13 14:24:26 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-07-13 14:24:26 +0000 |
commit | 5e3e15d1ddb012af2dec7df468c7c63a497f5cec (patch) | |
tree | b56d31716c98cca09a5aaac891ca496b50c9307c /src | |
parent | 0b09e1d2e42c741a86668296b8b2e269dfad68cf (diff) | |
download | scala-5e3e15d1ddb012af2dec7df468c7c63a497f5cec.tar.gz scala-5e3e15d1ddb012af2dec7df468c7c63a497f5cec.tar.bz2 scala-5e3e15d1ddb012af2dec7df468c7c63a497f5cec.zip |
moved deleteRecursively out of class Interprete...
moved deleteRecursively out of class Interpreter and into a utility
object
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index d01906ad69..30d71d438f 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -220,7 +220,6 @@ class Interpreter(val settings: Settings, reporter: Reporter, out: PrintWriter) null } } - } /** interpret one line of input. All feedback, including parse errors @@ -317,17 +316,6 @@ class Interpreter(val settings: Settings, reporter: Reporter, out: PrintWriter) interpret("val " + name + " = " + binderName + ".value") } - /** Delete a directory tree recursively. Use with care! */ - private def deleteRecursively(path: File): Unit = { - path match { - case _ if(!path.exists) => () - case _ if(path.isDirectory) => - for(val p <- path.listFiles) - deleteRecursively(p) - path.delete - case _ => path.delete - } - } /** This instance is no longer needed, so release any resources it is using. @@ -337,7 +325,7 @@ class Interpreter(val settings: Settings, reporter: Reporter, out: PrintWriter) are executed becaus of Java's demand loading. */ def close: Unit = { - deleteRecursively(classfilePath) + Interpreter.deleteRecursively(classfilePath) } /** A traverser that finds all mentioned identifiers, i.e. things @@ -618,3 +606,17 @@ class Interpreter(val settings: Settings, reporter: Reporter, out: PrintWriter) } } } + +object Interpreter { + /** Delete a directory tree recursively. Use with care! */ + def deleteRecursively(path: File): Unit = { + path match { + case _ if(!path.exists) => () + case _ if(path.isDirectory) => + for(val p <- path.listFiles) + deleteRecursively(p) + path.delete + case _ => path.delete + } + } +} |