diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-09-06 15:22:22 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-09-06 15:22:35 +0530 |
commit | 83ab1a763f3c1c8aafb10f5d12d4b4fe9f608743 (patch) | |
tree | 38d8d61b9397ca7376f08cefe76a61ad6d7c1e33 /src/main | |
parent | dde5c600507bd746b6978ab5e1058a894fb6bef7 (diff) |
TopicResource.java: Fixed sonar issues
Fixed sonar code-smells/issues across this file
Issue-ID: DMAAP-742
Change-Id: I34b8d3a9d326b8d7a5bef4c042da314614fa4b59
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java index 95f9d33..cab48ca 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java @@ -96,7 +96,7 @@ public class TopicResource extends BaseLoggingClass { public Response addTopic( Topic topic ) { - logger.info( "addTopic request: " + String.valueOf(topic) ); + logger.info( "addTopic request: " + topic ); ApiService check = new ApiService(); try { @@ -104,10 +104,10 @@ public class TopicResource extends BaseLoggingClass { check.required( "topicDescription", topic.getTopicDescription(), "" ); check.required( "owner", topic.getOwner(), "" ); } catch( RequiredFieldException rfe ) { + logger.error("Error", rfe); return check.error(); } - //String repReq = topic.getReplicationRequest(); ReplicationType t = topic.getReplicationCase(); if ( t == null || t == ReplicationType.REPLICATION_NOT_SPECIFIED ) { topic.setReplicationCase( mr_topicService.reviewTopic(topic)); @@ -163,6 +163,7 @@ public class TopicResource extends BaseLoggingClass { try { check.required( "fqtn", id, "" ); } catch( RequiredFieldException rfe ) { + logger.error("Error", rfe); return check.error(); } @@ -192,6 +193,7 @@ public class TopicResource extends BaseLoggingClass { try { check.required( "topicName", id, "^\\S+$" ); //no white space allowed in topicName } catch( RequiredFieldException rfe ) { + logger.error("Error", rfe); return check.error(); } Topic mrc = mr_topicService.getTopic( id, check.getErr() ); |