Sonar Fix- ProviderOperation.java 34/92334/2
authordinesha <dineshgs@in.ibm.com>
Wed, 31 Jul 2019 09:10:52 +0000 (14:40 +0530)
committerTakamune Cho <takamune.cho@att.com>
Tue, 13 Aug 2019 19:02:56 +0000 (19:02 +0000)
Fixed Sonar Issues accross the file

Issue-ID: APPC-1669
Change-Id: Idccc7e133a93f0af8d2352473d95f755f39f1ae7
Signed-off-by: dinesha <dineshgs@in.ibm.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java

index 7c16cb5..fc60f68 100644 (file)
@@ -61,6 +61,7 @@ import org.slf4j.MDC;
 \r
 public abstract class ProviderOperation implements IProviderOperation {\r
 \r
+       private static final String palos = "PALOS";\r
     private static final EELFLogger logger = EELFManager.getInstance().getLogger(ProviderOperation.class);\r
     protected static final Configuration configuration = ConfigurationFactory.getConfiguration();\r
 \r
@@ -209,9 +210,9 @@ public abstract class ProviderOperation implements IProviderOperation {
     protected void doFailure(RequestContext rc, HttpStatus code, String message, Throwable cause) throws APPCException {\r
         SvcLogicContext svcLogic = rc.getSvcLogicContext();\r
         String msg = (message == null) ? code.getReasonPhrase() : message;\r
-        if ((msg.contains("PALOS"))) {\r
-             msg = msg.substring(msg.indexOf("PALOS"), msg.length());\r
-         msg = msg.substring(msg.indexOf("PALOS"), msg.indexOf("\n"));\r
+        if ((msg.contains(palos))) {\r
+             msg = msg.substring(msg.indexOf(palos), msg.length());\r
+         msg = msg.substring(msg.indexOf(palos), msg.indexOf("\n"));\r
          } else {\r
         if (msg.contains("\n")) {\r
             msg = msg.substring(0, msg.indexOf('\n'));\r