diff --git a/zinc-lm-integration/src/main/scala/sbt/internal/inc/ResourceLoader.scala b/zinc-lm-integration/src/main/scala/sbt/internal/inc/ResourceLoader.scala index c95090c25..28870550b 100644 --- a/zinc-lm-integration/src/main/scala/sbt/internal/inc/ResourceLoader.scala +++ b/zinc-lm-integration/src/main/scala/sbt/internal/inc/ResourceLoader.scala @@ -14,14 +14,20 @@ private[inc] object ResourceLoader { def getPropertiesFor(resource: String, classLoader: ClassLoader): Properties = { val properties = new java.util.Properties val propertiesStream = getClass.getResource(resource).openStream - try { properties.load(propertiesStream) } finally { propertiesStream.close() } + try { + properties.load(propertiesStream) + } finally { + propertiesStream.close() + } properties } def getSafePropertiesFor(resource: String, classLoader: ClassLoader): Properties = { val properties = new Properties val propertiesStream = classLoader.getResourceAsStream(resource) - try { properties.load(propertiesStream) } catch { case _: Exception => } finally { + try { + properties.load(propertiesStream) + } catch { case _: Exception => } finally { if (propertiesStream ne null) propertiesStream.close() } properties diff --git a/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentManager.scala b/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentManager.scala index 2477ccb21..e0d106545 100644 --- a/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentManager.scala +++ b/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentManager.scala @@ -122,7 +122,11 @@ object ZincComponentManager { lazy val (version, timestamp) = { val properties = new java.util.Properties val propertiesStream = versionResource.openStream - try { properties.load(propertiesStream) } finally { propertiesStream.close() } + try { + properties.load(propertiesStream) + } finally { + propertiesStream.close() + } (properties.getProperty("version"), properties.getProperty("timestamp")) } lazy val stampedVersion = version + "_" + timestamp