diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-12-20 17:10:51 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-12-20 17:11:00 +0530 |
commit | d50289489133cae368cddd71cd32550e8244a342 (patch) | |
tree | c126c70d0786264c6571ca18c15de33945b7480c | |
parent | ec31fc3ff55b6a2e4fa3b2d04a4339c9d49cf9c9 (diff) |
Sonar fix: SdncArtifactMap.java
Fixed sonar issues/code-smells across this file
Issue-ID: CCSDK-863
Change-Id: I8c471ab3cdca84427fe88f33a82117200d916b3d
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java index 671d47a9..601569a1 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncArtifactMap.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +42,16 @@ public class SdncArtifactMap { private String rpc; private int pass; + private SdncArtifactType(String tag, String rpc, String pass) { + this.tag = tag; + this.rpc = rpc; + try { + this.pass = Integer.parseInt(pass); + } catch (Exception e) { + LOG.error("Invalid pass value for artifact map entry ({} {} {})", tag, rpc, pass, e); + } + } + public String getTag() { return tag; } @@ -58,26 +69,16 @@ public class SdncArtifactMap { public String getRpcUrl(String base) { return base+rpc; } - - private SdncArtifactType(String tag, String rpc, String pass) { - this.tag = tag; - this.rpc = rpc; - try { - this.pass = Integer.parseInt(pass); - } catch (Exception e) { - LOG.error("Invalid pass value for artifact map entry ({} {} {})", tag, rpc, pass, e); - } - } } private Map<String, SdncArtifactType> mapItems = new HashMap<>(); - private int NumPasses = 1; + private int numPasses = 1; public int getNumPasses() { - return NumPasses; + return numPasses; } public void load(String fileName) { @@ -93,8 +94,8 @@ public class SdncArtifactMap { if (lnFields.length == 3) { SdncArtifactType entry = new SdncArtifactType(lnFields[0], lnFields[1], lnFields[2]); mapItems.put(entry.getTag(), entry); - if (entry.getPass() + 1 > NumPasses ) { - NumPasses = entry.getPass() + 1; + if (entry.getPass() + 1 > numPasses ) { + numPasses = entry.getPass() + 1; } } } |