aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/forwarding-plugins/src
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2019-04-16 10:37:32 +0800
committerLianhao Lu <lianhao.lu@intel.com>2019-04-16 10:46:15 +0800
commitb9572fadc14d054dbfc2dcce3ee2df663e250f04 (patch)
tree02af23858f266998e37077860a9826bac9b17ce5 /plugins/forwarding-plugins/src
parent9c24d662337f0c2043fbd8e6dc7a91fb2b299dff (diff)
Fix more sonar issues
Fixed the sonar issues: S134, S3725, S2129. Issue-ID: POLICY-1638 Change-Id: I1a91b8e5e071a770faf8182e8ac1ada04b63599e Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'plugins/forwarding-plugins/src')
-rw-r--r--plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java
index d02d9bba..51700005 100644
--- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java
+++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java
@@ -55,7 +55,7 @@ public class FilePolicyForwarder implements PolicyForwarder {
fileForwarderParameters = ParameterService.get(parameterGroupName);
try {
Path path = Paths.get(fileForwarderParameters.getPath());
- if (!Files.exists(path)) {
+ if (!path.toFile().exists()) {
Files.createDirectories(path);
}
} catch (final InvalidPathException | IOException e) {
@@ -72,8 +72,8 @@ public class FilePolicyForwarder implements PolicyForwarder {
if (policy instanceof OptimizationPolicy) {
forwardPolicy((OptimizationPolicy) policy);
} else {
- final String message = new String("Cannot forward policy " + policy
- + ". Unsupported policy type " + policy.getClass().getSimpleName());
+ final String message = "Cannot forward policy " + policy
+ + ". Unsupported policy type " + policy.getClass().getSimpleName();
LOGGER.error(message);
throw new PolicyForwardingException(message);
}