summaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/main/java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-09-15 17:05:44 -0400
committerPamela Dragosh <pdragosh@research.att.com>2017-09-15 17:25:47 -0400
commit35c04a15d76d002d5cbc719dc855a15c4a84b962 (patch)
tree68cc8adc340a7ef1b40e1846cdc75cde1039cf4f /controlloop/common/guard/src/main/java
parentfb0b6e85027a345c23cb37ae74b23d3a8166627e (diff)
Fix sonar critical
Last transient/serializable issues. Throw a dedicated exception for DateUtil class Unused imports Make the enclosing method "static" or remove this set. Issue-ID: POLICY-115 Change-Id: I366f85922c4d4d290b320e0b88678c805de59872 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'controlloop/common/guard/src/main/java')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java16
1 files changed, 13 insertions, 3 deletions
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 afb847e09..9ee6f2310 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
@@ -59,9 +59,19 @@ import com.att.research.xacml.std.pip.engines.StdConfigurableEngine;
public class PIPEngineGetHistory extends StdConfigurableEngine{
+
private interface DateUtil{
+ public class DateUtilException extends Exception {
+ private static final long serialVersionUID = 2612662650481443076L;
+
+ public DateUtilException(String message) {
+ super(message);
+ }
+
+ }
+
public long getMs();
- public DateUtil init(String sqlValUnit) throws Exception;
+ public DateUtil init(String sqlValUnit) throws DateUtilException;
}
private static final Logger logger = LoggerFactory.getLogger(PIPEngineGetHistory.class);
@@ -338,10 +348,10 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{
private double multiplier = 0;
@Override
- public DateUtil init(String sqlValUnit) throws Exception{
+ public DateUtil init(String sqlValUnit) throws DateUtilException{
String[] split = sqlValUnit.split(" ");
if(split.length != 2){
- throw new Exception("Invalid Value Unit pair for SQL");
+ throw new DateUtilException("Invalid Value Unit pair for SQL");
}
ms = Long.parseLong(split[0]);