Fix sonar bugs in sdnc-a1-controller 04/2804/1
authorRehanRaza <muhammad.rehan.raza@est.tech>
Mon, 16 Mar 2020 12:43:41 +0000 (13:43 +0100)
committerRehanRaza <muhammad.rehan.raza@est.tech>
Mon, 16 Mar 2020 12:44:19 +0000 (13:44 +0100)
Change-Id: I3fde295b25c2b7b9534422424221f29a0e03290d
Issue-ID: NONRTRIC-116
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/provider/NonrtRicApiProvider.java

index f67508f..c0c46a7 100644 (file)
@@ -126,15 +126,13 @@ public class NonrtRicApiProvider implements AutoCloseable, A1ADAPTERAPIService {
   private static class Iso8601Util {
 
     private static TimeZone timeZone = TimeZone.getTimeZone("UTC");
-    private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+    private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
 
-    private Iso8601Util() {}
-
-    static {
+    private Iso8601Util() {
       dateFormat.setTimeZone(timeZone);
     }
 
-    private static String now() {
+    private String now() {
       return dateFormat.format(new Date());
     }
   }
@@ -172,6 +170,7 @@ public class NonrtRicApiProvider implements AutoCloseable, A1ADAPTERAPIService {
 
     } catch (InterruptedException | ExecutionException e) {
       log.error("Create containers failed: ", e);
+      Thread.currentThread().interrupt();
     }
   }