Fix fortify issues identified in drools 65/23165/1
authorJoseph Chou <jc2555@att.com>
Fri, 10 Nov 2017 18:15:23 +0000 (13:15 -0500)
committerJoseph Chou <jc2555@att.com>
Fri, 10 Nov 2017 20:54:14 +0000 (15:54 -0500)
Fix code identified by Fortify as Privacy Violation

Issue-ID: POLICY-442

Change-Id: I6097fb203a53a9643c4c4c38185515b1c8a90282
Signed-off-by: Joseph Chou <jc2555@att.com>
feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java

index e0ada74..e48bd2f 100644 (file)
@@ -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);           
index 84043d8..d69ea33 100644 (file)
@@ -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);
                        }
                }