Reduce technical debt
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / DashboardController.java
index dba79e1..6679b89 100644 (file)
@@ -194,7 +194,6 @@ public class DashboardController  extends RestrictedBaseController{
                        PolicyController controller = getPolicyControllerInstance();
                        Set<OnapPDPGroup> groups = controller.getPapEngine().getOnapPDPGroups();
                        if (groups == null) {
-                               papStatus = "UNKNOWN";
                                throw new PAPException("PAP not running");
                        }else {
                                papStatus = "IS_OK";
@@ -281,8 +280,7 @@ public class DashboardController  extends RestrictedBaseController{
        private long getRequestCounts(String host, int port, String jmxAttribute) {
 
                policyLogger.debug("Create an RMI connector client and connect it to the JMX connector server");
-               HashMap map = new HashMap();
-               map = null;
+               HashMap map = null;
                JMXConnector jmxConnection;
                try {
                        jmxConnection = JMXConnectorFactory.newJMXConnector(createConnectionURL(host, port), map);
@@ -383,8 +381,7 @@ public class DashboardController  extends RestrictedBaseController{
        @SuppressWarnings({ "rawtypes", "unchecked" })
        private Object getPolicy(String host, int port, String jmxAttribute){
                policyLogger.debug("Create an RMI connector client and connect it to the JMX connector server for Policy: " + host);
-               HashMap map = new HashMap();
-               map = null;
+               HashMap map = null;
                JMXConnector jmxConnection;
                try {
                        jmxConnection = JMXConnectorFactory.newJMXConnector(createConnectionURL(host, port), map);
@@ -415,16 +412,15 @@ public class DashboardController  extends RestrictedBaseController{
        }
 
        private static String urnPolicyID(String line){
-               String[]  splitLine = line.toString().split("=");
+               String[]  splitLine = line.split("=");
                String removeSpaces = splitLine[0].replaceAll("\\s+", "");
                return removeSpaces.replace("{", "");
        }
 
        private static Integer countPolicyID(String line){
-               String[]  splitLine = line.toString().split("=");
+               String[]  splitLine = line.split("=");
                String sCount = splitLine[1].replace("}", "");
-               int intCount = Integer.parseInt(sCount);
-               return intCount;
+               return Integer.parseInt(sCount);
        }
 
 }