Sonar major issues 27/64227/1
authorSumapriya Sarvepalli <ss00493505@techmahindra.com>
Mon, 3 Sep 2018 10:41:11 +0000 (16:11 +0530)
committerSumapriya Sarvepalli <ss00493505@techmahindra.com>
Mon, 3 Sep 2018 10:41:11 +0000 (16:11 +0530)
 This block of commented-out lines of code should be removed
Sonar Link:
https://sonar.onap.org/project/issues?assignees=sumapriya&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-VakB32hFUzlqc5wM&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/dmf/mr/service/impl/ApiKeysServiceImpl.java
Line No:L57 L142 L168 L199

Change-Id: I21b259d0be16290668230857adb4b71346af6a6c
Issue-ID: DMAAP-708
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
src/main/java/com/att/dmf/mr/service/impl/ApiKeysServiceImpl.java

index c818f88..b0e8a86 100644 (file)
@@ -54,7 +54,7 @@ import com.att.nsa.security.db.simple.NsaSimpleApiKey;
 @Service
 public class ApiKeysServiceImpl implements ApiKeysService {
 
-       //private Logger log = Logger.getLogger(ApiKeysServiceImpl.class.toString());
+       
        private static final EELFLogger log = EELFManager.getInstance().getLogger(ApiKeysServiceImpl.class.toString());
        /**
         * This method will provide all the ApiKeys present in kafka server.
@@ -139,7 +139,7 @@ public class ApiKeysServiceImpl implements ApiKeysService {
                         String kSetting_AllowAnonymousKeys= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"apiKeys.allowAnonymous");
                         if(null==kSetting_AllowAnonymousKeys) kSetting_AllowAnonymousKeys ="false";
                         
-            // if ((contactEmail == null) || (contactEmail.length() == 0))
+           
                         if ( kSetting_AllowAnonymousKeys.equalsIgnoreCase("true")    &&  !emailProvided   )
              {
                DMaaPResponseBuilder.respondWithErrorInJson(dmaapContext, 400, "You must provide an email address.");
@@ -165,7 +165,7 @@ public class ApiKeysServiceImpl implements ApiKeysService {
                        log.debug("=======ApiKeysServiceImpl: createApiKey : saving api key : "
                                        + key.toString() + "=====");
                        apiKeyDb.saveApiKey(key);
-                       // System.out.println("here4");
+                       
                        // email out the secret to validate the email address
                        if ( emailProvided )
                        {
@@ -196,9 +196,7 @@ public class ApiKeysServiceImpl implements ApiKeysService {
                                );
                        DMaaPResponseBuilder.respondOk(dmaapContext,
                                        o);
-                        /*o.put("secret", "Emailed to " + contactEmail + ".");
-                       DMaaPResponseBuilder.respondOk(dmaapContext,
-                                       o); */
+                       
                        return;
                } else {
                        log.debug("=======ApiKeysServiceImpl: createApiKey : Error in creating API Key.=====");