aboutsummaryrefslogtreecommitdiffstats
path: root/feature-session-persistence/src
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-09-28 04:58:26 -0400
committerPamela Dragosh <pdragosh@research.att.com>2018-10-01 10:28:44 -0400
commita0e0c7840f72392152a970d88a5a66d394c4a793 (patch)
tree1a1976844cb52020407b4d20e019f81ec25d5abf /feature-session-persistence/src
parent367f9d25434202a4fd6f5e54cb19196c7ec3d058 (diff)
Set drools-pdp checkstyle config
Fixed last remaining checkstyle issues along with setting the pom.xml to the correct path setting. Fixed forbidden summary fragments, not allowed to prepend summary with "This method returns" Issue-ID: POLICY-1153 Change-Id: I267842080494132a7b5507731e14f027a3f6fe44 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'feature-session-persistence/src')
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/JpaDroolsSessionConnector.java6
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java47
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/EntityMgrTransTest.java4
3 files changed, 35 insertions, 22 deletions
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 381a896e..b85a6854 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
@@ -98,13 +98,13 @@ public class JpaDroolsSessionConnector implements DroolsSessionConnector {
*/
private boolean update(EntityManager em, DroolsSession sess) {
- DroolsSessionEntity s = em.find(DroolsSessionEntity.class, sess.getSessionName());
- if (s == null) {
+ DroolsSessionEntity session = em.find(DroolsSessionEntity.class, sess.getSessionName());
+ if (session == null) {
return false;
}
logger.info("update: Updating session id to {}", sess.getSessionId());
- s.setSessionId(sess.getSessionId());
+ session.setSessionId(sess.getSessionId());
return true;
}
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 7b17de6c..332e2984 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
@@ -119,14 +119,16 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public int getSequenceNumber() {
return 1;
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void globalInit(String[] args, String configDir) {
@@ -160,7 +162,8 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public PolicySession.ThreadModel selectThreadModel(PolicySession session) {
@@ -172,7 +175,8 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void disposeKieSession(PolicySession policySession) {
@@ -184,7 +188,8 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void destroyKieSession(PolicySession policySession) {
@@ -196,14 +201,16 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public boolean afterStart(PolicyEngine engine) {
return false;
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public boolean beforeStart(PolicyEngine engine) {
synchronized (cleanupLock) {
@@ -214,7 +221,8 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public boolean beforeActivate(PolicyEngine engine) {
synchronized (cleanupLock) {
@@ -225,7 +233,8 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public boolean afterActivate(PolicyEngine engine) {
return false;
@@ -686,19 +695,21 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
return "Session " + session.getFullName() + " (persistent)";
}
- /** ************************ */
+ /*=========================*/
/* 'ThreadModel' interface */
- /** ************************ */
+ /*=========================*/
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void start() {
thread.start();
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void stop() {
// tell the thread to stop
@@ -720,19 +731,21 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
}
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void updated() {
// the container artifact has been updated -- adjust the thread name
thread.setName(getThreadName());
}
- /** ********************* */
+ /*======================*/
/* 'Runnable' interface */
- /** ********************* */
+ /*======================*/
/**
- * {@inheritDoc} */
+ * {@inheritDoc}.
+ **/
@Override
public void run() {
logger.info("PersistentThreadModel running");
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/EntityMgrTransTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/EntityMgrTransTest.java
index c622a933..fb0d1102 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/EntityMgrTransTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/EntityMgrTransTest.java
@@ -98,7 +98,7 @@ public class EntityMgrTransTest {
*/
@Test
public void testEntityMgrTrans_Inactive() throws Exception {
- EntityMgrTrans emt = new EntityMgrTrans(mgr);
+ final EntityMgrTrans emt = new EntityMgrTrans(mgr);
// verify that transaction was started
verify(trans).begin();
@@ -123,7 +123,7 @@ public class EntityMgrTransTest {
when(trans.getStatus()).thenReturn(Status.STATUS_ACTIVE);
- EntityMgrTrans emt = new EntityMgrTrans(mgr);
+ final EntityMgrTrans emt = new EntityMgrTrans(mgr);
// verify that transaction was not re-started started
verify(trans, never()).begin();