From 04197db2ecd9a3a706caf08435f9356e7ddfa1d4 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 28 Apr 2019 17:27:24 -0400 Subject: [PATCH] formatting --- .../main/scala/sbt/internal/inc/ResourceLoader.scala | 10 ++++++++-- .../scala/sbt/internal/inc/ZincComponentManager.scala | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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