From 23808f02e323e745df5749b770cba02fd5c0bfc8 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 15 Sep 2017 11:41:47 -0400 Subject: Fix sonar criticals Either re-interrupt this method or rethrow Exception Transient/Serializable issues Unused imports logging exceptions Issue-ID: POLICY-115 Change-Id: I4c8a0c780e2f6c6e8218c1457f18470f7d95919c Signed-off-by: Pamela Dragosh --- .../guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java | 2 +- .../src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java | 2 +- .../guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java | 2 +- .../guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java | 2 +- .../guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'controlloop/common/guard/src/main/java/org') diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java index 6be59d668..afb847e09 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java @@ -387,7 +387,7 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{ try { diff = now - dateUtil.init(timeWindow).getMs(); } catch (Exception ex) { - System.err.println("PIP thread got Exception " + ex.getLocalizedMessage()); + logger.error("PIP thread got Exception " + ex); return -1; } diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java index dbaf711c4..5ecb44162 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java @@ -140,7 +140,7 @@ public class PolicyGuardXacmlHelper { } catch (Exception e) { String message = "Parsing Content-Type: " + connection.getContentType() + ", error=" + e.getMessage(); - logger.error("{}: callRESTfulPDP threw: ", message); + logger.error("{}: callRESTfulPDP threw: ", message, e); } } else { diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java index ea966ea55..62ddb0d71 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/PNFTargetLock.java @@ -38,7 +38,7 @@ public class PNFTargetLock implements TargetLock, Serializable { private final TargetType targetType; private final String target; private final UUID requestID; - private final LockCallback callback; + private final transient LockCallback callback; public PNFTargetLock (TargetType type, String target, UUID requestID, LockCallback callback) { this.lockID = UUID.randomUUID(); diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java index 1de105ce4..0a7556bc9 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VMTargetLock.java @@ -37,7 +37,7 @@ public class VMTargetLock implements TargetLock, Serializable { private final TargetType targetType; private final String target; private final UUID requestID; - private final LockCallback callback; + private final transient LockCallback callback; public VMTargetLock(TargetType targetType, String target, UUID requestID, LockCallback callback) { this.lockID = UUID.randomUUID(); diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java index 1350d5c54..b6e49b578 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/impl/VNFTargetLock.java @@ -38,7 +38,7 @@ public class VNFTargetLock implements TargetLock, Serializable { private final TargetType targetType; private final String target; private final UUID requestID; - private final LockCallback callback; + private final transient LockCallback callback; public VNFTargetLock (TargetType type, String target, UUID requestID, LockCallback callback) { this.lockID = UUID.randomUUID(); -- cgit 1.2.3-korg