summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-19 14:32:10 -0400
committerJim Hahn <jrh3@att.com>2020-06-19 15:44:28 -0400
commit56a15039437ba5bf5d0fb422551bfb12e1f59eb1 (patch)
tree1fc57df4d9462790d4c4dd811425ab029d8ec710
parent1d810e0be1188c07ec9292b348c9d286f36963d9 (diff)
Address checkstyle version issues in drools-pdp
Also added serializationId to several classes to address eclipse warnings. Issue-ID: POLICY-2188 Change-Id: I3df5e8abaad8da9261c0d5cd19a93ed68dceb870 Signed-off-by: Jim Hahn <jrh3@att.com>
-rw-r--r--feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java4
-rw-r--r--feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpEntity.java2
-rw-r--r--feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpObject.java6
-rw-r--r--feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java20
-rw-r--r--feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/JpaDroolsPdpsConnector.java11
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/AllSeemsWellTest.java2
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java11
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/StandbyStateManagementTest.java16
-rw-r--r--feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java1
-rw-r--r--feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java1
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java2
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java4
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java2
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java10
-rw-r--r--feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/DmaapManager.java1
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/FeatureTest.java77
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/extractor/MapExtractorTest.java22
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ProcessingStateTest.java8
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java51
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Discovery.java3
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java39
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Keyword.java22
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Leader.java2
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java1
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java3
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java20
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolApi.java1
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolProperties.java1
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java91
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Util.java1
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/persistence/Persistence.java34
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java6
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/BucketWrapperImpl.java1
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/ServerWrapperImpl.java1
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/TargetLockWrapperImpl.java6
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Adapter.java4
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/BlockingClassLoader.java2
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/SimDmaap.java10
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java17
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/TestDroolsObject.java4
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsSessionEntity.java1
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java1
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java4
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java4
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnectorTest.java7
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java2
-rw-r--r--feature-simulators/src/main/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRs.java5
-rw-r--r--feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorTest.java1
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java3
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java2
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java3
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java9
-rw-r--r--feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/Audit.java5
-rw-r--r--feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java12
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java1
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java1
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java8
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/util/KieUtils.java4
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/util/KieUtilsTest.java2
-rw-r--r--policy-domains/src/test/java/org/onap/policy/drools/domain/models/legacy/LegacyPolicyTest.java2
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java10
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java1
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/IndexedPolicyControllerFactory.java7
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java4
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java6
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java8
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/PropertyUtil.java7
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java8
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java18
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java26
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/logging/MdcTransactionTest.java2
-rw-r--r--pom.xml36
72 files changed, 327 insertions, 403 deletions
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java
index 2b75ea5e..7e853990 100644
--- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java
+++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java
@@ -159,7 +159,7 @@ public class ActiveStandbyFeature implements ActiveStandbyFeatureApi,
synchronized (myPdpSync) {
if (myPdp == null) {
- myPdp = new DroolsPdpImpl(resourceName,false,4,MonitorTime.getInstance().getDate());
+ myPdp = new DroolsPdpImpl(resourceName, false, 4, MonitorTime.getInstance().getDate());
}
String siteName = ActiveStandbyProperties.getProperty(ActiveStandbyProperties.SITE_NAME);
if (siteName == null) {
@@ -169,7 +169,7 @@ public class ActiveStandbyFeature implements ActiveStandbyFeatureApi,
}
myPdp.setSite(siteName);
if (electionHandler == null) {
- electionHandler = new DroolsPdpsElectionHandler(conn,myPdp);
+ electionHandler = new DroolsPdpsElectionHandler(conn, myPdp);
}
}
logger.info("\n\nThis controller is a standby, waiting to be chosen as primary...\n\n");
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpEntity.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpEntity.java
index 078b0477..29f66e90 100644
--- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpEntity.java
+++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpEntity.java
@@ -58,7 +58,7 @@ public class DroolsPdpEntity extends DroolsPdpObject implements Serializable {
private Date updatedDate;
@Temporal(TemporalType.TIMESTAMP)
- @Column(name = "designatedDate",nullable = false)
+ @Column(name = "designatedDate", nullable = false)
private Date designatedDate;
@Column(name = "site", nullable = true, length = 50)
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpObject.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpObject.java
index f753c0aa..fd25a6d3 100644
--- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpObject.java
+++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpObject.java
@@ -26,7 +26,7 @@ public abstract class DroolsPdpObject implements DroolsPdp {
@Override
public boolean equals(Object other) {
if (other instanceof DroolsPdp) {
- return this.getPdpId().equals(((DroolsPdp)other).getPdpId());
+ return this.getPdpId().equals(((DroolsPdp) other).getPdpId());
} else {
return false;
}
@@ -71,13 +71,13 @@ public abstract class DroolsPdpObject implements DroolsPdp {
}
private int commonCompare(DroolsPdp other) {
- if (nullSafeCompare(this.getSite(),other.getSite()) == 0) {
+ if (nullSafeCompare(this.getSite(), other.getSite()) == 0) {
if (this.getPriority() != other.getPriority()) {
return this.getPriority() - other.getPriority();
}
return this.getPdpId().compareTo(other.getPdpId());
} else {
- return nullSafeCompare(this.getSite(),other.getSite());
+ return nullSafeCompare(this.getSite(), other.getSite());
}
}
}
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java
index f51e0718..acb7cd54 100644
--- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java
+++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java
@@ -364,7 +364,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
logger.debug("INFO: DesignatedWaiter.run: PDP= {} "
+ "designated= {}, current= {}, "
+ "designatedPdpHasFailed= {}, "
- + "standbyStatus= {}",pdp.getPdpId(),
+ + "standbyStatus= {}", pdp.getPdpId(),
pdp.isDesignated(), false, designatedPdpHasFailed, standbyStatus);
pdpNotDesignatedNotCurrent(pdp, standbyStatus);
}
@@ -452,7 +452,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
} else { //it is a remote PDP that is failed
logger.debug("\n\nDesignatedWaiter.run: PDP {} is not Current. "
+ " Executing stateManagement.disableFailed(otherResourceName)\n\n",
- pdp.getPdpId() );
+ pdp.getPdpId());
// We found a PDP is designated but not current
// We already called standdown(pdp) which will change designated to false
// Now we need to disableFail it to get its states in synch. The standbyStatus
@@ -561,7 +561,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
private void designateNoPdp() {
// Just to be sure the parameters are correctly set
myPdp.setDesignated(false);
- pdpsConnector.setDesignated(myPdp,false);
+ pdpsConnector.setDesignated(myPdp, false);
isDesignated = false;
waitTimerLastRunDate = currentTime.getDate();
@@ -597,7 +597,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
logger.error("ERROR: DesignatedWaiter.run: Caught Exception attempting to promote PDP={}"
+ ", message=", myPdp.getPdpId(), e);
myPdp.setDesignated(false);
- pdpsConnector.setDesignated(myPdp,false);
+ pdpsConnector.setDesignated(myPdp, false);
isDesignated = false;
//If you can't promote it, demote it
try {
@@ -639,7 +639,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
List<DroolsPdp> listForRemoval = new ArrayList<>();
for (DroolsPdp pdp : listOfDesignated) {
logger.debug("DesignatedWaiter.run sanitizing: pdp = {}"
- + " isDesignated = {}",pdp.getPdpId(), pdp.isDesignated());
+ + " isDesignated = {}", pdp.getPdpId(), pdp.isDesignated());
if (pdp.isDesignated()) {
containsDesignated = true;
} else {
@@ -783,7 +783,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
}
// If the rejectedPdp is myPdp, we need to stand it down and demote it. Each pdp is responsible
// for demoting itself
- if (rejectedPdp != null && nullSafeEquals(rejectedPdp.getPdpId(),myPdp.getPdpId())) {
+ if (rejectedPdp != null && nullSafeEquals(rejectedPdp.getPdpId(), myPdp.getPdpId())) {
logger.debug("\n\nDesignatedWaiter.run: myPdp: {} listOfDesignated myPdp ID: {}"
+ " is NOT the lowest priority. Executing stateManagement.demote()\n\n",
myPdp.getPdpId(),
@@ -821,11 +821,11 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
return null;
} else {
if (pdp.getPdpId().equals((lowestPrioritySameSite.getPdpId()))) {
- return null;//nothing to compare
+ return null; //nothing to compare
}
if (pdp.comparePriority(lowestPrioritySameSite) < 0) {
logger.debug("\nDesignatedWaiter.run: myPdp {} listOfDesignated pdp ID: {}"
- + " has lower priority than pdp ID: {}",myPdp.getPdpId(), pdp.getPdpId(),
+ + " has lower priority than pdp ID: {}", myPdp.getPdpId(), pdp.getPdpId(),
lowestPrioritySameSite.getPdpId());
//we need to reject lowestPrioritySameSite
DroolsPdp rejectedPdp = lowestPrioritySameSite;
@@ -834,7 +834,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
} else {
//we need to reject pdp and keep lowestPrioritySameSite
logger.debug("\nDesignatedWaiter.run: myPdp {} listOfDesignated pdp ID: {} "
- + " has higher priority than pdp ID: {}", myPdp.getPdpId(),pdp.getPdpId(),
+ + " has higher priority than pdp ID: {}", myPdp.getPdpId(), pdp.getPdpId(),
lowestPrioritySameSite.getPdpId());
return pdp;
}
@@ -851,7 +851,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
return null;
}
if (pdp.getPdpId().equals((lowestPriorityDifferentSite.getPdpId()))) {
- return null;//nothing to compare
+ return null; //nothing to compare
}
if (pdp.comparePriority(lowestPriorityDifferentSite) < 0) {
logger.debug("\nDesignatedWaiter.run: myPdp {} listOfDesignated pdp ID: {}"
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/JpaDroolsPdpsConnector.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/JpaDroolsPdpsConnector.java
index 6e456962..14ae52a0 100644
--- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/JpaDroolsPdpsConnector.java
+++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/JpaDroolsPdpsConnector.java
@@ -24,7 +24,6 @@ import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.FlushModeType;
@@ -68,7 +67,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
continue;
}
//Make sure it is not a cached version
- DroolsPdp droolsPdp = (DroolsPdp)o;
+ DroolsPdp droolsPdp = (DroolsPdp) o;
em.refresh(droolsPdp);
droolsPdpsReturnList.add(droolsPdp);
if (logger.isDebugEnabled()) {
@@ -115,7 +114,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.setFlushMode(FlushModeType.COMMIT).getResultList();
DroolsPdpEntity droolsPdpEntity;
if (droolsPdpsList.size() == 1 && (droolsPdpsList.get(0) instanceof DroolsPdpEntity)) {
- droolsPdpEntity = (DroolsPdpEntity)droolsPdpsList.get(0);
+ droolsPdpEntity = (DroolsPdpEntity) droolsPdpsList.get(0);
em.refresh(droolsPdpEntity); //Make sure we have current values
Date currentDate = currentTime.getDate();
long difference = currentDate.getTime() - droolsPdpEntity.getUpdatedDate().getTime();
@@ -145,7 +144,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
if (!droolsPdpEntity.getUpdatedDate().equals(pdp.getUpdatedDate())) {
droolsPdpEntity.setUpdatedDate(pdp.getUpdatedDate());
}
- if (!nullSafeEquals(droolsPdpEntity.getSite(),pdp.getSite())) {
+ if (!nullSafeEquals(droolsPdpEntity.getSite(), pdp.getSite())) {
droolsPdpEntity.setSite(pdp.getSite());
}
@@ -192,7 +191,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
if (droolsPdpsList.size() == 1 && droolsPdpsList.get(0) instanceof DroolsPdpEntity) {
logger.debug("isPdpCurrent: PDP={} designated but not current; setting designated to false",
pdp.getPdpId());
- DroolsPdpEntity droolsPdpEntity = (DroolsPdpEntity)droolsPdpsList.get(0);
+ DroolsPdpEntity droolsPdpEntity = (DroolsPdpEntity) droolsPdpsList.get(0);
droolsPdpEntity.setDesignated(false);
em.getTransaction().commit();
} else {
@@ -292,7 +291,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
droolsPdpEntity = (DroolsPdpEntity) droolsPdpsList.get(0);
droolsPdpEntity.setDesignated(false);
em.persist(droolsPdpEntity);
- logger.debug("standDownPdp: PDP={} persisted as non-designated.", pdpId );
+ logger.debug("standDownPdp: PDP={} persisted as non-designated.", pdpId);
} else {
logger.error("standDownPdp: Missing record in droolspdpentity for pdpId={}"
+ "; cannot stand down PDP", pdpId);
diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/AllSeemsWellTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/AllSeemsWellTest.java
index 9457ce18..0ce12dfc 100644
--- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/AllSeemsWellTest.java
+++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/AllSeemsWellTest.java
@@ -119,7 +119,7 @@ public class AllSeemsWellTest {
String userDir = System.getProperty("user.dir");
logger.debug("setUpClass: userDir={}", userDir);
System.setProperty("com.sun.management.jmxremote.port", "9980");
- System.setProperty("com.sun.management.jmxremote.authenticate","false");
+ System.setProperty("com.sun.management.jmxremote.authenticate", "false");
DroolsPdpsElectionHandler.setIsUnitTesting(true);
diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
index 3f4a31b2..78902ec7 100644
--- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
+++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
@@ -21,7 +21,6 @@
package org.onap.policy.drools.activestandby;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import java.util.Date;
@@ -29,8 +28,6 @@ import lombok.Getter;
import lombok.Setter;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.drools.activestandby.DroolsPdp;
-import org.onap.policy.drools.activestandby.DroolsPdpObject;
public class DroolsPdpObjectTest {
private static final String PDP_ID = "my-id";
@@ -50,19 +47,19 @@ public class DroolsPdpObjectTest {
@Test
public void testEqualsObject() {
// self
- assertEquals(pdp,pdp);
+ assertEquals(pdp, pdp);
// same id
MyPdp pdp2 = new MyPdp();
pdp2.setPdpId(PDP_ID);
- assertEquals(pdp,pdp2);
+ assertEquals(pdp, pdp2);
// different id
pdp2.setPdpId(PDP_ID2);
- assertNotEquals(pdp,pdp2);
+ assertNotEquals(pdp, pdp2);
// different type of object
- assertNotEquals(pdp,"");
+ assertNotEquals(pdp, "");
}
@Test
diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/StandbyStateManagementTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/StandbyStateManagementTest.java
index 866ad5ef..52f8b27a 100644
--- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/StandbyStateManagementTest.java
+++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/StandbyStateManagementTest.java
@@ -127,7 +127,7 @@ public class StandbyStateManagementTest {
String userDir = System.getProperty("user.dir");
logger.debug("setUpClass: userDir={}", userDir);
System.setProperty("com.sun.management.jmxremote.port", "9980");
- System.setProperty("com.sun.management.jmxremote.authenticate","false");
+ System.setProperty("com.sun.management.jmxremote.authenticate", "false");
saveTime = Whitebox.getInternalState(MonitorTime.class, MONITOR_FIELD_NAME);
saveFactory = Factory.getInstance();
@@ -359,7 +359,7 @@ public class StandbyStateManagementTest {
listOfDesignated = droolsPdpsElectionHandler.santizeDesignatedList(listOfDesignated);
- logger.debug("\n\ntestSanitizeDesignatedList: listOfDesignated.size = {}\n\n",listOfDesignated.size());
+ logger.debug("\n\ntestSanitizeDesignatedList: listOfDesignated.size = {}\n\n", listOfDesignated.size());
assertEquals(4, listOfDesignated.size());
@@ -901,7 +901,7 @@ public class StandbyStateManagementTest {
sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfx, activePdpId);//pdp2
+ sm = new StateManagement(emfx, activePdpId); //pdp2
// Artificially putting a PDP into service is really a two step process, 1)
// inserting it as designated and 2) promoting it so that its standbyStatus
@@ -955,16 +955,16 @@ public class StandbyStateManagementTest {
//At this point, the newly created pdp will have set the state to disabled/failed/cold standby
//because it is stale. So, it cannot be promoted. We need to call sm.enableNotFailed() so we
//can promote it and demote the other pdp - else the other pdp will just spring back to providingservice
- sm.enableNotFailed();//pdp2
+ sm.enableNotFailed(); //pdp2
sm.promote();
String standbyStatus = sm.getStandbyStatus(activePdpId);
logger.info("testHotStandby2: After promoting, PDP= {} has standbyStatus= {}", activePdpId, standbyStatus);
// demoting PDP should ensure that state transits to hotstandby
logger.info("testHotStandby2: Runner started; demoting PDP= {}", thisPdpId);
- sm2.demote();//pdp1
+ sm2.demote(); //pdp1
standbyStatus = sm.getStandbyStatus(thisPdpId);
- logger.info("testHotStandby2: After demoting, PDP={} has standbyStatus= {}",thisPdpId , standbyStatus);
+ logger.info("testHotStandby2: After demoting, PDP={} has standbyStatus= {}", thisPdpId, standbyStatus);
logger.info("testHotStandby2: Sleeping {} ms, to allow JpaDroolsPdpsConnector "
+ "time to check droolspdpentity table", SLEEP_TIME);
@@ -1079,7 +1079,7 @@ public class StandbyStateManagementTest {
sleep(SLEEP_TIME);
logger.debug("testLocking1: Waking up and invoking startTransaction on active PDP={}"
- + ", designated= {}",thisPdpId, conn.getPdp(thisPdpId).isDesignated());
+ + ", designated= {}", thisPdpId, conn.getPdp(thisPdpId).isDesignated());
IntegrityMonitor droolsPdpIntegrityMonitor = IntegrityMonitor.getInstance();
@@ -1133,7 +1133,7 @@ public class StandbyStateManagementTest {
sleep(100);
logger.debug("testLocking1: Invoking startTransaction on locked PDP= {}"
- + ", designated= {}",thisPdpId, conn.getPdp(thisPdpId).isDesignated());
+ + ", designated= {}", thisPdpId, conn.getPdp(thisPdpId).isDesignated());
try {
droolsPdpIntegrityMonitor.startTransaction();
logger.error("testLocking1: startTransaction unexpectedly successful");
diff --git a/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java b/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
index f97ed759..c1e9aedc 100644
--- a/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
+++ b/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
@@ -23,7 +23,6 @@ package org.onap.policy.drools.droolsinit;
import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.kie.api.runtime.rule.FactHandle;
-
import org.onap.policy.drools.core.PolicySession;
import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.system.PolicyEngineConstants;
diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
index 5d9d67ec..e323d405 100644
--- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
+++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
@@ -25,7 +25,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
index ac76883f..24a122b0 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
@@ -362,7 +362,7 @@ public class LifecycleFsm implements Startable {
}
protected boolean updatePoliciesAction(List<ToscaPolicy> toscaPolicies) {
- return (this.scheduler.submit( () -> state.updatePolicies(toscaPolicies)) != null);
+ return (this.scheduler.submit(() -> state.updatePolicies(toscaPolicies)) != null);
}
/* ** Action Helpers ** */
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java
index 8bbdbe92..438dc577 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java
@@ -44,13 +44,13 @@ public class LifecycleStatePassive extends LifecycleStateRunning {
@Override
protected boolean stateChangeToActive(@NonNull PdpStateChange change) {
fsm.transitionToAction(new LifecycleStateActive(fsm));
- fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS,null));
+ fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS, null));
return fsm.updatePoliciesAction(fsm.resetPoliciesAction());
}
@Override
protected boolean stateChangeToPassive(@NonNull PdpStateChange change) {
- return fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS,null));
+ return fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS, null));
}
@Override
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
index 4093b510..957ecfa6 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
@@ -344,7 +344,7 @@ public class RestLifecycleManager {
List<ToscaPolicy> policies =
LifecycleFeature.fsm.getPoliciesMap().values().stream().collect(Collectors.toList());
- policies.removeIf(aPolicy -> policy.getIdentifier().equals(aPolicy.getIdentifier()));
+ policies.removeIf(otherPolicy -> policy.getIdentifier().equals(otherPolicy.getIdentifier()));
return Response.status(Response.Status.OK)
.entity(LifecycleFeature.fsm.update(getPolicyUpdate(policies)))
.build();
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
index 90492098..c618c845 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
@@ -242,7 +242,7 @@ public class RestLifecycleManagerTest {
assertTrue(PolicyControllerConstants.getFactory().get("lifecycle").getDrools().isBrained());
assertEquals(1,
PolicyControllerConstants
- .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class) .size());
+ .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class).size());
resourceLists("policies", 3);
get("policies/" + opPolicy.getName() + "/" + opPolicy.getVersion(), Status.OK.getStatusCode());
@@ -253,7 +253,7 @@ public class RestLifecycleManagerTest {
Status.OK.getStatusCode(), Boolean.TRUE);
assertEquals(0,
PolicyControllerConstants
- .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class) .size());
+ .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class).size());
resourceLists("policies", 2);
get("policies/" + opPolicy.getName() + "/" + opPolicy.getVersion(), Status.NOT_FOUND.getStatusCode());
@@ -267,7 +267,7 @@ public class RestLifecycleManagerTest {
booleanPost("policies/operations/deployment", toString(opPolicy), Status.OK.getStatusCode(), Boolean.TRUE);
assertEquals(1,
PolicyControllerConstants
- .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class) .size());
+ .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class).size());
resourceLists("policies", 2);
get("policies/" + opPolicy.getName() + "/" + opPolicy.getVersion(), Status.NOT_FOUND.getStatusCode());
@@ -278,7 +278,7 @@ public class RestLifecycleManagerTest {
"policies/operations/undeployment", toString(opPolicy), Status.OK.getStatusCode(), Boolean.TRUE);
assertEquals(0,
PolicyControllerConstants
- .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class) .size());
+ .getFactory().get("lifecycle").getDrools().facts("junits", ToscaPolicy.class).size());
resourceLists("policies", 2);
get("policies/" + opPolicy.getName() + "/" + opPolicy.getVersion(), Status.NOT_FOUND.getStatusCode());
@@ -411,7 +411,7 @@ public class RestLifecycleManagerTest {
Field modifiers = Field.class.getDeclaredField("modifiers");
modifiers.setAccessible(true);
- modifiers.setInt(fsmField, fsmField.getModifiers() & ~Modifier.FINAL );
+ modifiers.setInt(fsmField, fsmField.getModifiers() & ~Modifier.FINAL);
LifecycleFsm fsm = new LifecycleFsm();
fsmField.set(null, fsm);
diff --git a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/DmaapManager.java b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/DmaapManager.java
index 674dc402..9ba844ed 100644
--- a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/DmaapManager.java
+++ b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/DmaapManager.java
@@ -21,7 +21,6 @@
package org.onap.policy.drools.pooling;
import java.util.List;
-
import org.onap.policy.common.endpoints.event.comm.FilterableTopicSource;
import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/FeatureTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/FeatureTest.java
index d51e61e6..c35e525a 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/FeatureTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/FeatureTest.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.
@@ -76,7 +76,7 @@ import org.slf4j.LoggerFactory;
* <dt>PolicyEngine, PolicyController, DroolsController</dt>
* <dd>mocked</dd>
* </dl>
- *
+ *
* <p>Invoke {@link #runSlow()}, before the test, to slow things down.
*/
public class FeatureTest {
@@ -178,7 +178,7 @@ public class FeatureTest {
private String makeMessage(int reqnum) {
return "{\"reqid\":\"req" + reqnum + "\", \"data\":\"hello " + reqnum + "\"}";
}
-
+
/**
* Invoke this to slow the timers down.
*/
@@ -196,7 +196,7 @@ public class FeatureTest {
/**
* Decodes an event.
- *
+ *
* @param event event
* @return the decoded event, or {@code null} if it cannot be decoded
*/
@@ -253,7 +253,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param nEvents number of events to be processed
*/
public Context(int events) {
@@ -270,7 +270,7 @@ public class FeatureTest {
/**
* Creates and adds a new host to the context.
- *
+ *
* @return the new Host
*/
public Host addHost() {
@@ -308,7 +308,7 @@ public class FeatureTest {
/**
* Sets {@link #currentHost} to the specified host, and then invokes the given
* function. Resets {@link #currentHost} to {@code null} before returning.
- *
+ *
* @param host host
* @param func function to invoke
*/
@@ -320,7 +320,7 @@ public class FeatureTest {
/**
* Offers an event to the external topic.
- *
+ *
* @param event event
*/
public void offerExternal(String event) {
@@ -329,7 +329,7 @@ public class FeatureTest {
/**
* Adds an internal channel to the set of channels.
- *
+ *
* @param channel channel
* @param queue the channel's queue
*/
@@ -339,7 +339,7 @@ public class FeatureTest {
/**
* Offers a message to all internal channels.
- *
+ *
* @param message message
*/
public void offerInternal(String message) {
@@ -348,7 +348,7 @@ public class FeatureTest {
/**
* Offers amessage to an internal channel.
- *
+ *
* @param channel channel
* @param message message
*/
@@ -361,7 +361,7 @@ public class FeatureTest {
/**
* Associates a controller with its drools controller.
- *
+ *
* @param controller controller
* @param droolsController drools controller
*/
@@ -371,7 +371,7 @@ public class FeatureTest {
/**
* Get controller.
- *
+ *
* @param droolsController drools controller
* @return the controller associated with a drools controller, or {@code null} if
* it has no associated controller
@@ -382,7 +382,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @return queue for the external topic
*/
public BlockingQueue<String> getExternalTopic() {
@@ -391,7 +391,7 @@ public class FeatureTest {
/**
* Get decode errors.
- *
+ *
* @return the number of decode errors so far
*/
public int getDecodeErrors() {
@@ -407,7 +407,7 @@ public class FeatureTest {
/**
* Get remaining events.
- *
+ *
* @return the number of events that haven't been processed
*/
public long getRemainingEvents() {
@@ -423,7 +423,7 @@ public class FeatureTest {
/**
* Waits, for a period of time, for all events to be processed.
- *
+ *
* @param time time
* @param units units
* @return {@code true} if all events have been processed, {@code false} otherwise
@@ -436,7 +436,7 @@ public class FeatureTest {
/**
* Gets the current host, provided this is used from within a call to
* {@link #withHost(Host, VoidFunction)}.
- *
+ *
* @return the current host, or {@code null} if there is no current host
*/
public Host getCurrentHost() {
@@ -475,7 +475,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param context context
*/
public Host(Context context) {
@@ -496,13 +496,13 @@ public class FeatureTest {
// arrange to read from the external topic
externalSource = new TopicSourceImpl(context, false);
-
+
feature = new PoolingFeatureImpl(context);
}
/**
* Get name.
- *
+ *
* @return the host name
*/
public String getName() {
@@ -543,7 +543,7 @@ public class FeatureTest {
/**
* Offers an event to the feature, before the policy controller handles it.
- *
+ *
* @param protocol protocol
* @param topic2 topic
* @param event event
@@ -555,7 +555,7 @@ public class FeatureTest {
/**
* Offers an event to the feature, after the policy controller handles it.
- *
+ *
* @param protocol protocol
* @param topic topic
* @param event event
@@ -569,7 +569,7 @@ public class FeatureTest {
/**
* Offers an event to the feature, before the drools controller handles it.
- *
+ *
* @param fact fact
* @return {@code true} if the event was handled, {@code false} otherwise
*/
@@ -579,7 +579,7 @@ public class FeatureTest {
/**
* Offers an event to the feature, after the drools controller handles it.
- *
+ *
* @param fact fact
* @param successInsert {@code true} if it was successfully inserted by the drools
* controller, {@code false} otherwise
@@ -598,7 +598,7 @@ public class FeatureTest {
/**
* Message seen.
- *
+ *
* @return {@code true} if a message was seen for this host, {@code false}
* otherwise
*/
@@ -608,7 +608,7 @@ public class FeatureTest {
/**
* Get internal queue.
- *
+ *
* @return the queue associated with this host's internal topic
*/
public BlockingQueue<String> getInternalQueue() {
@@ -681,7 +681,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param context context
*/
public TopicSinkImpl(Context context) {
@@ -738,7 +738,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param context context
* @param internal {@code true} if to read from the internal topic, {@code false}
* to read from the external topic
@@ -784,8 +784,7 @@ public class FeatureTest {
try {
do {
processMessages(newPair.first(), listener);
- }
- while (!newPair.first().await(stdInterPollMs, TimeUnit.MILLISECONDS));
+ } while (!newPair.first().await(stdInterPollMs, TimeUnit.MILLISECONDS));
logger.info("topic source thread completed");
@@ -816,7 +815,7 @@ public class FeatureTest {
/**
* Registers a new "pair" with this source, stopping the consumer associated with
* any previous registration.
- *
+ *
* @param newPair the new "pair", or {@code null} to unregister
*/
private void reregister(Pair<CountDownLatch, CountDownLatch> newPair) {
@@ -855,7 +854,7 @@ public class FeatureTest {
/**
* Polls for messages from the topic and offers them to the listener.
- *
+ *
* @param stopped triggered if processing should stop
* @param listener listener
* @throws InterruptedException throws interrupted exception
@@ -967,7 +966,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param context context
*/
public PoolingFeatureImpl(Context context) {
@@ -1010,7 +1009,7 @@ public class FeatureTest {
/**
* Embeds a specializer within a property name, after the prefix.
- *
+ *
* @param propnm property name into which it should be embedded
* @param spec specializer to be embedded
* @return the property name, with the specializer embedded within it
@@ -1025,7 +1024,7 @@ public class FeatureTest {
CountDownLatch activeLatch) {
currentContext.set(context);
-
+
return new PoolingManagerTest(host, controller, props, activeLatch);
}
}
@@ -1037,7 +1036,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param host the host
* @param controller the controller
* @param props the properties
@@ -1072,7 +1071,7 @@ public class FeatureTest {
/**
* Constructor.
- *
+ *
* @param context this manager's context
* @param topic the topic
* @throws PoolingFeatureException if an error occurs
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/extractor/MapExtractorTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/extractor/MapExtractorTest.java
index afaa2b65..74694579 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/extractor/MapExtractorTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/extractor/MapExtractorTest.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.
@@ -31,17 +31,17 @@ import org.junit.Test;
public class MapExtractorTest {
private static final String KEY = "a.key";
private static final String VALUE = "a.value";
-
+
private MapExtractor ext;
-
+
@Before
public void setUp() {
- ext = new MapExtractor(KEY);
+ ext = new MapExtractor(KEY);
}
@Test
public void testExtract_NotAMap() {
-
+
// object is not a map (i.e., it's a String)
assertNull(ext.extract(KEY));
}
@@ -49,9 +49,9 @@ public class MapExtractorTest {
@Test
public void testExtract_MissingValue() {
- Map<String,Object> map = new HashMap<>();
+ Map<String, Object> map = new HashMap<>();
map.put(KEY + "x", VALUE + "x");
-
+
// object is a map, but doesn't have the key
assertNull(ext.extract(map));
}
@@ -59,13 +59,13 @@ public class MapExtractorTest {
@Test
public void testExtract() {
- Map<String,Object> map = new HashMap<>();
+ Map<String, Object> map = new HashMap<>();
map.put(KEY + "x", VALUE + "x");
map.put(KEY, VALUE);
-
+
// object is a map and contains the key
assertEquals(VALUE, ext.extract(map));
-
+
// change to value to a different type
map.put(KEY, 20);
assertEquals(20, ext.extract(map));
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ProcessingStateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ProcessingStateTest.java
index 3682dcb4..82346f5c 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ProcessingStateTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ProcessingStateTest.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.
@@ -275,7 +275,7 @@ public class ProcessingStateTest extends SupportBasicStateTester {
@Test
public void testRemoveExcessHosts() {
- /**
+ /*
* All hosts are still alive, plus some others.
*/
state.setAssignments(ASGN3);
@@ -314,7 +314,7 @@ public class ProcessingStateTest extends SupportBasicStateTester {
@Test
public void testRebalanceBuckets() {
- /**
+ /*
* Some are very lopsided.
*/
String[] asgn = {MY_HOST, HOST1, MY_HOST, MY_HOST, MY_HOST, MY_HOST, HOST1, HOST2, HOST1, HOST3};
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
index b949134f..bf3af4a8 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
@@ -62,12 +62,10 @@ import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import lombok.Getter;
import lombok.Setter;
import org.slf4j.Logger;
@@ -142,7 +140,7 @@ public class Bucket {
static {
// create hash bucket entries, but there are no assignments yet
- for (int i = 0 ; i < indexToBucket.length ; i += 1) {
+ for (int i = 0; i < indexToBucket.length; i += 1) {
Bucket bucket = new Bucket(i);
indexToBucket[i] = bucket;
}
@@ -756,8 +754,7 @@ public class Bucket {
* current host.
*/
UUID key = oldHost.uuid;
- for (int count = new Random().nextInt(rb.testServers.size() - 1) ;
- count >= 0 ; count -= 1) {
+ for (int count = new Random().nextInt(rb.testServers.size() - 1); count >= 0; count -= 1) {
key = rb.testServers.higherKey(key);
if (key == null) {
// wrap to the beginning of the list
@@ -1379,9 +1376,9 @@ public class Bucket {
}
}
- /********************************************/
- /* Comparable<AdjustedTestServer> interface */
- /********************************************/
+ /* ****************************************** */
+ /* Comparable<AdjustedTestServer> interface */
+ /* ****************************************** */
/**
* {@inheritDoc}
@@ -1421,7 +1418,7 @@ public class Bucket {
TestBucket[] buckets = new TestBucket[indexToBucket.length];
// this table resembles the 'Server.servers' table
- TreeMap<UUID,TestServer> testServers = new TreeMap<>(Util.uuidComparator);
+ TreeMap<UUID, TestServer> testServers = new TreeMap<>(Util.uuidComparator);
/* this is a special server instance, which is allocated any
* owned, primary, or secondary buckets that haven't been allocated to
@@ -1448,7 +1445,7 @@ public class Bucket {
*/
Callable<Integer> callable = () -> {
// copy the 'Bucket' table
- for (int i = 0 ; i < indexToBucket.length; i += 1) {
+ for (int i = 0; i < indexToBucket.length; i += 1) {
// makes a snapshot of the bucket information
Bucket bucket = indexToBucket[i];
@@ -1619,7 +1616,7 @@ public class Bucket {
if (primaryBackup != null
&& !Objects.equals(siteSocketAddress,
primaryBackup.siteSocketAddress)) {
- /**
+ /*
* primary backup is from the wrong site -- see if we can
* use the secondary.
*/
@@ -1769,7 +1766,7 @@ public class Bucket {
DataOutputStream dos = new DataOutputStream(bos);
// go through the entire 'buckets' table
- for (int i = 0 ; i < buckets.length ; i += 1) {
+ for (int i = 0; i < buckets.length; i += 1) {
// fetch the 'TestBucket' associated with index 'i'
TestBucket testBucket = buckets[i];
@@ -1831,7 +1828,7 @@ public class Bucket {
final Entity<String> entity =
Entity.entity(new String(Base64.getEncoder().encode(packet),
StandardCharsets.UTF_8), MediaType.APPLICATION_OCTET_STREAM_TYPE);
- /**
+ /*
* This method is running within the 'MainLoop' thread.
*/
Runnable task = () -> {
@@ -2179,9 +2176,9 @@ public class Bucket {
}
}
- /*********************/
- /* 'State' interface */
- /*********************/
+ /* ******************* */
+ /* 'State' interface */
+ /* ******************* */
/**
* {@inheritDoc}
@@ -2232,9 +2229,9 @@ public class Bucket {
}
}
- /**********************/
- /* 'Thread' interface */
- /**********************/
+ /* ******************** */
+ /* 'Thread' interface */
+ /* ******************** */
/**
* {@inheritDoc}
@@ -2367,10 +2364,10 @@ public class Bucket {
*/
private void restoreBucketData(Object obj) {
if (obj instanceof List) {
- for (Object entry : (List<?>)obj) {
+ for (Object entry : (List<?>) obj) {
if (entry instanceof Restore) {
// entry-specific 'restore' operation
- ((Restore)entry).restore(Bucket.this.index);
+ ((Restore) entry).restore(Bucket.this.index);
} else {
logger.error("{}: Expected '{}' but got '{}'",
this, Restore.class.getName(),
@@ -2401,9 +2398,9 @@ public class Bucket {
start();
}
- /*********************/
- /* 'State' interface */
- /*********************/
+ /* ******************* */
+ /* 'State' interface */
+ /* ******************* */
/**
* {@inheritDoc}
@@ -2433,9 +2430,9 @@ public class Bucket {
logger.error("{}: 'bulkSerializedData()' shouldn't be called in this state", this);
}
- /**********************/
- /* 'Thread' interface */
- /**********************/
+ /* ******************** */
+ /* 'Thread' interface */
+ /* ******************** */
/**
* {@inheritDoc}
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Discovery.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Discovery.java
index 1d695a01..2d643a34 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Discovery.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Discovery.java
@@ -37,7 +37,6 @@ import static org.onap.policy.drools.serverpool.ServerPoolProperties.DISCOVER_PU
import static org.onap.policy.drools.serverpool.ServerPoolProperties.getProperty;
import com.google.gson.Gson;
-
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.nio.charset.StandardCharsets;
@@ -46,7 +45,6 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicListener;
@@ -55,7 +53,6 @@ import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java
index dfe211ce..23da0712 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java
@@ -41,14 +41,11 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import lombok.AllArgsConstructor;
-
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
@@ -126,7 +123,7 @@ public class FeatureServerPool
* table[0] = {"requestID"}
* table[1] = {"CommonHeader", "RequestID"}
*/
- private static HashMap<String,String[][]> topicToPaths = new HashMap<>();
+ private static HashMap<String, String[][]> topicToPaths = new HashMap<>();
// this table is used for any topics that aren't in 'topicToPaths'
private static String[][] defaultPaths = new String[0][];
@@ -144,9 +141,9 @@ public class FeatureServerPool
private static final String QP_PROTOCOL = "protocol";
private static final String QP_TOPIC = "topic";
- /******************************/
- /* 'OrderedService' interface */
- /******************************/
+ /* **************************** */
+ /* 'OrderedService' interface */
+ /* **************************** */
/**
* {@inheritDoc}
@@ -158,9 +155,9 @@ public class FeatureServerPool
return -1000000;
}
- /**************************************/
- /* 'PolicyEngineFeatureApi' interface */
- /**************************************/
+ /* ************************************ */
+ /* 'PolicyEngineFeatureApi' interface */
+ /* ************************************ */
/**
* {@inheritDoc}
@@ -270,9 +267,9 @@ public class FeatureServerPool
return true;
}
- /******************************************/
- /* 'PolicyControllerFeatureApi' interface */
- /******************************************/
+ /* **************************************** */
+ /* 'PolicyControllerFeatureApi' interface */
+ /* **************************************** */
/**
* This method is called from 'AggregatedPolicyController.onTopicEvent',
@@ -411,7 +408,7 @@ public class FeatureServerPool
* TBD: it would be nice to limit the number of hops, in case we
* somehow have a loop.
*/
- ((TopicListener)controller).onTopicEvent(
+ ((TopicListener) controller).onTopicEvent(
CommInfrastructure.valueOf(protocol), topic, event);
} else {
/*
@@ -573,7 +570,7 @@ public class FeatureServerPool
// Example: requestID,CommonHeader.RequestID
String[] commaSeparatedEntries = prop.getProperty(name).split(",");
String[][] paths = new String[commaSeparatedEntries.length][];
- for (int i = 0 ; i < commaSeparatedEntries.length ; i += 1) {
+ for (int i = 0; i < commaSeparatedEntries.length; i += 1) {
paths[i] = commaSeparatedEntries[i].split("\\.");
}
@@ -663,7 +660,7 @@ public class FeatureServerPool
* TBD: it would be nice to limit the number of hops, in case we
* somehow have a loop.
*/
- ((TopicListener)controller).onTopicEvent(protocol, topic, event);
+ ((TopicListener) controller).onTopicEvent(protocol, topic, event);
} else {
/*
* This 'PolicyController' was also a 'TopicListener' on the sender's
@@ -748,6 +745,8 @@ public class FeatureServerPool
* This class is used to generate and restore backup Drools data.
*/
static class DroolsSessionRestore implements Bucket.Restore, Serializable {
+ private static final long serialVersionUID = 1L;
+
// backup data for all Drools sessions on this host
private final List<SingleSession> sessions = new LinkedList<>();
@@ -801,7 +800,7 @@ public class FeatureServerPool
}
}
- /**
+ /*
* data copying can start as soon as we receive results
* from pending sessions (there may not be any)
*/
@@ -822,7 +821,7 @@ public class FeatureServerPool
PolicySession session = pair.second();
long delay = endTime - System.currentTimeMillis();
if (delay < 0) {
- /**
+ /*
* we have already reached the time limit, so we will
* only process data that has already been received
*/
@@ -892,6 +891,8 @@ public class FeatureServerPool
* been backed up, or is being restored.
*/
static class SingleSession implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// the group id associated with the Drools container
String groupId;
@@ -969,7 +970,7 @@ public class FeatureServerPool
Object obj = ois.readObject();
if (obj instanceof List) {
- final List<?> droolsObjects = (List<?>)obj;
+ final List<?> droolsObjects = (List<?>) obj;
logger.info("{}: session={}, got {} object(s)",
this, session.getFullName(), droolsObjects.size());
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Keyword.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Keyword.java
index e0b97fda..10210ebf 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Keyword.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Keyword.java
@@ -27,9 +27,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
-
import lombok.AllArgsConstructor;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -130,7 +128,7 @@ public class Keyword {
// this table maps class name to a sequence of method calls and field
// references, based upon 'keyword.<CLASS-NAME>.lookup' entries found
// in the property list
- private static Map<String,String> classNameToSequence = null;
+ private static Map<String, String> classNameToSequence = null;
static final String KEYWORD_PROPERTY_START = "keyword.";
static final String KEYWORD_PROPERTY_END = ".lookup";
@@ -186,7 +184,7 @@ public class Keyword {
*/
private static Class<?> buildReflectiveLookup_findKeyClass(Class<?> clazz) {
Class<?> keyClass = null;
- for (Class<?> cl = clazz ; cl != null ; cl = cl.getSuperclass()) {
+ for (Class<?> cl = clazz; cl != null; cl = cl.getSuperclass()) {
if (classNameToSequence.containsKey(cl.getName())) {
// matches the class
keyClass = cl;
@@ -218,7 +216,7 @@ public class Keyword {
// we found a matching key in the table -- now, process the values
Class<?> currentClass = keyClass;
- /**
+ /*
* there may potentially be a chain of entries if multiple
* field and/or method calls are in the sequence -- this is the first
*/
@@ -227,7 +225,7 @@ public class Keyword {
// this is the last entry in the list
ReflectiveLookup last = null;
- /**
+ /*
* split the value into segments, where each segment has the form
* 'FIELD-NAME' or 'METHOD-NAME()', with an optional ':CONVERSION'
* at the end
@@ -325,9 +323,9 @@ public class Keyword {
field = clazz.getField(segment);
}
- /********************************/
- /* 'ReflectiveLookup' interface */
- /********************************/
+ /* ****************************** */
+ /* 'ReflectiveLookup' interface */
+ /* ****************************** */
/**
* {@inheritDoc}
@@ -337,9 +335,9 @@ public class Keyword {
return field.getType();
}
- /**********************/
- /* 'Lookup' interface */
- /**********************/
+ /* ******************** */
+ /* 'Lookup' interface */
+ /* ******************** */
/**
* {@inheritDoc}
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Leader.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Leader.java
index 06b02527..cf535b43 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Leader.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Leader.java
@@ -38,10 +38,8 @@ import java.util.HashSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.UUID;
-
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java
index 1c6281d9..4ae8b59b 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java
@@ -27,7 +27,6 @@ import static org.onap.policy.drools.serverpool.ServerPoolProperties.getProperty
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.TimeUnit;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
index 8ece943e..636fa4d5 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
@@ -25,13 +25,11 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@@ -40,7 +38,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
index ad0e25ee..511b79a7 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
@@ -78,13 +78,11 @@ import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.glassfish.jersey.client.ClientProperties;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
@@ -306,13 +304,13 @@ public class Server implements Comparable<Server> {
possibleError = "HTTP server initialization error";
restServer = HttpServletServerFactoryInstance.getServerFactory().build(
- "SERVER-POOL", // name
- useHttps, // https
- socketAddress.getAddress().getHostAddress(),// host (maybe 0.0.0.0)
- port, // port (can no longer be 0)
- null, // contextPath
- false, // swagger
- false); // managed
+ "SERVER-POOL", // name
+ useHttps, // https
+ socketAddress.getAddress().getHostAddress(), // host (maybe 0.0.0.0)
+ port, // port (can no longer be 0)
+ null, // contextPath
+ false, // swagger
+ false); // managed
restServer.addServletClass(null, RestServerPool.class.getName());
// add any additional servlets
@@ -877,7 +875,7 @@ public class Server implements Comparable<Server> {
// TBD: We need a way to get this information without reflection
Field field = client.getClass().getDeclaredField("client");
field.setAccessible(true);
- Client rsClient = (Client)field.get(client);
+ Client rsClient = (Client) field.get(client);
field.setAccessible(false);
rsClient.property(ClientProperties.CONNECT_TIMEOUT, connectTimeout);
@@ -917,7 +915,7 @@ public class Server implements Comparable<Server> {
}
getThreadPool().execute(() -> {
- /**
+ /*
* This method is running within the 'MainLoop' thread.
*/
try {
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolApi.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolApi.java
index c6337749..d267ce82 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolApi.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolApi.java
@@ -21,7 +21,6 @@
package org.onap.policy.drools.serverpool;
import java.util.Collection;
-
import org.onap.policy.common.utils.services.OrderedService;
import org.onap.policy.common.utils.services.OrderedServiceImpl;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolProperties.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolProperties.java
index 61188e6b..d1c09d43 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolProperties.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/ServerPoolProperties.java
@@ -21,7 +21,6 @@
package org.onap.policy.drools.serverpool;
import java.util.Properties;
-
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
index b2e0fb29..dee03a1b 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
@@ -20,7 +20,6 @@
package org.onap.policy.drools.serverpool;
-import static org.junit.Assert.assertTrue;
import static org.onap.policy.drools.serverpool.ServerPoolProperties.DEFAULT_LOCK_AUDIT_GRACE_PERIOD;
import static org.onap.policy.drools.serverpool.ServerPoolProperties.DEFAULT_LOCK_AUDIT_PERIOD;
import static org.onap.policy.drools.serverpool.ServerPoolProperties.DEFAULT_LOCK_AUDIT_RETRY_DELAY;
@@ -58,9 +57,7 @@ import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import lombok.EqualsAndHashCode;
-import lombok.NonNull;
import org.onap.policy.drools.core.DroolsRunnable;
import org.onap.policy.drools.core.PolicyContainer;
import org.onap.policy.drools.core.PolicySession;
@@ -86,6 +83,8 @@ import org.slf4j.LoggerFactory;
* owned by the host containing the entry.
*/
public class TargetLock implements Lock, Serializable {
+ private static final long serialVersionUID = 1L;
+
private static Logger logger = LoggerFactory.getLogger(TargetLock.class);
// Listener class to handle state changes that require restarting the audit
@@ -234,7 +233,7 @@ public class TargetLock implements Lock, Serializable {
context = new PolicySessionContext(session);
session.setAdjunct(PolicySessionContext.class, context);
} else {
- context = (LockCallback)lcontext;
+ context = (LockCallback) lcontext;
}
} else {
// no context to deliver through -- call back directly to owner
@@ -325,7 +324,7 @@ public class TargetLock implements Lock, Serializable {
logger.info("Lock response={} (code={})",
response, response.getStatus());
- /**
+ /*
* there are three possible responses:
* 204 No Content - operation was successful
* 202 Accepted - operation is still in progress
@@ -362,9 +361,9 @@ public class TargetLock implements Lock, Serializable {
});
}
- /********************/
- /* 'Lock' Interface */
- /********************/
+ /* ****************** */
+ /* 'Lock' Interface */
+ /* ****************** */
/**
* This method will free the current lock, or remove it from the waiting
@@ -444,7 +443,7 @@ public class TargetLock implements Lock, Serializable {
// not implemented yet
}
- /********************/
+ /* ****************** */
/**
* Update the state.
@@ -690,9 +689,9 @@ public class TargetLock implements Lock, Serializable {
+ ", state=" + state + ")";
}
- /*****************/
- /* Serialization */
- /*****************/
+ /* *************** */
+ /* Serialization */
+ /* *************** */
/**
* This method modifies the behavior of 'TargetLock' deserialization by
@@ -715,9 +714,9 @@ public class TargetLock implements Lock, Serializable {
/* ============================================================ */
private static class LockFactory implements PolicyResourceLockManager {
- /*****************************************/
- /* 'PolicyResourceLockManager' interface */
- /*****************************************/
+ /* *************************************** */
+ /* 'PolicyResourceLockManager' interface */
+ /* *************************************** */
/**
* {@inheritDoc}
@@ -730,9 +729,9 @@ public class TargetLock implements Lock, Serializable {
return new TargetLock(resourceId, ownerKey, callback, waitForLock);
}
- /*************************/
- /* 'Startable' interface */
- /*************************/
+ /* *********************** */
+ /* 'Startable' interface */
+ /* *********************** */
/**
* {@inheritDoc}
@@ -766,9 +765,9 @@ public class TargetLock implements Lock, Serializable {
return true;
}
- /************************/
- /* 'Lockable' interface */
- /************************/
+ /* ********************** */
+ /* 'Lockable' interface */
+ /* ********************** */
/**
* {@inheritDoc}
@@ -835,6 +834,8 @@ public class TargetLock implements Lock, Serializable {
*/
@EqualsAndHashCode
private static class Identity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// this is the key associated with the lock
String key;
@@ -956,6 +957,8 @@ public class TargetLock implements Lock, Serializable {
* the callback to 'TargetLock.owner' runs within the Drools thread.
*/
private static class PolicySessionContext implements LockCallback, Serializable {
+ private static final long serialVersionUID = 1L;
+
// the 'PolicySession' instance in question
PolicySession policySession;
@@ -968,9 +971,9 @@ public class TargetLock implements Lock, Serializable {
this.policySession = policySession;
}
- /*********************/
- /* 'Owner' interface */
- /*********************/
+ /* ******************* */
+ /* 'Owner' interface */
+ /* ******************* */
/**
* {@inheritDoc}
@@ -980,7 +983,7 @@ public class TargetLock implements Lock, Serializable {
// Run 'owner.lockAvailable' within the Drools session
if (policySession != null) {
DroolsRunnable callback = () -> {
- ((TargetLock)lock).owner.lockAvailable(lock);
+ ((TargetLock) lock).owner.lockAvailable(lock);
};
policySession.getKieSession().insert(callback);
}
@@ -994,15 +997,15 @@ public class TargetLock implements Lock, Serializable {
// Run 'owner.unlockAvailable' within the Drools session
if (policySession != null) {
DroolsRunnable callback = () -> {
- ((TargetLock)lock).owner.lockUnavailable(lock);
+ ((TargetLock) lock).owner.lockUnavailable(lock);
};
policySession.getKieSession().insert(callback);
}
}
- /*****************/
- /* Serialization */
- /*****************/
+ /* *************** */
+ /* Serialization */
+ /* *************** */
/**
* Specializes serialization of 'PolicySessionContext'.
@@ -1080,6 +1083,8 @@ public class TargetLock implements Lock, Serializable {
* of the lock implementation.
*/
public static class GlobalLocks implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// this is the lock table, mapping 'key' to 'LockEntry', which indicates
// the current lock holder, and all those waiting
private Map<String, LockEntry> keyToEntry = new HashMap<>();
@@ -1206,6 +1211,8 @@ public class TargetLock implements Lock, Serializable {
* any that are waiting.
*/
private static class LockEntry implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// string key identifying the lock
private String key;
@@ -1290,6 +1297,8 @@ public class TargetLock implements Lock, Serializable {
* This corresponds to a member of 'LockEntry.waitingList'
*/
private static class Waiting implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// string key identifying the owner
String ownerKey;
@@ -1337,6 +1346,8 @@ public class TargetLock implements Lock, Serializable {
* This class is used to restore a 'GlobalLocks' instance from a backup.
*/
static class LockRestore implements Bucket.Restore, Serializable {
+ private static final long serialVersionUID = 1L;
+
GlobalLocks globalLocks;
/**
@@ -1400,7 +1411,7 @@ public class TargetLock implements Lock, Serializable {
// here. The alternative is to add some additional information
// to make this mapping quick, at the expense of a slight
// slow down of normal lock operations.
- for (int i = 0 ; i < Bucket.BUCKETCOUNT ; i += 1) {
+ for (int i = 0; i < Bucket.BUCKETCOUNT; i += 1) {
LocalLocks localLocks =
Bucket.getBucket(i).getAdjunctDontCreate(LocalLocks.class);
if (localLocks != null) {
@@ -1595,7 +1606,7 @@ public class TargetLock implements Lock, Serializable {
Object decodedData = Util.deserialize(Base64.getDecoder().decode(data));
if (decodedData instanceof HostData) {
// deserialized data
- HostData hostData = (HostData)decodedData;
+ HostData hostData = (HostData) decodedData;
// fetch 'Server' instance associated with the responding server
Server server = Server.getServer(hostData.hostUuid);
@@ -2020,6 +2031,8 @@ public class TargetLock implements Lock, Serializable {
* host that is consolidating the information for display.
*/
static class HostData implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// the UUID of the host sending the data
private UUID hostUuid;
@@ -2042,7 +2055,7 @@ public class TargetLock implements Lock, Serializable {
serverDataList = new ArrayList<ServerData>();
// go through buckets
- for (int i = 0 ; i < Bucket.BUCKETCOUNT ; i += 1) {
+ for (int i = 0; i < Bucket.BUCKETCOUNT; i += 1) {
Bucket bucket = Bucket.getBucket(i);
// client data
@@ -2089,6 +2102,8 @@ public class TargetLock implements Lock, Serializable {
* Information derived from the 'LocalLocks' adjunct to a single bucket.
*/
static class ClientData implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// number of the bucket
private int bucketNumber;
@@ -2111,6 +2126,8 @@ public class TargetLock implements Lock, Serializable {
* single 'TargetLock'.
*/
static class ClientDataRecord implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// contains key, ownerKey, uuid
private Identity identity;
@@ -2135,6 +2152,8 @@ public class TargetLock implements Lock, Serializable {
* Information derived from the 'GlobalLocks' adjunct to a single bucket.
*/
static class ServerData implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// number of the bucket
private int bucketNumber;
@@ -2161,6 +2180,8 @@ public class TargetLock implements Lock, Serializable {
* 'TargetLock' audit.
*/
static class AuditData implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// sending UUID
private UUID hostUuid;
@@ -2382,7 +2403,7 @@ public class TargetLock implements Lock, Serializable {
Object decodedData =
Util.deserialize(Base64.getDecoder().decode(encodedData));
if (decodedData instanceof AuditData) {
- return (AuditData)decodedData;
+ return (AuditData) decodedData;
} else {
logger.error(
"TargetLock.AuditData.decode returned instance of class {}",
@@ -2406,7 +2427,7 @@ public class TargetLock implements Lock, Serializable {
static TimerTask timerTask = null;
// maps 'Server' to audit data associated with that server
- Map<Server,AuditData> auditMap = new IdentityHashMap<>();
+ Map<Server, AuditData> auditMap = new IdentityHashMap<>();
/**
* Run a single audit cycle.
@@ -2556,7 +2577,7 @@ public class TargetLock implements Lock, Serializable {
* remote server.
*/
void build() {
- for (int i = 0 ; i < Bucket.BUCKETCOUNT ; i += 1) {
+ for (int i = 0; i < Bucket.BUCKETCOUNT; i += 1) {
Bucket bucket = Bucket.getBucket(i);
// client data
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Util.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Util.java
index 66a9eac3..92d0994c 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Util.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Util.java
@@ -32,7 +32,6 @@ import java.nio.charset.StandardCharsets;
import java.util.Comparator;
import java.util.Timer;
import java.util.UUID;
-
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/persistence/Persistence.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/persistence/Persistence.java
index 0f7321de..48bd1c1a 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/persistence/Persistence.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/persistence/Persistence.java
@@ -36,7 +36,6 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
@@ -44,7 +43,6 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
-
import org.kie.api.event.rule.ObjectDeletedEvent;
import org.kie.api.event.rule.ObjectInsertedEvent;
import org.kie.api.event.rule.ObjectUpdatedEvent;
@@ -78,9 +76,9 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
private static final String QP_COUNT = "count";
private static final String QP_DEST = "dest";
- /***************************************/
- /* 'PolicySessionFeatureApi' interface */
- /***************************************/
+ /* ************************************* */
+ /* 'PolicySessionFeatureApi' interface */
+ /* ************************************* */
/**
* {@inheritDoc}
@@ -117,9 +115,9 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
}
}
- /*****************************/
- /* 'ServerPoolApi' interface */
- /*****************************/
+ /* *************************** */
+ /* 'ServerPoolApi' interface */
+ /* *************************** */
/**
* {@inheritDoc}
@@ -184,7 +182,7 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
for (PolicySession session : sbd.sessionData.keySet()) {
Object obj = session.getAdjunct(PersistenceRunnable.class);
if (obj instanceof PersistenceRunnable) {
- PersistenceRunnable pr = (PersistenceRunnable)obj;
+ PersistenceRunnable pr = (PersistenceRunnable) obj;
synchronized (pr.modifiedBuckets) {
// mark bucket associated with this session
// as modified
@@ -300,9 +298,9 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
session.getKieSession().addEventListener(this);
}
- /******************************/
- /* 'DroolsRunnable' interface */
- /******************************/
+ /* **************************** */
+ /* 'DroolsRunnable' interface */
+ /* **************************** */
/**
* {@inheritDoc}
@@ -364,9 +362,9 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
}
}
- /****************************************/
- /* 'RuleRuntimeEventListener' interface */
- /****************************************/
+ /* ************************************** */
+ /* 'RuleRuntimeEventListener' interface */
+ /* ************************************** */
/**
* {@inheritDoc}
@@ -462,7 +460,7 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
*/
static class SenderSessionBucketData {
// the set of all objects in the session associated with this bucket
- Map<Object,Object> droolsObjects = new IdentityHashMap<>();
+ Map<Object, Object> droolsObjects = new IdentityHashMap<>();
// used by the receiver to determine whether an update is really newer
int count = 0;
@@ -741,7 +739,7 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
// if we reach this point, we have decoded the persistent data
- final Map<?,?> droolsObjects = (Map<?,?>) obj;
+ final Map<?, ?> droolsObjects = (Map<?, ?>) obj;
// signal when restore is complete
final CountDownLatch sessionLatch = new CountDownLatch(1);
@@ -779,7 +777,7 @@ public class Persistence implements PolicySessionFeatureApi, ServerPoolApi {
bucket.putAdjunct(obj);
// send out updated date
- sendLockDataToBackups(bucket, (GlobalLocks)obj);
+ sendLockDataToBackups(bucket, (GlobalLocks) obj);
} else {
logger.error(RESTORE_BUCKET_ERROR
+ "Expected 'GlobalLocks', got '{}'",
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
index 70dc2114..789dfe61 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
@@ -172,7 +172,7 @@ public class AdapterImpl extends Adapter {
TimeUnit.MILLISECONDS).until(() -> Leader.getLeader() != null);
// wait for each bucket to have an owner
- for (int i = 0 ; i < Bucket.BUCKETCOUNT ; i += 1) {
+ for (int i = 0; i < Bucket.BUCKETCOUNT; i += 1) {
Bucket bucket = Bucket.getBucket(i);
while (bucket.getOwner() == null) {
Thread.sleep(Math.min(endTime - System.currentTimeMillis(), 100L));
@@ -312,7 +312,7 @@ public class AdapterImpl extends Adapter {
*/
logger.info("{}: Calling 'sendEvent': packages = {}", this,
policySession.getKieSession().getKieBase().getKiePackages());
- ((TopicListener)policyController).onTopicEvent(
+ ((TopicListener) policyController).onTopicEvent(
CommInfrastructure.UEB, "JUNIT-TEST-TOPIC",
"{\"key\":\"" + key + "\"}");
}
@@ -374,7 +374,7 @@ public class AdapterImpl extends Adapter {
String rval = null;
// try up to 10000 numeric values to locate one on a particular host
- for (int i = 0 ; i < 10000 ; i += 1) {
+ for (int i = 0; i < 10000; i += 1) {
// generate key, and see if it is on the desired server
String testString = prefix + (startingIndex + i);
if (ServerWrapperImpl.getWrapper(
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/BucketWrapperImpl.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/BucketWrapperImpl.java
index ca89d99a..ddd4d553 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/BucketWrapperImpl.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/BucketWrapperImpl.java
@@ -22,7 +22,6 @@ package org.onap.policy.drools.serverpool;
import java.io.PrintStream;
import java.util.IdentityHashMap;
-
import org.onap.policy.drools.serverpooltest.BucketWrapper;
import org.onap.policy.drools.serverpooltest.ServerWrapper;
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/ServerWrapperImpl.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/ServerWrapperImpl.java
index 468d12af..031c3323 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/ServerWrapperImpl.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/ServerWrapperImpl.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.IdentityHashMap;
import java.util.UUID;
-
import org.onap.policy.drools.serverpooltest.ServerWrapper;
/**
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/TargetLockWrapperImpl.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/TargetLockWrapperImpl.java
index 4f496986..e170975a 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/TargetLockWrapperImpl.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/TargetLockWrapperImpl.java
@@ -21,8 +21,6 @@
package org.onap.policy.drools.serverpool;
import java.io.Serializable;
-import java.util.IdentityHashMap;
-
import org.onap.policy.drools.core.lock.Lock;
import org.onap.policy.drools.core.lock.LockCallback;
import org.onap.policy.drools.serverpooltest.TargetLockWrapper;
@@ -32,6 +30,8 @@ import org.onap.policy.drools.serverpooltest.TargetLockWrapper;
* 'TargetLockWrapperImpl' class for each simulated host.
*/
public class TargetLockWrapperImpl implements TargetLockWrapper {
+ private static final long serialVersionUID = 1L;
+
// this is the 'TargetLock' instance associated with the wrapper
private TargetLock targetLock;
@@ -156,6 +156,8 @@ public class TargetLockWrapperImpl implements TargetLockWrapper {
* interface, translating it to a 'TargetLockWrapper.Owner' callback.
*/
public static class OwnerAdapter implements LockCallback, Serializable {
+ private static final long serialVersionUID = 1L;
+
// the 'TargetLockWrapper' instance to pass as an argument in the callback
TargetLockWrapper targetLock;
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Adapter.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Adapter.java
index d5d836b4..22404605 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Adapter.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Adapter.java
@@ -95,7 +95,7 @@ public abstract class Adapter {
ClassLoader saveClassLoader =
Thread.currentThread().getContextClassLoader();
if (saveClassLoader instanceof URLClassLoader) {
- urls = ((URLClassLoader)saveClassLoader).getURLs();
+ urls = ((URLClassLoader) saveClassLoader).getURLs();
} else {
// the parent is not a 'URLClassLoader' --
// try to get this information from 'java.class.path'
@@ -111,7 +111,7 @@ public abstract class Adapter {
urls = tmpUrls.toArray(new URL[0]);
}
try {
- for (int i = 0 ; i < adapters.length ; i += 1) {
+ for (int i = 0; i < adapters.length; i += 1) {
/*
* Build a new 'ClassLoader' for this adapter. The
* 'ClassLoader' hierarchy is:
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/BlockingClassLoader.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/BlockingClassLoader.java
index 7930bf27..a21f254d 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/BlockingClassLoader.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/BlockingClassLoader.java
@@ -162,7 +162,7 @@ public class BlockingClassLoader extends ClassLoader {
// being blocked
int index = name.lastIndexOf('.');
if (index >= 0) {
- if (packages.contains(name.substring(0,index))) {
+ if (packages.contains(name.substring(0, index))) {
throw(new ClassNotFoundException(name));
}
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/SimDmaap.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/SimDmaap.java
index 8513c1f0..03004844 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/SimDmaap.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/SimDmaap.java
@@ -26,7 +26,6 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@@ -35,7 +34,6 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -111,7 +109,7 @@ public class SimDmaap {
/* ============================================================ */
// maps topic name to 'Topic' instance
- static Map<String,Topic> topicTable = new ConcurrentHashMap<>();
+ static Map<String, Topic> topicTable = new ConcurrentHashMap<>();
/**
* Each instance of this class corresponds to a DMAAP or UEB topic.
@@ -121,7 +119,7 @@ public class SimDmaap {
String topic;
// maps group name into group instance
- Map<String,Group> groupTable = new ConcurrentHashMap<>();
+ Map<String, Group> groupTable = new ConcurrentHashMap<>();
/**
* Create or get a Topic.
@@ -179,7 +177,7 @@ public class SimDmaap {
// no more messages
break;
}
- String[] prefix = data.substring(cur,leftBrace).split("\\.");
+ String[] prefix = data.substring(cur, leftBrace).split("\\.");
if (prefix.length == 3) {
try {
// determine length of message, and advance current position
@@ -281,7 +279,7 @@ public class SimDmaap {
builder.append("[\"").append(message);
// add up to '<limit>-1' more messages
- for (int i = 1 ; i < limit ; i += 1) {
+ for (int i = 1; i < limit; i += 1) {
// fetch the next message -- don't wait if it isn't currently there
message = messages.poll();
if (message == null) {
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
index ad4ba8e8..436cf77f 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
@@ -40,12 +40,10 @@ import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-
import org.awaitility.Durations;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-
import org.kie.api.runtime.KieSession;
import org.onap.policy.drools.core.DroolsRunnable;
import org.onap.policy.drools.serverpool.BucketWrapperImpl;
@@ -68,7 +66,7 @@ public class Test1 {
if (count > thr.length) {
count = thr.length;
}
- for (int i = 0 ; i < count ; i += 1) {
+ for (int i = 0; i < count; i += 1) {
StringBuilder sb = new StringBuilder();
sb.append(" ").append(thr[i]);
if (stackTrace) {
@@ -202,7 +200,7 @@ public class Test1 {
if (adapter == firstAdapter) {
// make sure an owner and primary backup have been chosen
// for each bucket (secondary backups aren't implemented yet)
- for (int i = 0 ; i < bucketStatic.getBucketCount() ; i += 1) {
+ for (int i = 0; i < bucketStatic.getBucketCount(); i += 1) {
BucketWrapper bucket = bucketStatic.getBucket(i);
assertNotNull(bucket.getOwner());
assertNotNull(bucket.getPrimaryBackup());
@@ -210,7 +208,7 @@ public class Test1 {
} else {
// make sure the bucket assignments are consistent with
// the primary backup
- for (int i = 0 ; i < bucketStatic.getBucketCount() ; i += 1) {
+ for (int i = 0; i < bucketStatic.getBucketCount(); i += 1) {
BucketWrapper firstBucket = firstBucketStatic.getBucket(i);
BucketWrapper bucket = bucketStatic.getBucket(i);
assertEquals(firstBucket.getOwner().getUuid(),
@@ -586,7 +584,7 @@ public class Test1 {
KieSession kieSession = newClient.getKieSession();
for (Object obj : new ArrayList<Object>(kieSession.getObjects())) {
if (obj instanceof KeywordWrapper) {
- KeywordWrapper kw = (KeywordWrapper)obj;
+ KeywordWrapper kw = (KeywordWrapper) obj;
if ("lmt.owner".equals(kw.id)) {
owner = kw.getObject(LockOwner.class);
@@ -705,6 +703,8 @@ public class Test1 {
// need a 'LockOwner' variant
final LockOwner owner = new LockOwner() {
+ private static final long serialVersionUID = 1L;
+
/**
* {@inheritDoc}
*/
@@ -840,6 +840,9 @@ public class Test1 {
*/
public static class LockOwner extends LinkedBlockingQueue<Object[]>
implements TargetLockWrapper.Owner, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
/**
* Constructor -- initialize the 'LinkedBlockingQueue'.
*/
@@ -873,6 +876,8 @@ public class Test1 {
* testing.
*/
public static class KeywordWrapper implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// this is the keyword, which determines the associated bucket,
// which then determines when this object is migrated
public String key;
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/TestDroolsObject.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/TestDroolsObject.java
index 43aa5de7..a937680f 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/TestDroolsObject.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/TestDroolsObject.java
@@ -21,8 +21,6 @@
package org.onap.policy.drools.serverpooltest;
import java.io.Serializable;
-import java.util.Objects;
-
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@@ -37,6 +35,8 @@ import lombok.ToString;
@ToString
@EqualsAndHashCode
public class TestDroolsObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+
// determines the bucket number
private String key;
diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsSessionEntity.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsSessionEntity.java
index 447835a6..ec9e5b76 100644
--- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsSessionEntity.java
+++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsSessionEntity.java
@@ -22,7 +22,6 @@ package org.onap.policy.drools.persistence;
import java.io.Serializable;
import java.util.Date;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java
index b85a6854..d682e563 100644
--- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java
+++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java
@@ -22,7 +22,6 @@ package org.onap.policy.drools.persistence;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
index a4965888..ed427255 100644
--- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
+++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
@@ -29,13 +29,11 @@ import java.util.Map;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.UserTransaction;
-
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.BasicDataSourceFactory;
import org.hibernate.cfg.AvailableSettings;
@@ -833,7 +831,7 @@ public class PersistenceFeature implements PolicySessionFeatureApi, PolicyEngine
}
}
- /** Factory for various items. Methods can be overridden for junit testing. */
+ /* Factory for various items. Methods can be overridden for junit testing. */
/**
* Gets the transaction manager.
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
index 5fbb905b..8853edf2 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
@@ -25,9 +25,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Date;
-
import org.junit.Test;
-import org.onap.policy.drools.persistence.DroolsSessionEntity;
public class DroolsSessionEntityTest {
@@ -103,7 +101,7 @@ public class DroolsSessionEntityTest {
@Test
public void testEqualsObject() {
DroolsSessionEntity entity = makeEnt("mynameA", 1);
-
+
// diff object type
assertFalse(entity.equals("hello"));
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnectorTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnectorTest.java
index d1962b60..c1fe08a1 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnectorTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnectorTest.java
@@ -29,19 +29,14 @@ import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.Map;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
-
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.drools.persistence.DroolsSessionEntity;
-import org.onap.policy.drools.persistence.EntityMgrTrans;
-import org.onap.policy.drools.persistence.JpaDroolsSessionConnector;
public class JpaDroolsSessionConnectorTest {
@@ -56,7 +51,7 @@ public class JpaDroolsSessionConnectorTest {
/**
* Setup.
- *
+ *
* @throws Exception exception
*/
@Before
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
index 20ae13d0..25f805d7 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
@@ -52,13 +52,11 @@ import java.util.Map;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.UserTransaction;
-
import org.apache.commons.dbcp2.BasicDataSource;
import org.junit.After;
import org.junit.Before;
diff --git a/feature-simulators/src/main/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRs.java b/feature-simulators/src/main/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRs.java
index 819c5f5e..c330b80c 100644
--- a/feature-simulators/src/main/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRs.java
+++ b/feature-simulators/src/main/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRs.java
@@ -26,7 +26,6 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DefaultValue;
@@ -37,7 +36,6 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -77,8 +75,7 @@ public class DMaaPSimulatorJaxRs {
if (queues.containsKey(topicName)) {
return getNextMessageFromQueue(timeout, topicName);
- }
- else if (timeout > 0) {
+ } else if (timeout > 0) {
return waitForNextMessageFromQueue(timeout, topicName);
}
return NO_TOPIC_MSG;
diff --git a/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorTest.java b/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorTest.java
index bb1b1cb9..0b97dd74 100644
--- a/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorTest.java
+++ b/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorTest.java
@@ -32,7 +32,6 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
index b34d64e6..2dc751b1 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
@@ -27,7 +27,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import java.util.UUID;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -64,7 +63,7 @@ public class DbAudit extends DroolsPdpIntegrityMonitor.AuditBase {
/**
* Get the instance.
- *
+ *
* @return the single 'DbAudit' instance. */
public static DroolsPdpIntegrityMonitor.AuditBase getInstance() {
return instance;
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
index 3330bd80..459d3836 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
@@ -24,11 +24,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
index 520d8503..75233376 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
@@ -76,8 +76,7 @@ public class StateManagementFeature implements StateManagementFeatureApi,
if (stateManagement == null) {
logger.debug("StateManagementFeature.globalInit(): stateManagement is NULL!");
- }
- else {
+ } else {
logger.debug("StateManagementFeature.globalInit(): "
+ "stateManagement.getAdminState(): {}", stateManagement.getAdminState());
}
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java
index c4d38817..d7f15883 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.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.
@@ -21,7 +21,6 @@
package org.onap.policy.drools.statemanagement;
import java.util.Properties;
-
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,13 +67,13 @@ public class StateManagementProperties {
/**
* Initialize the parameter values from the feature-state-management.properties file values.
- *
+ *
* <p>This is designed so that the Properties object is obtained from the
* feature-state-management.properties file and then is passed to this method to initialize the
* value of the parameters. This allows the flexibility of JUnit tests using
* getProperties(filename) to get the properties while runtime methods can use
* getPropertiesFromClassPath(filename).
- *
+ *
* @param prop properties
*/
public static void initProperties(Properties prop) {
diff --git a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/Audit.java b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/Audit.java
index 943293c9..37d9d7b8 100644
--- a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/Audit.java
+++ b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/Audit.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.
@@ -21,7 +21,6 @@
package org.onap.policy.drools.statemanagement.test;
import java.io.Serializable;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
diff --git a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
index f6c42b5f..347e8c90 100644
--- a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
+++ b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
@@ -26,13 +26,11 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.ws.rs.core.Response;
-
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -74,7 +72,7 @@ public class StateManagementTest {
String userDir = System.getProperty("user.dir");
logger.debug("setUpClass: userDir=" + userDir);
System.setProperty("com.sun.management.jmxremote.port", "9980");
- System.setProperty("com.sun.management.jmxremote.authenticate","false");
+ System.setProperty("com.sun.management.jmxremote.authenticate", "false");
initializeDb();
@@ -189,7 +187,7 @@ public class StateManagementTest {
assertTrue("Standby status not coldstandby after promote()", standby.equals(StateManagement.COLD_STANDBY));
- /**************Repository Audit Test. **************/
+ /* *************Repository Audit Test. ************* */
logger.debug("\n\ntestStateManagementOperation: Repository Audit\n\n");
try {
StateManagementProperties.initProperties(fsmProperties);
@@ -207,7 +205,7 @@ public class StateManagementTest {
logger.debug("testSubsytemTest RepositoryAudit InterruptedException", e);
}
- /*****************Db Audit Test. ***************/
+ /* ****************Db Audit Test. ************** */
logger.debug("\n\ntestStateManagementOperation: DB Audit\n\n");
try {
@@ -220,7 +218,7 @@ public class StateManagementTest {
logger.debug("testSubsytemTest DbAudit exception", e);
}
- /*************IntegrityMonitorRestManager Test. *************/
+ /* ************IntegrityMonitorRestManager Test. ************ */
logger.debug("\n\ntestStateManagementOperation: IntegrityMonitorRestManager\n\n");
IntegrityMonitorRestManager integrityMonitorRestManager = new IntegrityMonitorRestManager();
@@ -242,7 +240,7 @@ public class StateManagementTest {
logger.debug("initializeDb: Entering");
Properties cleanProperties = new Properties();
- cleanProperties.put(StateManagementProperties.DB_DRIVER,"org.h2.Driver");
+ cleanProperties.put(StateManagementProperties.DB_DRIVER, "org.h2.Driver");
cleanProperties.put(StateManagementProperties.DB_URL, "jdbc:h2:mem:statemanagement");
cleanProperties.put(StateManagementProperties.DB_USER, "sa");
cleanProperties.put(StateManagementProperties.DB_PWD, "");
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
index fee18a05..6547ca73 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
@@ -26,7 +26,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
-
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.KieScanner;
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
index cee7c368..49ff7bb8 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
@@ -22,7 +22,6 @@
package org.onap.policy.drools.core;
import java.util.concurrent.ConcurrentHashMap;
-
import org.kie.api.event.rule.AfterMatchFiredEvent;
import org.kie.api.event.rule.AgendaEventListener;
import org.kie.api.event.rule.AgendaGroupPoppedEvent;
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java
index 04f0dfd0..924f2b00 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.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.
@@ -21,7 +21,6 @@
package org.onap.policy.drools.core.jmx;
import java.lang.management.ManagementFactory;
-
import javax.management.InstanceAlreadyExistsException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanRegistrationException;
@@ -29,7 +28,6 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
import javax.management.ObjectName;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +47,7 @@ public class PdpJmxListener {
server.unregisterMBean(new ObjectName("PolicyEngine:type=PdpJmx"));
} catch (MBeanRegistrationException | InstanceNotFoundException
| MalformedObjectNameException e) {
- logger.error("PdpJmxListener.stop(): "
+ logger.error("PdpJmxListener.stop(): "
+ "Could not unregister PolicyEngine:type=PdpJmx MBean "
+ "with the MBean server", e);
}
diff --git a/policy-core/src/main/java/org/onap/policy/drools/util/KieUtils.java b/policy-core/src/main/java/org/onap/policy/drools/util/KieUtils.java
index bcad792c..d56af118 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/util/KieUtils.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/util/KieUtils.java
@@ -33,9 +33,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
-
import lombok.NonNull;
-
import org.apache.commons.io.IOUtils;
import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.compiler.kproject.models.KieModuleModelImpl;
@@ -246,7 +244,7 @@ public class KieUtils {
if (!stillNeeded.isEmpty()) {
// there are still packages we need to add --
// this code makes use of an internal class and method
- ((KnowledgeBaseImpl)kieBase).addPackages(stillNeeded);
+ ((KnowledgeBaseImpl) kieBase).addPackages(stillNeeded);
}
}
}
diff --git a/policy-core/src/test/java/org/onap/policy/drools/util/KieUtilsTest.java b/policy-core/src/test/java/org/onap/policy/drools/util/KieUtilsTest.java
index f230d4f9..1622a2b9 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/util/KieUtilsTest.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/util/KieUtilsTest.java
@@ -97,7 +97,7 @@ public class KieUtilsTest {
@Test
public void getPackages() {
assertEquals(Arrays.asList("java.util", "java.util.concurrent", "org.onap.policy.drools.core.test"),
- KieUtils.getPackages(container) .stream().map(KiePackage::getName).collect(Collectors.toList()));
+ KieUtils.getPackages(container).stream().map(KiePackage::getName).collect(Collectors.toList()));
}
@Test
diff --git a/policy-domains/src/test/java/org/onap/policy/drools/domain/models/legacy/LegacyPolicyTest.java b/policy-domains/src/test/java/org/onap/policy/drools/domain/models/legacy/LegacyPolicyTest.java
index 13e91cc0..430cb615 100644
--- a/policy-domains/src/test/java/org/onap/policy/drools/domain/models/legacy/LegacyPolicyTest.java
+++ b/policy-domains/src/test/java/org/onap/policy/drools/domain/models/legacy/LegacyPolicyTest.java
@@ -49,7 +49,7 @@ public class LegacyPolicyTest {
new ToscaPolicyTypeIdentifier(OPERATIONAL_LEGACY_POLICY_TYPE, "1.0.0");
DomainMaker domainMaker = new DomainMaker();
- assertTrue(domainMaker .isConformant(legacyType, rawVcpeToscaPolicy));
+ assertTrue(domainMaker.isConformant(legacyType, rawVcpeToscaPolicy));
LegacyPolicy legacyPolicy = domainMaker.convertTo(legacyType, rawVcpeToscaPolicy, LegacyPolicy.class);
ToscaPolicy policy = new StandardCoder().decode(rawVcpeToscaPolicy, ToscaPolicy.class);
diff --git a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
index 4e4fddf9..935cb11d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
@@ -567,8 +567,7 @@ public class MavenDroolsController implements DroolsController {
if (feature.beforeDeliver(this, sink, event)) {
return true;
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
logger.error("{}: feature {} before-deliver failure because of {}", this, feature.getClass().getName(),
e.getMessage(), e);
}
@@ -604,8 +603,7 @@ public class MavenDroolsController implements DroolsController {
if (feature.afterDeliver(this, sink, event, json, success)) {
return true;
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
logger.error("{}: feature {} after-deliver failure because of {}", this, feature.getClass().getName(),
e.getMessage(), e);
}
@@ -748,10 +746,10 @@ public class MavenDroolsController implements DroolsController {
}
@Override
- public Map<String,Integer> factClassNames(String sessionName) {
+ public Map<String, Integer> factClassNames(String sessionName) {
validateSessionName(sessionName);
- Map<String,Integer> classNames = new HashMap<>();
+ Map<String, Integer> classNames = new HashMap<>();
PolicySession session = getSession(sessionName);
KieSession kieSession = session.getKieSession();
diff --git a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
index ab19a898..02a1a81b 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
@@ -32,7 +32,6 @@ import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Properties;
-
import java.util.function.BiPredicate;
import org.onap.policy.drools.properties.DroolsPropertyConstants;
import org.onap.policy.drools.utils.PropertyUtil;
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/IndexedPolicyControllerFactory.java b/policy-management/src/main/java/org/onap/policy/drools/system/IndexedPolicyControllerFactory.java
index cb526e04..6956a45e 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/IndexedPolicyControllerFactory.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/IndexedPolicyControllerFactory.java
@@ -21,7 +21,6 @@
package org.onap.policy.drools.system;
import com.fasterxml.jackson.annotation.JsonIgnore;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -45,13 +44,13 @@ class IndexedPolicyControllerFactory implements PolicyControllerFactory {
/**
* Policy Controller Name Index.
*/
- private final HashMap<String,PolicyController> policyControllers =
+ private final HashMap<String, PolicyController> policyControllers =
new HashMap<>();
/**
* Group/Artifact Ids Index.
*/
- private final HashMap<String,PolicyController> coordinates2Controller =
+ private final HashMap<String, PolicyController> coordinates2Controller =
new HashMap<>();
/**
@@ -295,7 +294,7 @@ class IndexedPolicyControllerFactory implements PolicyControllerFactory {
}
synchronized (this) {
- String key = toKey(groupId,artifactId);
+ String key = toKey(groupId, artifactId);
if (this.coordinates2Controller.containsKey(key)) {
return this.coordinates2Controller.get(key);
} else {
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
index 5ab06b37..b58bcf5b 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
@@ -829,7 +829,7 @@ class PolicyEngineManager implements PolicyEngine {
}
private <T> void attempt(AtomicReference<Boolean> success, List<T> items, PredicateWithEx<T> pred,
- BiConsumer<T,Exception> handleEx) {
+ BiConsumer<T, Exception> handleEx) {
for (T item : items) {
try {
@@ -848,7 +848,7 @@ class PolicyEngineManager implements PolicyEngine {
}
private <T> void applyAll(List<T> items, Consumer<T> function,
- BiConsumer<T,Exception> handleEx) {
+ BiConsumer<T, Exception> handleEx) {
for (T item : items) {
try {
diff --git a/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java b/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
index aa4b2c61..db2062f4 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/controller/internal/MavenDroolsControllerUpgradesTest.java
@@ -187,7 +187,7 @@ public class MavenDroolsControllerUpgradesTest {
controller.getContainer()
.getPolicySession(KBSESSION_RULES)
.getKieSession()
- .addEventListener( new RuleRuntimeEventListener() {
+ .addEventListener(new RuleRuntimeEventListener() {
@Override
public void objectInserted(ObjectInsertedEvent objectInsertedEvent) {
logger.info("RULE {}: inserting {}",
@@ -205,7 +205,7 @@ public class MavenDroolsControllerUpgradesTest {
logger.info("RULE {}: deleting {}",
objectDeletedEvent.getRule().getName(), objectDeletedEvent.getOldObject());
}
- } );
+ });
controller.getContainer()
.getPolicySession(KBSESSION_RULES)
@@ -265,6 +265,6 @@ public class MavenDroolsControllerUpgradesTest {
public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent ruleFlowGroupDeactivatedEvent) {
/* do nothing */
}
- } );
+ });
}
}
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java
index d044ca6f..c37084f4 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.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.
@@ -20,11 +20,11 @@
package org.onap.policy.drools.utils;
-public class Pair<F,S> {
+public class Pair<F, S> {
protected F first;
protected S second;
-
+
public Pair(F first, S second) {
this.first = first;
this.second = second;
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 e6195fa4..4d287170 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
@@ -330,8 +330,7 @@ public class PropertyUtil {
public void run() {
try {
poll();
- }
- catch (Exception e) {
+ } catch (Exception e) {
logger.warn("Polling for property changes", e);
}
}
@@ -347,7 +346,7 @@ public class PropertyUtil {
*/
synchronized Properties addListener(Listener listener) {
listeners.add(listener);
- return (Properties)properties.clone();
+ return (Properties) properties.clone();
}
/**
@@ -420,7 +419,7 @@ public class PropertyUtil {
// Copy 'properties' and 'changedProperties', so it doesn't
// cause problems if the recipient makes changes.
final Properties tmpProperties =
- (Properties)(properties.clone());
+ (Properties) properties.clone();
final HashSet<String> tmpChangedProperties =
new HashSet<>(changedProperties);
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java
index 04817346..d37a5d92 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.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.
@@ -20,7 +20,7 @@
package org.onap.policy.drools.utils;
-public class Triple<F,S,T> {
+public class Triple<F, S, T> {
private F first;
private S second;
@@ -32,7 +32,7 @@ public class Triple<F,S,T> {
/**
* Constructor.
- *
+ *
* @param first first
* @param second second
* @param third third
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java
index ee376ba8..ca792a1c 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.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.
@@ -26,11 +26,11 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class PairTripleTest {
-
+
@Test
public void testPair() {
Pair<String, String> pair = new Pair<String, String>("foo", "bar");
-
+
assertEquals("foo", pair.first());
assertEquals("bar", pair.second());
assertEquals("foo", pair.getFirst());
@@ -45,13 +45,13 @@ public class PairTripleTest {
assertEquals("two", pair.getSecond());
assertNotNull(pair.toString());
-
- }
+
+ }
@Test
public void testTriple() {
- Triple<String, String, String> triple = new Triple<String, String,String>("foo", "bar", "fiz");
-
+ Triple<String, String, String> triple = new Triple<String, String, String>("foo", "bar", "fiz");
+
assertEquals("foo", triple.first());
assertEquals("bar", triple.second());
assertEquals("fiz", triple.third());
@@ -62,7 +62,7 @@ public class PairTripleTest {
assertEquals("one", triple.first());
assertEquals("two", triple.second());
- assertEquals("three", triple.third());
+ assertEquals("three", triple.third());
}
}
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java
index efcef272..b7feaf06 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.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.
@@ -29,38 +29,38 @@ import static org.junit.Assert.fail;
import org.junit.Test;
public class ReflectionUtilTest {
-
+
public class ParentClass {
}
-
+
public class ChildClass extends ParentClass{
}
@Test
public void testReflection() {
-
+
try {
Class<?> class1 = Class.forName("org.onap.policy.drools.utils.ReflectionUtil");
-
+
ClassLoader classLoader = class1.getClassLoader();
-
+
Class<?> class2 = ReflectionUtil.fetchClass(classLoader, "org.onap.policy.drools.utils.ReflectionUtil");
-
-
+
+
assertTrue(ReflectionUtil.isClass(classLoader, "org.onap.policy.drools.utils.ReflectionUtil"));
- assertEquals(class1,class2);
+ assertEquals(class1, class2);
assertTrue(ReflectionUtil.isSubclass(ParentClass.class, ChildClass.class));
assertFalse(ReflectionUtil.isSubclass(ChildClass.class, ParentClass.class));
-
-
+
+
} catch (ClassNotFoundException e) {
fail();
}
}
-
+
@Test(expected = IllegalArgumentException.class)
public void testException1() {
ReflectionUtil.fetchClass(null, "org.onap.policy.drools.utils.ReflectionUtil");
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/logging/MdcTransactionTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/logging/MdcTransactionTest.java
index 4a7da81c..dbf6a67c 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/logging/MdcTransactionTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/logging/MdcTransactionTest.java
@@ -169,7 +169,7 @@ public class MdcTransactionTest {
MDC.get(MdcTransactionConstants.ELAPSED_TIME));
assertEquals(trans.getServiceInstanceId(), MDC.get(MdcTransactionConstants.SERVICE_INSTANCE_ID));
assertEquals(trans.getInstanceUuid(), MDC.get(MdcTransactionConstants.INSTANCE_UUID));
- assertEquals(trans.getProcessKey(),MDC.get(MdcTransactionConstants.PROCESS_KEY));
+ assertEquals(trans.getProcessKey(), MDC.get(MdcTransactionConstants.PROCESS_KEY));
assertEquals(trans.getStatusCode(), MDC.get(MdcTransactionConstants.STATUS_CODE));
assertEquals(trans.getResponseCode(), MDC.get(MdcTransactionConstants.RESPONSE_CODE));
assertEquals(trans.getResponseDescription(), MDC.get(MdcTransactionConstants.RESPONSE_DESCRIPTION));
diff --git a/pom.xml b/pom.xml
index 84795de9..b3d9be99 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,42 +123,6 @@
<build>
<plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <executions>
- <execution>
- <id>onap-java-style</id>
- <goals>
- <goal>check</goal>
- </goals>
- <phase>process-sources</phase>
- <configuration>
- <!-- Use Google Java Style Guide: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
- with minor changes -->
- <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
- <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
- <includeResources>true</includeResources>
- <includeTestSourceDirectory>true</includeTestSourceDirectory>
- <includeTestResources>true</includeTestResources>
- <excludes>
- </excludes>
- <!-- suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation -->
- <consoleOutput>true</consoleOutput>
- <failsOnViolation>true</failsOnViolation>
- <violationSeverity>warning</violationSeverity>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.onap.oparent</groupId>
- <artifactId>checkstyle</artifactId>
- <version>${oparent.version}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>