From ae2b3da4f94f0ba59708042912c941732243496f Mon Sep 17 00:00:00 2001 From: "Magnusen, Drew (dm741q)" Date: Tue, 25 Jul 2017 12:25:52 -0500 Subject: [POLICY-81] Code cleanup to eliminate the presence of warning messages in Eclipse. Change-Id: Id98fdf0241487d56707ac91cde47975c91225f3c Signed-off-by: Magnusen, Drew (dm741q) --- .../java/org/openecomp/policy/common/ia/DbDAO.java | 1 - .../policy/common/ia/jpa/IntegrityAuditEntity.java | 1 - .../common/ia/test/DbAuditCompareEntriesTest.java | 7 ++----- .../policy/common/ia/test/DbAuditTest.java | 1 - .../openecomp/policy/common/ia/test/DbDAOTest.java | 24 +++++++++++----------- .../policy/common/ia/test/jpa/IaTestEntity.java | 6 ------ 6 files changed, 14 insertions(+), 26 deletions(-) (limited to 'integrity-audit') diff --git a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java index 70f39a2b..5ab16d58 100644 --- a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java +++ b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java @@ -42,7 +42,6 @@ import javax.persistence.metamodel.Metamodel; //import org.apache.log4j.Logger; -import org.openecomp.policy.common.ia.IntegrityAuditProperties.NodeTypeEnum; import org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity; import org.openecomp.policy.common.logging.flexlogger.FlexLogger; import org.openecomp.policy.common.logging.flexlogger.Logger; diff --git a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java index 3d50d835..21b200c8 100644 --- a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java +++ b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java @@ -32,7 +32,6 @@ import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java index 5b3c7550..e2fd922d 100644 --- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java +++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java @@ -340,12 +340,9 @@ public class DbAuditCompareEntriesTest { dbDAO = new DbDAO(resourceName, persistenceUnit, properties); DbAudit dbAudit = new DbAudit(dbDAO); - @SuppressWarnings("unused") - String className = null; HashSet classNameSet = dbDAO.getPersistenceClassNames(); HashSet mismatchResult = new HashSet(); for(String c : classNameSet) { - className = c; if (c.equals("org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity")){ String resourceName1 = resourceName; String resourceName2 = resourceName; @@ -529,12 +526,12 @@ public class DbAuditCompareEntriesTest { // Add entries into DB1 dbDAO = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO dbDAO2 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); DbAudit dbAudit = new DbAudit(dbDAO); // Add entries into DB2 DbDAO dbDAO3 = new DbDAO(resourceName, persistenceUnit, properties2); - DbDAO dbDAO4 = new DbDAO("pdp2", persistenceUnit, properties2); + new DbDAO("pdp2", persistenceUnit, properties2); // Pull all entries and compare HashSet classNameSet = dbDAO.getPersistenceClassNames(); diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java index 21e3bfab..82ea8669 100644 --- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java +++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java @@ -27,7 +27,6 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.util.Date; -import java.util.HashSet; import java.util.List; import java.util.Properties; diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java index 351fe5f8..3bd847c2 100644 --- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java +++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java @@ -228,9 +228,9 @@ public class DbDAOTest { try { // Add some entries to the DB d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_drools"); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -474,8 +474,8 @@ public class DbDAOTest { try { // create entries for the IntegrityAuditEntity table d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -516,8 +516,8 @@ public class DbDAOTest { try { // create entries for the IntegrityAuditEntity table d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -578,8 +578,8 @@ public class DbDAOTest { try { // create entries for the IntegrityAuditEntity table d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -620,8 +620,8 @@ public class DbDAOTest { try { // create entries for the IntegrityAuditEntity table d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -682,8 +682,8 @@ public class DbDAOTest { try { // create entries for the IntegrityAuditEntity table d = new DbDAO(resourceName, persistenceUnit, properties); - DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties); - DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties); + new DbDAO("pdp1", persistenceUnit, properties); + new DbDAO("pdp2", persistenceUnit, properties); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java index e875fa3d..21b09460 100644 --- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java +++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java @@ -28,19 +28,13 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Lob; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.Version; -/* - * The Entity class to persist a policy object Action Body - */ @Entity @Table(name="IaTestEntity") -- cgit 1.2.3-korg