From 1221c6bcdba722996e74c991881db6e52e158d23 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 6 Nov 2019 06:57:50 -0500 Subject: Address drools-pdp sonar issues Addressed more sonar issues in drools-pdp: - unwrap multiple instances of the same annotation (NamedQuery) - use lambda instead of anonymous class - duplicate code; addressed by using annotation instead of toString. This still leaves other duplicate code. Issue-ID: POLICY-2203 Change-Id: I8c6ff6562820af638044f134eb8a6725a5f05e8e Signed-off-by: Jim Hahn --- .../org/onap/policy/drools/activestandby/DroolsPdpEntity.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'feature-active-standby-management') 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 4175068f..078b0477 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 @@ -22,26 +22,21 @@ package org.onap.policy.drools.activestandby; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; -import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Temporal; import javax.persistence.TemporalType; import lombok.Getter; import lombok.Setter; import org.onap.policy.common.im.MonitorTime; -import org.onap.policy.drools.activestandby.DroolsPdpObject; @Entity //@Table(name="DroolsPdpEntity") -@NamedQueries({ - @NamedQuery(name = "DroolsPdpEntity.findAll", query = "SELECT e FROM DroolsPdpEntity e "), - @NamedQuery(name = "DroolsPdpEntity.deleteAll", query = "DELETE FROM DroolsPdpEntity WHERE 1=1") - }) +@NamedQuery(name = "DroolsPdpEntity.findAll", query = "SELECT e FROM DroolsPdpEntity e ") +@NamedQuery(name = "DroolsPdpEntity.deleteAll", query = "DELETE FROM DroolsPdpEntity WHERE 1=1") @Getter @Setter public class DroolsPdpEntity extends DroolsPdpObject implements Serializable { -- cgit 1.2.3-korg