summaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/main
diff options
context:
space:
mode:
authorTemoc Rodriguez <cr056n@att.com>2017-11-28 09:59:02 -0800
committerTemoc Rodriguez <cr056n@att.com>2017-12-05 09:36:31 -0800
commit39672906602cbd5b734b8c9889234653e4beaf26 (patch)
tree257e1da810bcb41f1a95f4072af03d686675be50 /integrity-audit/src/main
parent496a8e0a4d4b53136a8612ad4e3369a3c6562674 (diff)
Fix technical debt in common integrity-audit
Address technical debt in policy/common integrity-audit submodule. Implementation for empty constructors, remove useless assignment, use <> on constructor, use @Override. Not all technical debt addressed, only the ones specified by Pam in POLICY-336, except the use Set instead of HashSet where a method signature would change. Issue-ID: POLICY-456 Change-Id: If8f9f4151503bdd22c8c405485538f8be779cabd Signed-off-by: Temoc Rodriguez <cr056n@att.com>
Diffstat (limited to 'integrity-audit/src/main')
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java6
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/DbAudit.java2
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/DbAuditException.java1
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/DbDaoTransactionException.java1
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditException.java1
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditPropertiesException.java1
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java1
7 files changed, 9 insertions, 4 deletions
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
index 2e15da5f..e3cada9d 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
@@ -132,6 +132,7 @@ public class AuditThread extends Thread {
}
+ @Override
public void run() {
logger.info("AuditThread.run: Entering");
@@ -327,7 +328,7 @@ public class AuditThread extends Thread {
+ integrityAuditEntityList.size());
}
- IntegrityAuditEntity designationCandidate = null;
+ IntegrityAuditEntity designationCandidate;
IntegrityAuditEntity thisEntity = null;
int designatedEntityIndex = -1;
@@ -552,8 +553,7 @@ public class AuditThread extends Thread {
* Sorted list of entities for a particular nodeType and
* persistenceUnit.
*/
- List<IntegrityAuditEntity> integrityAuditEntityList = new ArrayList<IntegrityAuditEntity>();
- integrityAuditEntityList = dbDAO.getIntegrityAuditEntities(
+ List<IntegrityAuditEntity> integrityAuditEntityList = dbDAO.getIntegrityAuditEntities(
this.persistenceUnit, this.nodeType);
int listSize = integrityAuditEntityList.size();
if (logger.isDebugEnabled()) {
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAudit.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAudit.java
index 8a1a521b..0f354571 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAudit.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAudit.java
@@ -241,7 +241,7 @@ public class DbAudit {
}
// If misMatchedMap is not empty, retrieve the entries in each misMatched list and compare again
- classNameSet = new HashSet<String>(misMatchedMap.keySet());
+ classNameSet = new HashSet<>(misMatchedMap.keySet());
// We need to keep track of how long the audit is taking
startTime = System.currentTimeMillis();
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAuditException.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAuditException.java
index f5cd183f..8f00bf86 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAuditException.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbAuditException.java
@@ -23,6 +23,7 @@ package org.onap.policy.common.ia;
public class DbAuditException extends Exception{
private static final long serialVersionUID = 1L;
public DbAuditException() {
+ super();
}
public DbAuditException(String message) {
super(message);
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDaoTransactionException.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDaoTransactionException.java
index 4ad8521a..344ea6a5 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDaoTransactionException.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDaoTransactionException.java
@@ -23,6 +23,7 @@ package org.onap.policy.common.ia;
public class DbDaoTransactionException extends Exception{
private static final long serialVersionUID = 1L;
public DbDaoTransactionException() {
+ super();
}
public DbDaoTransactionException(String message) {
super(message);
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditException.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditException.java
index df0414b3..a62c837c 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditException.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditException.java
@@ -23,6 +23,7 @@ package org.onap.policy.common.ia;
public class IntegrityAuditException extends Exception{
private static final long serialVersionUID = 1L;
public IntegrityAuditException() {
+ super();
}
public IntegrityAuditException(String message) {
super(message);
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditPropertiesException.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditPropertiesException.java
index b62e9064..0480abf1 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditPropertiesException.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditPropertiesException.java
@@ -23,6 +23,7 @@ package org.onap.policy.common.ia;
public class IntegrityAuditPropertiesException extends Exception{
private static final long serialVersionUID = 1L;
public IntegrityAuditPropertiesException() {
+ super();
}
public IntegrityAuditPropertiesException(String message) {
super(message);
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java
index 50e25159..fb8823f5 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java
@@ -93,6 +93,7 @@ public class IntegrityAuditEntity implements Serializable {
public IntegrityAuditEntity() {
+ // Empty constructor
}
@PrePersist