summaryrefslogtreecommitdiffstats
path: root/artifactbroker/plugins/reception-plugins
diff options
context:
space:
mode:
authorliboNet <libo.zhu@intel.com>2019-04-17 05:25:58 +0800
committerliboNet <libo.zhu@intel.com>2019-04-17 06:02:40 +0800
commit88d98921926c194899a393aa08f4793afc026b8c (patch)
treeff8881712568ffff94a52d58dd742b326945bcb5 /artifactbroker/plugins/reception-plugins
parentdc1321b4c135242c67e94f5af57d0e39866ce2d8 (diff)
Fix the sonar issue and clm issue
. Fix the bugs by using try-with-resources method . Add unit test for GsonUtil . Fix the org.springframework : spring-web issue by removing the dependency in forwarding plugin Change-Id: I01f6461ea2a0f0363247dd3571dd56dcf68a7f90 Issue-ID: MULTICLOUD-569 Signed-off-by: liboNet <libo.zhu@intel.com>
Diffstat (limited to 'artifactbroker/plugins/reception-plugins')
-rw-r--r--artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java b/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
index 37fb314..8bf69da 100644
--- a/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
+++ b/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
@@ -338,10 +338,8 @@ public class SdcReceptionHandler extends AbstractReceptionHandler implements INo
private static void writeFileByFileWriter(String filePath, String content) throws IOException {
File file = new File(filePath);
synchronized (file) {
- try {
- FileWriter fw = new FileWriter(filePath);
+ try (FileWriter fw = new FileWriter(filePath)) {
fw.write(content);
- fw.close();
} catch (final IOException exp) {
LOGGER.error("Failed to write File by File Writer ", exp);
}