fixed critical issues from sonar report 59/28959/4
authorTaka <tc012c@att.com>
Tue, 23 Jan 2018 21:41:59 +0000 (16:41 -0500)
committerPatrick Brady <pb071s@att.com>
Thu, 25 Jan 2018 22:37:55 +0000 (22:37 +0000)
Change-Id: I443db1a8104bdfbfb20ec604978d758edfe7fb44
Issue-ID: APPC-429
Signed-off-by: Taka <tc012c@att.com>
appc-dispatcher/appc-dispatcher-common/lock-manager-lib/lock-manager-impl/src/main/java/org/onap/appc/lockmanager/impl/sql/MySqlConnectionFactory.java
appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/constant/Constants.java
appc-lifecycle-management/appc-lifecycle-management-core/src/main/java/org/onap/appc/lifecyclemanager/impl/LifecycleManagerImpl.java

index 7f91d21..2868e0f 100644 (file)
@@ -9,15 +9,15 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
@@ -30,10 +30,9 @@ import java.sql.SQLException;
 import org.onap.appc.dao.util.DefaultJdbcConnectionFactory;
 
 public class MySqlConnectionFactory extends DefaultJdbcConnectionFactory {
-
+    @Override
     protected void registedDriver() throws SQLException {
-    DriverManager.registerDriver(new org.mariadb.jdbc.Driver());
-    
+        DriverManager.registerDriver(new org.mariadb.jdbc.Driver());
     }
 
 }
index 37fdbcf..e1b9f1a 100644 (file)
@@ -9,15 +9,15 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
@@ -28,6 +28,9 @@ import java.util.concurrent.TimeUnit;
 
 public class Constants {
 
+    private Constants() {
+    }
+
     public static final int DEFAULT_TTL = 30;
     public static final String SUCCESS_MSG="SUCCESS";
     public static final String FAILURE_MSG="FAILURE";
index 12c48b4..70acfb7 100644 (file)
@@ -9,15 +9,15 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
@@ -76,23 +76,26 @@ public class LifecycleManagerImpl implements LifecycleManager{
         return nextState.getStateName();
     }
 
-    private StateMachine getStateMachine(String vnfType){
+    private StateMachine getStateMachine(String vnfType) {
+
+        String vnfType1 = vnfType;
+
         if (logger.isTraceEnabled()) {
-            logger.trace("Entering to getNextState with vnfType = "+ vnfType);
+            logger.trace("Entering to getNextState with vnfType = "+ vnfType1);
         }
-        if(vnfType == null){
-            vnfType = "DEFAULT";
+        if(vnfType1 == null){
+            vnfType1 = "DEFAULT";
         }
-        StateMachine machine = stateMachineMap.get(vnfType);
+        StateMachine machine = stateMachineMap.get(vnfType1);
         if(machine == null){
-            metadataReader = getMetadataReader(vnfType);
+            metadataReader = getMetadataReader(vnfType1);
             StateMachineMetadata metadata = metadataReader.readMetadata();
             machine = StateMachineFactory.getStateMachine(metadata);
-            stateMachineMap.put(vnfType,machine);
+            stateMachineMap.put(vnfType1,machine);
         }
 
-        logger.trace("Exiting getStateMachine with StateMachine = " + stateMachineMap.get(vnfType).toString());
-        return stateMachineMap.get(vnfType);
+        logger.trace("Exiting getStateMachine with StateMachine = " + stateMachineMap.get(vnfType1).toString());
+        return stateMachineMap.get(vnfType1);
     }
 
     private StateMetaDataReader getMetadataReader(String vnfType) {