Fixed sonar code-smells/issues across this file
Issue-ID: DMAAP-742
Change-Id: I34b8d3a9d326b8d7a5bef4c042da314614fa4b59
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
public Response addTopic(
Topic topic
) {
public Response addTopic(
Topic topic
) {
- logger.info( "addTopic request: " + String.valueOf(topic) );
+ logger.info( "addTopic request: " + topic );
ApiService check = new ApiService();
try {
ApiService check = new ApiService();
try {
check.required( "topicDescription", topic.getTopicDescription(), "" );
check.required( "owner", topic.getOwner(), "" );
} catch( RequiredFieldException rfe ) {
check.required( "topicDescription", topic.getTopicDescription(), "" );
check.required( "owner", topic.getOwner(), "" );
} catch( RequiredFieldException rfe ) {
+ logger.error("Error", rfe);
- //String repReq = topic.getReplicationRequest();
ReplicationType t = topic.getReplicationCase();
if ( t == null || t == ReplicationType.REPLICATION_NOT_SPECIFIED ) {
topic.setReplicationCase( mr_topicService.reviewTopic(topic));
ReplicationType t = topic.getReplicationCase();
if ( t == null || t == ReplicationType.REPLICATION_NOT_SPECIFIED ) {
topic.setReplicationCase( mr_topicService.reviewTopic(topic));
try {
check.required( "fqtn", id, "" );
} catch( RequiredFieldException rfe ) {
try {
check.required( "fqtn", id, "" );
} catch( RequiredFieldException rfe ) {
+ logger.error("Error", rfe);
try {
check.required( "topicName", id, "^\\S+$" ); //no white space allowed in topicName
} catch( RequiredFieldException rfe ) {
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() );
return check.error();
}
Topic mrc = mr_topicService.getTopic( id, check.getErr() );