diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-11-13 19:15:02 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-11-13 19:15:25 +0530 |
commit | c0e4d3de9f1758e5124a24feb236500c4dc6c32f (patch) | |
tree | 38326886a69682c37eb3156ea41421a5c9e30ba3 | |
parent | 98849e3f37c5d2e04cc961bc5953e7cd055d4304 (diff) |
Sonar Fix: JsonResponse.java
Fixed sonar issues/code-smells across this file
Issue-ID: MUSIC-179
Change-Id: If8451a522cd27c567b650e38df2ef00e9f507ca4
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r-- | src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java b/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java index a406afce..207911d7 100644 --- a/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java +++ b/src/main/java/org/onap/music/response/jsonobjects/JsonResponse.java @@ -26,12 +26,7 @@ import java.util.Map; import org.onap.music.lockingservice.MusicLockState.LockStatus; import org.onap.music.main.ResultType; -import org.powermock.core.spi.testresult.Result; -import com.datastax.driver.core.ColumnDefinitions; -import com.datastax.driver.core.ResultSet; -import com.datastax.driver.core.Row; -import com.datastax.driver.core.ColumnDefinitions.Definition; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -231,10 +226,16 @@ public class JsonResponse { public Map<String, Object> toMap() { Map<String, Object> fullMap = new HashMap<>(); fullMap.put("status", status); - if (error!=null) {fullMap.put("error", error);} - if (message!=null) {fullMap.put("message", message);} + if (error!=null) { + fullMap.put("error", error); + } + if (message!=null) { + fullMap.put("message", message); + } - if (musicVersion!=null) {fullMap.put("version", musicVersion);} + if (musicVersion!=null) { + fullMap.put("version", musicVersion); + } if (dataResult!=null) { fullMap.put("result", dataResult); @@ -242,10 +243,18 @@ public class JsonResponse { if (lock!=null) { Map<String, Object> lockMap = new HashMap<>(); - if (lock!=null) {lockMap.put("lock", lock);} - if (lockStatus!=null) {lockMap.put("lock-status", lockStatus);} - if (lockHolder!=null) {lockMap.put("lock-holder", lockHolder);} - if (lockLease!=null) {lockMap.put("lock-lease", lockLease);} + if (lock!=null) { + lockMap.put("lock", lock); + } + if (lockStatus!=null) { + lockMap.put("lock-status", lockStatus); + } + if (lockHolder!=null) { + lockMap.put("lock-holder", lockHolder); + } + if (lockLease!=null) { + lockMap.put("lock-lease", lockLease); + } fullMap.put("lock", lockMap); } |