Merge "Fix last technical debt"
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / onap / policy / std / StdPolicyEngine.java
index d08ea29..5842d38 100644 (file)
@@ -632,11 +632,11 @@ public class StdPolicyEngine {
                     try {
                         switch (policyConfigResponse.getType()) {
                             case JSON:
-                                JsonReader jsonReader = Json
-                                        .createReader(new StringReader(policyConfigResponse.getConfig()));
-                                JsonObject object = jsonReader.readObject();
-                                jsonReader.close();
-                                policyConfig.setJsonObject(object);
+                               try (JsonReader jsonReader = Json
+                                        .createReader(new StringReader(policyConfigResponse.getConfig())) ) {
+                                       JsonObject object = jsonReader.readObject();
+                                       policyConfig.setJsonObject(object);
+                               }
                                 break;
                             case OTHER:
                                 policyConfig.setOther(policyConfigResponse.getConfig());
@@ -1092,7 +1092,7 @@ public class StdPolicyEngine {
         PDPNotification notification;
         if (this.scheme.equals(NotificationScheme.MANUAL_ALL_NOTIFICATIONS)
                 || this.scheme.equals(NotificationScheme.MANUAL_NOTIFICATIONS)) {
-            if (notificationType.get(0).equals("ueb")) {
+            if ("ueb".equals(notificationType.get(0))) {
                 ManualClientEndUEB.start(pdps.get(0), notificationURLList, UNIQUEID);
                 notification = ManualClientEndUEB.result(scheme);
             } else if (notificationType.get(0).equals(DMAAP)) {