summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Chou <jc2555@att.com>2017-11-10 13:15:23 -0500
committerJoseph Chou <jc2555@att.com>2017-11-10 15:54:14 -0500
commitd93245a8de9cf3adc381fa065f20d4199a9dcde8 (patch)
tree4c8506c98ce9cd6a0e2e5c90043148104aebf0b6
parent12bfb78be96fc9ce7f2e043260ed22f855ef3673 (diff)
Fix fortify issues identified in drools
Fix code identified by Fortify as Privacy Violation Issue-ID: POLICY-442 Change-Id: I6097fb203a53a9643c4c4c38185515b1c8a90282 Signed-off-by: Joseph Chou <jc2555@att.com>
-rw-r--r--feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java2
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java15
2 files changed, 7 insertions, 10 deletions
diff --git a/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java b/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
index e0ada747..e48bd2fa 100644
--- a/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
+++ b/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
@@ -36,7 +36,7 @@ import org.onap.policy.drools.system.PolicyEngine;
public class EelfFeature implements PolicyEngineFeatureAPI {
@Override
- public boolean beforeBoot(PolicyEngine engine, String cliArgs[]) {
+ final public boolean beforeBoot(PolicyEngine engine, String cliArgs[]) {
String logback = System.getProperty(Main.LOGBACK_CONFIGURATION_FILE_SYSTEM_PROPERTY,
Main.LOGBACK_CONFIGURATION_FILE_DEFAULT);
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 84043d8f..d69ea339 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
@@ -147,17 +147,14 @@ public class PropertyUtil
// add to static table, so this instance can be shared
registrations.put(file, this);
- if (timer == null)
+ // still need to create a timer thread
+ synchronized(PropertyUtil.class)
{
- // still need to create a timer thread
- synchronized(PropertyUtil.class)
+ // an additional check is added inside the 'synchronized' block,
+ // just in case someone beat us to it
+ if (timer == null)
{
- // an additional check is added inside the 'synchronized' block,
- // just in case someone beat us to it
- if (timer == null)
- {
- timer = new Timer("PropertyUtil-Timer", true);
- }
+ timer = new Timer("PropertyUtil-Timer", true);
}
}