From 82c84075c71e285d1009bbe7e183ad2f0358d335 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Tue, 27 Nov 2018 15:36:08 +0900 Subject: Fix critical sonar issues Fix rethrow the "InterruptedException" and Use "isAssignableFrom" sonar issues Issue-ID: SDC-1895 Change-Id: I2cadc08b9e7acdc84cf25a3ce9d22199711afa5d Signed-off-by: Parshad Patel --- .../openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'catalog-model/src/main/java/org') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java index 758e46544d..3a0eef1a46 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java @@ -91,7 +91,7 @@ public class CacheMangerOperation implements ICacheMangerOperation { Integer syncWorkerExacutionIntrval = applicationL2CacheConfig.getQueue().getSyncIntervalInSecondes(); log.debug("starting Sync worker:{} with executions interval:{} ", workerName, syncWorkerExacutionIntrval); SyncWorker syncWorker = new SyncWorker(workerName, this); - this.syncExecutor.scheduleAtFixedRate(syncWorker, 5 * 60, syncWorkerExacutionIntrval, TimeUnit.SECONDS); + this.syncExecutor.scheduleAtFixedRate(syncWorker, 5 * 60L, syncWorkerExacutionIntrval, TimeUnit.SECONDS); this.workerExecutor = Executors.newFixedThreadPool(numberOfWorkers, threadFactory); CacheWorker cacheWorker; for (int i = 0; i < numberOfWorkers; i++) { @@ -170,6 +170,7 @@ public class CacheMangerOperation implements ICacheMangerOperation { log.debug("all Cache workers finished"); } catch (InterruptedException e) { log.error("failed while waiting for Cache worker", e); + Thread.currentThread().interrupt(); } try { if (!workerExecutor.awaitTermination(1, TimeUnit.MINUTES)) { @@ -178,6 +179,7 @@ public class CacheMangerOperation implements ICacheMangerOperation { log.debug("sync worker finished"); } catch (InterruptedException e) { log.error("failed while waiting for sync worker", e); + Thread.currentThread().interrupt(); } } -- cgit 1.2.3-korg