Use Integer.toString() for type conversion 59/14459/1
authorsurya-huawei <a.u.surya@huawei.com>
Fri, 22 Sep 2017 05:25:16 +0000 (10:55 +0530)
committersurya-huawei <a.u.surya@huawei.com>
Fri, 22 Sep 2017 05:28:47 +0000 (10:58 +0530)
Major sonar issue in sli/adaptors module
*Intead of implicit type conversion use static method
to save memory and cycles

Issue-Id: CCSDK-87
Change-Id: Icb75229ffb41bdf8b683f2a306acc856ce9106f6
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java

index 04a0c59..0cc23de 100755 (executable)
@@ -281,7 +281,7 @@ public abstract class AAIDeclarations implements AAIClient {
                     } catch (AAIServiceException aaiexc) {
                         ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage());
                         if (aaiexc.getReturnCode() >= 300) {
-                            ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode());
+                            ctx.setAttribute(prefix + ".error.http" + "" + ".response-code", Integer.toString(aaiexc.getReturnCode()));
                         }
 
                         if (aaiexc.getReturnCode() == 404)
@@ -303,7 +303,7 @@ public abstract class AAIDeclarations implements AAIClient {
                     } catch (AAIServiceException aaiexc) {
                         ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage());
                         if (aaiexc.getReturnCode() >= 300) {
-                            ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode());
+                            ctx.setAttribute(prefix + ".error.http" + ".response-code", Integer.toString(aaiexc.getReturnCode()));
                         }
 
                         if (aaiexc.getReturnCode() == 404)
@@ -521,7 +521,7 @@ public abstract class AAIDeclarations implements AAIClient {
                 if(exc instanceof AAIServiceException) {
                     AAIServiceException aaiexc = (AAIServiceException)exc;
                     if(aaiexc.getReturnCode() >= 300) {
-                        ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode());
+                        ctx.setAttribute(prefix + ".error.http" + ".response-code", Integer.toString(aaiexc.getReturnCode()));
                     }
 
                     if(aaiexc.getReturnCode() == 404) {