diff options
author | Parshad Patel <pars.patel@samsung.com> | 2019-02-14 20:06:34 +0900 |
---|---|---|
committer | Parshad Patel <pars.patel@samsung.com> | 2019-02-14 20:10:54 +0900 |
commit | b1926b2ba40019232e0e3cad83fe54ba6722ea78 (patch) | |
tree | 1e275af4b3f9c6fb31af5e3caeed59c36db05f62 | |
parent | 4993f743c705964d12276cc6ba1805922d38ae12 (diff) |
Fix sonar issue in dmaap-messagerouter-msgrtr
Fix Cast one of the operands of multiplication operation to a "long"
Fix Either re-interrupt method or rethrow the "InterruptedException"
Issue-ID: DMAAP-894
Change-Id: I150cdc8ac96a05799196ca27d683c0921a76fe92
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
5 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java b/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java index 7db9f54..2091e5f 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java @@ -157,7 +157,7 @@ public class DMaaPCambriaLimiter { } } catch (InterruptedException e) { log.error("Exception "+ e); - // ignore + Thread.currentThread().interrupt(); } diff --git a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java index 634ea80..f59f704 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java @@ -198,6 +198,7 @@ public class DMaaPCambriaSimplerBatchPublisher extends CambriaBaseClient } } catch (InterruptedException e) { getLog().warn("Possible message loss. " + e.getMessage(), e); + Thread.currentThread().interrupt(); } catch (IOException e) { getLog().warn("Possible message loss. " + e.getMessage(), e); } diff --git a/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java b/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java index f71bda0..537fc22 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java @@ -333,7 +333,7 @@ public class CambriaOutboundEventStream implements StreamWriter { // FIXME: would be good to wait/signal Thread.sleep(100); } catch (InterruptedException e) { - // ignore + Thread.currentThread().interrupt(); } } }); diff --git a/src/main/java/org/onap/dmaap/dmf/mr/security/DMaaPAuthenticatorImpl.java b/src/main/java/org/onap/dmaap/dmf/mr/security/DMaaPAuthenticatorImpl.java index f0d0d4d..3473c1e 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/security/DMaaPAuthenticatorImpl.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/security/DMaaPAuthenticatorImpl.java @@ -46,7 +46,7 @@ public class DMaaPAuthenticatorImpl<K extends NsaApiKey> implements DMaaPAuthent // Setting timeout to a large value for testing purpose. // 10 minutes - private static final long kDefaultRequestTimeWindow = 1000 * 60 * 10 * 10 * 10 * 10 * 10; + private static final long kDefaultRequestTimeWindow = 1000L * 60 * 10 * 10 * 10 * 10 * 10; /** * Construct the security manager against an API key database diff --git a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/MMServiceImpl.java b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/MMServiceImpl.java index d862677..82ff80a 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/MMServiceImpl.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/MMServiceImpl.java @@ -349,7 +349,7 @@ public class MMServiceImpl implements MMService { final long startMs = System.currentTimeMillis(); long count = 0; - long maxEventBatch = 1024 * 16; + long maxEventBatch = 1024L * 16; String batchlen = AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop, BATCH_LENGTH); if (null != batchlen) maxEventBatch = Long.parseLong(batchlen); |