summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-06-08 14:35:16 +0000
committerPaul Phillips <paulp@improving.org>2010-06-08 14:35:16 +0000
commit905c3126ac81249f25a4a3f1e69c7532e7f3f1c9 (patch)
treec99fbb2ef0817a6c7193864ce4dc90d428eb5d8e
parentd112ec1f8878b02094b68ebe849dbc8831a9c0d9 (diff)
downloadscala-905c3126ac81249f25a4a3f1e69c7532e7f3f1c9.tar.gz
scala-905c3126ac81249f25a4a3f1e69c7532e7f3f1c9.tar.bz2
scala-905c3126ac81249f25a4a3f1e69c7532e7f3f1c9.zip
Fixed a regrettable oversight which was leaving...
Fixed a regrettable oversight which was leaving temp files stacking up in templand, and a partial fix for #3519. No review.
-rw-r--r--src/compiler/scala/tools/nsc/io/File.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/io/File.scala b/src/compiler/scala/tools/nsc/io/File.scala
index d8e1410375..e9741ed5cb 100644
--- a/src/compiler/scala/tools/nsc/io/File.scala
+++ b/src/compiler/scala/tools/nsc/io/File.scala
@@ -33,13 +33,18 @@ object File {
// this is a workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6503430
// we are using a static initializer to statically initialize a java class so we don't
- // trigger java.lang.InternalErrors later when using it concurrently.
- {
+ // trigger java.lang.InternalErrors later when using it concurrently. We ignore all
+ // the exceptions so as not to cause spurious failures when no write access is available,
+ // e.g. google app engine.
+ try {
val tmp = JFile.createTempFile("bug6503430", null, null)
val in = new FileInputStream(tmp).getChannel()
val out = new FileOutputStream(tmp, true).getChannel()
out.transferFrom(in, 0, 0)
- ()
+ tmp.delete()
+ }
+ catch {
+ case _: IllegalArgumentException | _: IllegalStateException | _: IOException | _: SecurityException => ()
}
}
import File._