Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Foster2015-07-15 20:00:30 -0400
committerBob Foster2015-07-15 20:00:30 -0400
commit9492d4dca1570000f25e3f23fe0bce6f75e70a75 (patch)
treef9816dede4b249e0dcd32d91388d4b45ce3f46d9
parentf190e6474527fbf68ce21c9891a4ec5036462f5c (diff)
downloadorg.eclipse.hudson.core-9492d4dca1570000f25e3f23fe0bce6f75e70a75.tar.gz
org.eclipse.hudson.core-9492d4dca1570000f25e3f23fe0bce6f75e70a75.tar.xz
org.eclipse.hudson.core-9492d4dca1570000f25e3f23fe0bce6f75e70a75.zip
Compile with 1.7, use try-with-resource to close stream
-rw-r--r--hudson-core/nb-configuration.xml14
-rw-r--r--hudson-core/pom.xml28
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java6
3 files changed, 33 insertions, 15 deletions
diff --git a/hudson-core/nb-configuration.xml b/hudson-core/nb-configuration.xml
index 101e0a7a..e86240f3 100644
--- a/hudson-core/nb-configuration.xml
+++ b/hudson-core/nb-configuration.xml
@@ -15,5 +15,19 @@ Any value defined here will override the pom.xml file value but is only applicab
-->
<netbeans.compile.on.save>all</netbeans.compile.on.save>
<netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.continuationIndentSize>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.continuationIndentSize>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>
+ <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
+ <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>
+ <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
</properties>
</project-shared-configuration>
diff --git a/hudson-core/pom.xml b/hudson-core/pom.xml
index 7c8b282a..67d83705 100644
--- a/hudson-core/pom.xml
+++ b/hudson-core/pom.xml
@@ -10,7 +10,7 @@
# Contributors:
#
# Kohsuke Kawaguchi, Winston Prakash
-#
+#
#************************************************************************** -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -36,8 +36,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
<executions>
<execution>
@@ -391,7 +391,7 @@
<dependency>
<groupId>org.jvnet.localizer</groupId>
<artifactId>localizer</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
@@ -406,8 +406,8 @@
</exclusion>
</exclusions>
</dependency>
-
-
+
+
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
@@ -444,7 +444,7 @@
</exclusion>
</exclusions>
</dependency>
-
+
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-digester3</artifactId>
@@ -470,7 +470,7 @@
<artifactId>mail</artifactId>
<version>${javax-mail.version}</version>
</dependency>
-
+
<!-- Switch to xercesImpl 2.8.1 - Eclipse approved -->
<dependency>
<groupId>xerces</groupId>
@@ -599,7 +599,7 @@
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
@@ -615,13 +615,13 @@
<artifactId>spring-security-config</artifactId>
<version>${spring-security.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>
<version>${spring-security.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
@@ -643,12 +643,12 @@
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
-
+
<dependency>
<groupId>${guava.groupid}</groupId>
<artifactId>guava</artifactId>
</dependency>
-
+
<!--
| these are now optional in commons-logging:1.1.1,
| keeping them around in case any plugins use them
@@ -691,7 +691,7 @@
<artifactId>xpp3</artifactId>
<version>${xpp3.version}</version>
</dependency>
-
+
<dependency>
<artifactId>xmlpull</artifactId>
<groupId>xmlpull</groupId>
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 6a9bbe0a..10b4f471 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
@@ -26,6 +26,7 @@ import hudson.util.HudsonIsLoading;
import hudson.util.VersionNumber;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
@@ -535,7 +536,10 @@ final public class InitialSetup {
File localCacheFile = new File(hudsonHomeDir, "updates/default.json");
if (!localCacheFile.exists() || (localCacheFile.lastModified() < lastModified)) {
- String jsonStr = org.apache.commons.io.IOUtils.toString(updateCenterJsonUrl.openStream());
+ String jsonStr = null;
+ try (InputStream urlStream = updateCenterJsonUrl.openStream()) {
+ jsonStr = org.apache.commons.io.IOUtils.toString(urlStream);
+ }
jsonStr = jsonStr.trim();
if (jsonStr.startsWith("updateCenter.post(")) {
jsonStr = jsonStr.substring("updateCenter.post(".length());

Back to the top