Fixed Sonar isssue
Fixed Sonar issue by adding a logge message in the catch block of
exception.
Issue-ID: SO-917
Change-Id: I6163d5bd0706d1b426b9dd3cbdc709d2418a1e70
Signed-off-by: GOPINATH MATHIVANAN <gopinath.mathivanan@in.ibm.com>
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
index 0ed8784..471a08b 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
@@ -15,6 +15,7 @@
* 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.
+ * Modifications Copyright (C) 2018 IBM.
* ============LICENSE_END=========================================================
*/
@@ -22,22 +23,25 @@
import javax.annotation.PreDestroy;
+import org.onap.so.asdc.client.ASDCConfiguration;
import org.onap.so.asdc.client.ASDCController;
import org.onap.so.asdc.client.exceptions.ASDCControllerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
-
+import org.onap.so.logger.MsoLogger;
import java.security.SecureRandom;
+
@Component
@Profile("!test")
public class ASDCControllerSingleton {
@Autowired
- private ASDCController asdcController;
+ private ASDCController asdcController;
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.ASDC, ASDCControllerSingleton.class);
@@ -49,8 +53,8 @@
asdcController.setControllerName("mso-controller"+randomNumber);
asdcController.initASDC();
} catch (ASDCControllerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ msoLogger.error(e);
+
}
}
@@ -59,8 +63,7 @@
try {
asdcController.closeASDC ();
} catch (ASDCControllerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ msoLogger.error(e);
}
}