Code Enhancement (Sonar Fixes) 53/85153/1
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>
Fri, 12 Apr 2019 06:21:29 +0000 (11:51 +0530)
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>
Fri, 12 Apr 2019 06:21:29 +0000 (11:51 +0530)
Sonar Issues Fixes

Issue-ID: SO-1490

Change-Id: Ic39ad72cb0176ccee3eeab79b51fe3df19d381c7
Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java
openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java
openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java

index c852ecf..53d2595 100644 (file)
  * ============LICENSE_END=========================================================\r
  */\r
 \r
-/*\r
- * ============LICENSE_START==========================================\r
- * ===================================================================\r
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *        http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END============================================\r
- *\r
- * ECOMP and OpenECOMP are trademarks\r
- * and service marks of AT&T Intellectual Property.\r
- *\r
- */\r
 \r
 package com.woorea.openstack.base.client;\r
 \r
@@ -51,7 +29,7 @@ public abstract class OpenStackBaseException extends RuntimeException
      * Implement only the basic constructors\r
      */\r
     public OpenStackBaseException () {}\r
-    \r
+\r
     public OpenStackBaseException(String message) {\r
         super(message);\r
     }\r
@@ -59,4 +37,4 @@ public abstract class OpenStackBaseException extends RuntimeException
     public OpenStackBaseException(String message, Throwable cause) {\r
         super(message, cause);\r
     }\r
-}\r
+}
\ No newline at end of file
index 03d2b5c..23ee8dc 100644 (file)
@@ -24,17 +24,17 @@ import java.util.Properties;
 import java.util.ServiceLoader;
 
 public class OpenStackClient {
-    
+
     protected String endpoint;
-    
+
     protected OpenStackTokenProvider tokenProvider;
 
     protected static int AUTHENTICATION_RETRIES = 1;
 
     protected OpenStackClientConnector connector;
-    
+
     protected Properties properties = new Properties();
-    
+
     protected static OpenStackClientConnector DEFAULT_CONNECTOR;
 
     static {
@@ -59,7 +59,7 @@ public class OpenStackClient {
 
     public <T> OpenStackResponse request(OpenStackRequest<T> request) {
         OpenStackResponseException authException = null;
-        //System.out.println("Openstack query:"+request.toString());
+
         for (int i = 0; i <= AUTHENTICATION_RETRIES; i++) {
             request.endpoint(endpoint);
 
@@ -78,10 +78,10 @@ public class OpenStackClient {
                 tokenProvider.expireToken();
             }
         }
-       if(null == authException){
-             authException = new OpenStackResponseException("Unknown issue",500);
+        if(null == authException){
+            authException = new OpenStackResponseException("Unknown issue",500);
         }
-      throw authException;
+        throw authException;
     }
 
     public <T> T execute(OpenStackRequest<T> request) {
@@ -92,17 +92,17 @@ public class OpenStackClient {
     public void property(String property, String value) {
         properties.put(property, value);
     }
-    
+
     public void setTokenProvider(OpenStackTokenProvider tokenProvider) {
         this.tokenProvider = tokenProvider;
     }
-    
+
     public void token(String token) {
         setTokenProvider(new OpenStackSimpleTokenProvider(token));
     }
-    
+
     public <R> OpenStackRequest<R> get(String path, Class<R> returnType) {
         return new OpenStackRequest<>(this, HttpMethod.GET, path, null, returnType);
     }
-    
-}
+
+}
\ No newline at end of file
index c66b548..db87a3b 100644 (file)
  */
 
 package com.woorea.openstack.base.client;
-//package org.openstack.base.client;
-//
-//public interface OpenStackCommand<R> {
-//
-//    OpenStackRequest createRequest(OpenStackClient connector);
-//
-//}