removed code smells 40/104840/1
authorRupinder <rupinsi1@in.ibm.com>
Wed, 1 Apr 2020 10:11:21 +0000 (15:41 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Wed, 1 Apr 2020 10:11:31 +0000 (15:41 +0530)
Removed some unused imports and two statements from one line

Issue-ID: DMAAP-1415
Change-Id: I2802078fc8063a65de748d2399710f97c9adee8e
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
src/main/java/org/onap/dmaap/dmf/mr/resources/streamReaders/CambriaTextStreamReader.java
src/main/java/org/onap/dmaap/dmf/mr/service/impl/ApiKeysServiceImpl.java
src/main/java/org/onap/dmaap/dmf/mr/service/impl/ErrorResponseProvider.java
src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java
src/main/java/org/onap/dmaap/dmf/mr/utils/Utils.java

index 67a31bb..bf9e544 100644 (file)
@@ -66,8 +66,10 @@ public class CambriaTextStreamReader implements reader
                try
                {
                        final String line = fReader.readLine ();
-                       if ( line == null ) return null;
-
+                       if ( line == null ) {
+                               return null;
+                       }
+                       
                        return new message ()
                        {
                                private LogDetails logDetails;
index d9559bb..d6fd89e 100644 (file)
@@ -137,8 +137,9 @@ public class ApiKeysServiceImpl implements ApiKeysService {
                        String contactEmail = nsaApiKey.getEmail();
                        final boolean emailProvided = contactEmail != null && contactEmail.length() > 0 && contactEmail.indexOf("@") > 1 ;
                         String kSetting_AllowAnonymousKeys= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"apiKeys.allowAnonymous");
-                        if(null==kSetting_AllowAnonymousKeys) kSetting_AllowAnonymousKeys ="false";
-                        
+                        if(null==kSetting_AllowAnonymousKeys) {
+                                kSetting_AllowAnonymousKeys ="false";
+                        }
            
                         if ( kSetting_AllowAnonymousKeys.equalsIgnoreCase("true")    &&  !emailProvided   )
              {
index 50a611e..da22345 100644 (file)
@@ -21,7 +21,6 @@ package org.onap.dmaap.dmf.mr.service.impl;
 import com.google.common.base.Preconditions;
 import java.util.Date;
 import org.apache.http.HttpStatus;
-import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
 import org.onap.dmaap.dmf.mr.exception.DMaaPErrorMessages;
 import org.onap.dmaap.dmf.mr.exception.DMaaPResponseCode;
 import org.onap.dmaap.dmf.mr.exception.ErrorResponse;
index 800bb0f..5688dcc 100644 (file)
@@ -38,7 +38,6 @@ import org.onap.dmaap.dmf.mr.backends.memory.MemoryMetaBroker;
 import org.onap.dmaap.dmf.mr.backends.memory.MemoryQueue;
 import org.onap.dmaap.dmf.mr.backends.memory.MemoryQueuePublisher;
 import org.onap.dmaap.dmf.mr.beans.DMaaPCambriaLimiter;
-import org.onap.dmaap.dmf.mr.beans.DMaaPKafkaMetaBroker;
 import org.onap.dmaap.dmf.mr.beans.DMaaPZkConfigDb;
 import org.onap.dmaap.dmf.mr.constants.CambriaConstants;
 import org.onap.dmaap.dmf.mr.metabroker.Broker;
@@ -147,8 +146,10 @@ public class ConfigurationReader {
                
                long allowedtimeSkewMs=600000L;
                String strallowedTimeSkewM= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"authentication.allowedTimeSkewMs");
-               if(null!=strallowedTimeSkewM)allowedtimeSkewMs= Long.parseLong(strallowedTimeSkewM);
-                               
+               if(null!=strallowedTimeSkewM)
+               {
+                       allowedtimeSkewMs= Long.parseLong(strallowedTimeSkewM);
+               }       
        
                //String strrequireSecureChannel= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"aauthentication.requireSecureChannel");
                //if(strrequireSecureChannel!=null)requireSecureChannel=Boolean.parseBoolean(strrequireSecureChannel);
@@ -181,7 +182,9 @@ public class ConfigurationReader {
                        // setup a backend
                        
                         String type = com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,CambriaConstants.kBrokerType);
-                       if (type==null) type = CambriaConstants.kBrokerType_Kafka;
+                       if (type==null){
+                               type = CambriaConstants.kBrokerType_Kafka;
+                       }
                        if (CambriaConstants.kBrokerType_Kafka.equalsIgnoreCase(type)) {
                                log.info("Broker Type is:" + CambriaConstants.kBrokerType_Kafka);
                        } else if (CambriaConstants.kBrokerType_Memory.equalsIgnoreCase(type)) {
@@ -454,7 +457,9 @@ public class ConfigurationReader {
                
                
                 String zkServername = com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,CambriaConstants.kSetting_ZkConfigDbServers);
-                if (zkServername==null) zkServername=CambriaConstants.kDefault_ZkConfigDbServers;
+                if (zkServername==null){
+                        zkServername=CambriaConstants.kDefault_ZkConfigDbServers;
+                }
                 return zkServername;
        }
 
index 40e6840..174d80b 100644 (file)
@@ -33,8 +33,6 @@ import java.util.List;
 import java.util.Properties;
 
 import javax.servlet.http.HttpServletRequest;
-
-import org.onap.dmaap.dmf.mr.backends.kafka.KafkaPublisher;
 import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
@@ -133,7 +131,10 @@ public class Utils {
         */
        public static long getSleepMsForRate ( double ratePerMinute )
        {
-               if ( ratePerMinute <= 0.0 ) return 0;
+               if ( ratePerMinute <= 0.0 ) 
+               {
+                       return 0;
+               }
                return Math.max ( 1000, Math.round ( 60 * 1000 / ratePerMinute ) );
        }