Fixed sonar issues in VlantagApiServiceImpl.java 33/75133/1
authorezhil <ezhrajam@in.ibm.com>
Fri, 28 Dec 2018 17:54:51 +0000 (23:24 +0530)
committerezhil <ezhrajam@in.ibm.com>
Fri, 28 Dec 2018 17:55:02 +0000 (23:25 +0530)
Fixed major sonar issue
Change-Id: I32700d3e42f3838ab2b7498047a782492409e619
Issue-ID: CCSDK-878
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
ms/vlantag-api/src/main/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/VlantagApiServiceImpl.java

index 93f8a21..abc18c5 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************\r
  * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * \r
+ * Modifications Copyright (C) 2018 IBM.\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
@@ -192,7 +192,7 @@ public class VlantagApiServiceImpl implements VlantagApiService {
                         * so it will ignore the current range min-max in the policy. Persist in the DB\r
                         * if available else Fail.\r
                         */\r
-                       if (element.getOverwrite() != null && element.getOverwrite().equalsIgnoreCase("TRUE")) {\r
+                       if (element.getOverwrite() != null && "TRUE".equalsIgnoreCase(element.getOverwrite())) {\r
                                Range range = new Range();\r
                                range.min = Integer.parseInt(resourceValue);\r
                                rangeList.add(range);\r
@@ -223,6 +223,7 @@ public class VlantagApiServiceImpl implements VlantagApiService {
                                                return resourceValues[i].trim();\r
                                }\r
                        } catch (IndexOutOfBoundsException e) {\r
+                               log.error("Exception : " + e.getMessage(), e);\r
                                throw new VlantagApiException("No Matching Resource Value found from Recipe : \""\r
                                                + model.getResourceResolutionRecipe() + "\" for Vlantag Name : " + element.getVlantagName());\r
                        }\r