aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-01-06 23:18:38 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-01-06 23:18:38 +0100
commit983c550c085539c485e03119644984cb9fecc880 (patch)
tree52a0a6c0bbeb878d23eb0b443e36bf709b5c7131 /sonar-application/src
parent8ff5eaf75ab5d68aba4c7993d1aa2b2ba4c1f36c (diff)
downloadsonarqube-983c550c085539c485e03119644984cb9fecc880.tar.gz
sonarqube-983c550c085539c485e03119644984cb9fecc880.zip
Fix quality flaws
Diffstat (limited to 'sonar-application/src')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/PropsBuilder.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/PropsBuilder.java b/sonar-application/src/main/java/org/sonar/application/PropsBuilder.java
index 1873448fb96..652dd4cf814 100644
--- a/sonar-application/src/main/java/org/sonar/application/PropsBuilder.java
+++ b/sonar-application/src/main/java/org/sonar/application/PropsBuilder.java
@@ -19,15 +19,17 @@
*/
package org.sonar.application;
+import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
import org.sonar.process.ConfigurationUtils;
import org.sonar.process.ProcessConstants;
import org.sonar.process.Props;
import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
import java.net.URISyntaxException;
import java.util.Properties;
@@ -84,11 +86,8 @@ class PropsBuilder {
Properties p = new Properties();
File propsFile = new File(homeDir, "conf/sonar.properties");
if (propsFile.exists()) {
- FileReader reader = new FileReader(propsFile);
- try {
+ try (Reader reader = new InputStreamReader(new FileInputStream(propsFile), Charsets.UTF_8)) {
p.load(reader);
- } finally {
- IOUtils.closeQuietly(reader);
}
}
return p;