Fixed as per Java Code Conventions 91/30691/6
authorRich Tabedzki <richard.tabedzki@att.com>
Wed, 7 Feb 2018 16:24:22 +0000 (16:24 +0000)
committerRich Tabedzki <richard.tabedzki@att.com>
Wed, 7 Feb 2018 16:45:58 +0000 (16:45 +0000)
Changes made:
 * corrected sonar related issues in AAIClientRESTExecutor

Change-Id: I9861207fa612c11fb0a872be24085c3db488fd40
Issue-ID: CCSDK-151
Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java

index 8f624e9..252f319 100755 (executable)
@@ -194,7 +194,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
             methodsField.set(null, methods);
 
         } catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
-               LOG.warn("Adding PATCH method", e);
+            LOG.warn("Adding PATCH method", e);
         }
         LOG.info("AAIResource.ctor initialized.");
 
@@ -332,7 +332,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 try {
                     inputStream.close();
                 } catch(Exception exc) {
-
+                    LOG.warn("", exc);
                 }
             }
         }
@@ -365,8 +365,8 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                         Object object = getResourceVersionMethod.invoke(instance);
                         if(object != null)
                             resourceVersion = object.toString();
-                    } catch (InvocationTargetException x) {
-                        Throwable cause = x.getCause();
+                    } catch (InvocationTargetException exc) {
+                        LOG.warn("", exc);
                     }
                 }
             } catch(Exception exc) {
@@ -427,7 +427,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 if(inputStream != null)
                 inputStream.close();
             } catch (Exception exc) {
-
+                LOG.warn("AAIRequestExecutor.post", exc);
             }
         }
     }
@@ -504,7 +504,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 try {
                     inputStream.close();
                 } catch(Exception exc) {
-
+                    LOG.warn("delete", exc);
                 }
             }
         }
@@ -571,7 +571,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 try {
                     inputStream.close();
                 } catch(Exception exc) {
-
+                    LOG.warn("GET", exc);
                 }
             }
             con = null;
@@ -625,7 +625,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 while( ( line = reader.readLine() ) != null ) {
                     stringBuilder.append( line );
                 }
-                LOGwriteEndingTrace(responseCode, responseMessage, (stringBuilder != null) ? stringBuilder.toString() : "{no-data}");
+                LOGwriteEndingTrace(responseCode, responseMessage, (stringBuilder.length() > 0) ? stringBuilder.toString() : "{no-data}");
                 return true;
             } else {
                 StringBuilder stringBuilder = new StringBuilder();
@@ -651,7 +651,7 @@ public     class AAIClientRESTExecutor implements AAIExecutorInterface {
                 if(inputStream != null)
                 inputStream.close();
             } catch (Exception exc) {
-
+                LOG.warn("AAIRequestExecutor.patch", exc);
             }
         }
     }