summaryrefslogtreecommitdiffstats
path: root/common/openecomp-common-configuration-management
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2017-09-07 10:52:29 +0300
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-09-07 13:53:33 +0000
commitb7375b2488df93ba9df57ad13ec628bbff663819 (patch)
treee8d372535ab98aa76814e16d301ac32efbeb0c75 /common/openecomp-common-configuration-management
parent8bd8cee7d620406036e197f540439b1e226506d5 (diff)
Fixed a few static analysis violations
Fixed mostly not closing resources (InputStream, ResultSet) and catching Throwable instead of Exception in some modules. Issue-ID: SDC-291 Change-Id: I34e331cc3b45c4bb3a71c301f50e1706a7b623fd Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'common/openecomp-common-configuration-management')
-rw-r--r--common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java
index c0a1e0ceb0..889efea3da 100644
--- a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java
+++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java
@@ -584,14 +584,19 @@ public class ConfigurationUtils {
stmt.setString(i + 1, params[i]);
}
}
- ResultSet rs = stmt.executeQuery();
- while (rs.next()) {
- coll.add(rs.getString(1));
+
+ try (ResultSet rs = stmt.executeQuery()) {
+
+ while (rs.next()) {
+ coll.add(rs.getString(1));
+ }
}
+
} catch (Exception exception) {
//exception.printStackTrace();
return null;
}
+
return coll;
}