From e5673f742619ff095810ba7d9073aba10c922117 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Sun, 16 Dec 2012 20:30:30 +0100
Subject: [PATCH] Silence boring Eclipse warnings: catching all exceptions
Here I make explicit where catching all exceptions is intended.
Mark Harrah corrected one decision during review.
---
util/collection/src/test/scala/SettingsTest.scala | 2 +-
util/control/src/main/scala/sbt/ErrorHandling.scala | 2 +-
util/log/src/main/scala/sbt/BufferedLogger.scala | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/util/collection/src/test/scala/SettingsTest.scala b/util/collection/src/test/scala/SettingsTest.scala
index f4796b76c..9ff703526 100644
--- a/util/collection/src/test/scala/SettingsTest.scala
+++ b/util/collection/src/test/scala/SettingsTest.scala
@@ -82,7 +82,7 @@ object SettingsTest extends Properties("settings")
def evaluate(settings: Seq[Setting[_]]): Settings[Scope] =
try { make(settings)(delegates, scopeLocal, showFullKey) }
- catch { case e => e.printStackTrace; throw e }
+ catch { case e: Throwable => e.printStackTrace; throw e }
}
// This setup is a workaround for module synchronization issues
final class CCR(intermediate: Int)
diff --git a/util/control/src/main/scala/sbt/ErrorHandling.scala b/util/control/src/main/scala/sbt/ErrorHandling.scala
index a1ba760f3..b6e616ae3 100644
--- a/util/control/src/main/scala/sbt/ErrorHandling.scala
+++ b/util/control/src/main/scala/sbt/ErrorHandling.scala
@@ -20,7 +20,7 @@ object ErrorHandling
{
case ex @ (_: Exception | _: StackOverflowError) => Left(ex)
case err @ (_: ThreadDeath | _: VirtualMachineError) => throw err
- case x => Left(x)
+ case x: Throwable => Left(x)
}
def convert[T](f: => T): Either[Exception, T] =
diff --git a/util/log/src/main/scala/sbt/BufferedLogger.scala b/util/log/src/main/scala/sbt/BufferedLogger.scala
index 2e04b81f2..0b9d7a593 100644
--- a/util/log/src/main/scala/sbt/BufferedLogger.scala
+++ b/util/log/src/main/scala/sbt/BufferedLogger.scala
@@ -33,7 +33,7 @@ class BufferedLogger(delegate: AbstractLogger) extends BasicLogger
clear()
result
}
- catch { case e => stopQuietly(); throw e }
+ catch { case e: Throwable => stopQuietly(); throw e }
}
def stopQuietly() = synchronized { try { stop() } catch { case e: Exception => () } }