summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-10-29 15:12:39 -0400
committerJim Hahn <jrh3@att.com>2019-10-29 15:12:39 -0400
commita47aedf7bffd6c889a24a99ae3b4614770a1a269 (patch)
tree5a0076fad152e9ee877f0a547f5e4a2ac6b7e0fb
parentb80158327ac89e28dbf9d6540c5f93a028b1ef21 (diff)
Fix new sonar issues in drools-pdp
Did not address duplicate code issues. Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I304a02dbe9b1425df38abae815df0cff8faa0692
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java
index 0b49993d..959e6a2c 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -207,9 +207,7 @@ public class PropertyUtil {
config.getInterpolator().registerLookup(CRYPTO_CODER_PROPERTY_PREFIX, new CryptoCoderValueLookup(cryptoCoder));
Properties props = ConfigurationConverter.getProperties(config);
- props.stringPropertyNames().forEach(key -> {
- props.setProperty(key, cryptoCoder.decrypt(props.getProperty(key)));
- });
+ props.stringPropertyNames().forEach(key -> props.setProperty(key, cryptoCoder.decrypt(props.getProperty(key))));
return props;
}
@@ -266,7 +264,7 @@ public class PropertyUtil {
public interface Listener {
/**
* Notification of a properties file change.
- *
+ *
* @param properties the new properties
* @param changedKeys the set of property names that have changed, including
* additions and removals
@@ -342,7 +340,7 @@ public class PropertyUtil {
/**
* Add a listener to the notification list.
- *
+ *
* @param listener this is the listener to add to the list
* @return the properties at the moment the listener was added to the list
*/
@@ -353,7 +351,7 @@ public class PropertyUtil {
/**
* Remove a listener from the notification list.
- *
+ *
* @param listener this is the listener to remove
*/
synchronized void removeListener(Listener listener) {
@@ -373,7 +371,7 @@ public class PropertyUtil {
/**
* This method is periodically called to check for property list updates.
- *
+ *
* @throws IOException if there is an error in reading the properties file
*/
synchronized void poll() throws IOException {
@@ -441,7 +439,7 @@ public class PropertyUtil {
/**
* Stop listenening for updates.
- *
+ *
* @param file the properties file
* @param listener notify if not null, this is a callback interface that was used for
* notifications of changes
@@ -457,7 +455,7 @@ public class PropertyUtil {
/**
* Stop listenening for updates.
- *
+ *
* @param fileName the properties file
* @param listener notify if not null, this is a callback interface that was used for
* notifications of changes