Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hudson-core/pom.xml4
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java7
2 files changed, 8 insertions, 3 deletions
diff --git a/hudson-core/pom.xml b/hudson-core/pom.xml
index 67d83705..b824f677 100644
--- a/hudson-core/pom.xml
+++ b/hudson-core/pom.xml
@@ -36,8 +36,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
- <source>1.7</source>
- <target>1.7</target>
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
<executions>
<execution>
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
index 10b4f471..47ff434c 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
@@ -45,6 +45,7 @@ import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
import org.eclipse.hudson.WebAppController;
import org.eclipse.hudson.plugins.InstalledPluginManager;
import org.eclipse.hudson.plugins.InstalledPluginManager.InstalledPluginInfo;
@@ -536,9 +537,13 @@ final public class InitialSetup {
File localCacheFile = new File(hudsonHomeDir, "updates/default.json");
if (!localCacheFile.exists() || (localCacheFile.lastModified() < lastModified)) {
+ InputStream urlStream = null;
String jsonStr = null;
- try (InputStream urlStream = updateCenterJsonUrl.openStream()) {
+ try {
+ urlStream = updateCenterJsonUrl.openStream();
jsonStr = org.apache.commons.io.IOUtils.toString(urlStream);
+ } finally {
+ IOUtils.closeQuietly(urlStream);
}
jsonStr = jsonStr.trim();
if (jsonStr.startsWith("updateCenter.post(")) {

Back to the top