diff --git a/src/main/java/org/onap/clamp/clds/ClampServlet.java b/src/main/java/org/onap/clamp/clds/ClampServlet.java
index 90d0693..86524d1 100644
--- a/src/main/java/org/onap/clamp/clds/ClampServlet.java
+++ b/src/main/java/org/onap/clamp/clds/ClampServlet.java
@@ -27,6 +27,15 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.camel.component.servlet.CamelHttpTransportServlet;
 import org.onap.clamp.clds.service.SecureServicePermission;
 import org.springframework.context.ApplicationContext;
@@ -39,14 +48,6 @@
 import org.springframework.security.core.userdetails.User;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.List;
-
 public class ClampServlet extends CamelHttpTransportServlet {
 
     /**
@@ -100,7 +101,8 @@
             permissionList.add(SecureServicePermission
                     .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance, READ));
             permissionList.add(SecureServicePermission
-                    .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance, UPDATE));
+                    .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance,
+                            UPDATE));
         }
         return permissionList;
     }
@@ -122,8 +124,8 @@
                     grantedAuths.add(new SimpleGrantedAuthority(permString));
                 }
             }
-            Authentication auth = new UsernamePasswordAuthenticationToken(new User(principal.getName(), "", grantedAuths), "",
-                    grantedAuths);
+            Authentication auth = new UsernamePasswordAuthenticationToken(new User(principal.getName(), "",
+                    grantedAuths), "", grantedAuths);
             SecurityContextHolder.getContext().setAuthentication(auth);
         }
         try {
diff --git a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
index 44228b2..16a6a74 100644
--- a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
+++ b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
@@ -352,7 +352,7 @@
     }
 
     /**
-     * Helper method to setup the base template properties
+     * Helper method to setup the base template properties.
      *
      * @param template
      *  the template
@@ -474,7 +474,7 @@
     }
 
     /**
-     * Helper method to setup the event prop to the CldsEvent class
+     * Helper method to setup the event prop to the CldsEvent class.
      *
      * @param event
      *  the clds event
@@ -742,12 +742,13 @@
         String dictElementShortName) {
         SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
         List<CldsDictionaryItem> dictionaryItems = new ArrayList<>();
-        String dictionarySql = new StringBuilder("SELECT de.dict_element_id, de.dictionary_id, de.dict_element_name, " +
-                "de.dict_element_short_name, de.dict_element_description, de.dict_element_type, de.created_by, " +
-                "de.modified_by, de.timestamp FROM dictionary_elements de, " +
-                "dictionary d WHERE de.dictionary_id = d.dictionary_id")
+        String dictionarySql = new StringBuilder("SELECT de.dict_element_id, de.dictionary_id, de.dict_element_name, "
+                + "de.dict_element_short_name, de.dict_element_description, de.dict_element_type, de.created_by, "
+                + "de.modified_by, de.timestamp FROM dictionary_elements de, "
+                + "dictionary d WHERE de.dictionary_id = d.dictionary_id")
                 .append((dictionaryId != null) ? (" AND d.dictionary_id = '" + dictionaryId + "'") : "")
-                .append((dictElementShortName != null) ? (" AND de.dict_element_short_name = '" + dictElementShortName + "'") : "")
+                .append((dictElementShortName != null) ? (" AND de.dict_element_short_name = '" + dictElementShortName
+                        + "'") : "")
                 .append((dictionaryName != null) ? (" AND dictionary_name = '" + dictionaryName + "'") : "").toString();
 
         List<Map<String, Object>> rows = jdbcTemplateObject.queryForList(dictionarySql);
@@ -780,8 +781,8 @@
      */
     public Map<String, String> getDictionaryElementsByType(String dictionaryElementType) {
         Map<String, String> dictionaryItems = new HashMap<>();
-        String dictionarySql = new StringBuilder("SELECT dict_element_name, dict_element_short_name " +
-                "FROM dictionary_elements WHERE dict_element_type = '")
+        String dictionarySql = new StringBuilder("SELECT dict_element_name, dict_element_short_name "
+                + "FROM dictionary_elements WHERE dict_element_type = '")
                 .append(dictionaryElementType).append("'").toString();
 
         List<Map<String, Object>> rows = jdbcTemplateObject.queryForList(dictionarySql);
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index e81cc15..63a9133 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * 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
@@ -203,7 +205,7 @@
     public List<CldsMonitoringDetails> getCldsDetails() {
         util.entering(request, "CldsService: GET model details");
         Date startTime = new Date();
-        List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsDao.getCldsMonitoringDetails();
+        final List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsDao.getCldsMonitoringDetails();
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET cldsDetails completed");
@@ -223,7 +225,7 @@
         LoggingUtils.setTimeContext(startTime, new Date());
 
         CldsInfoProvider cldsInfoProvider = new CldsInfoProvider(this);
-        CldsInfo cldsInfo = cldsInfoProvider.getCldsInfo();
+        final CldsInfo cldsInfo = cldsInfoProvider.getCldsInfo();
 
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
@@ -245,7 +247,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadCl);
         logger.info("GET bpmnText for modelName={}", modelName);
-        CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
+        final CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET model bpmn completed");
@@ -266,7 +268,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadCl);
         logger.info("GET imageText for modelName={}", modelName);
-        CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
+        final CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET model image completed");
@@ -282,7 +284,7 @@
      */
     public CldsModel getModel(String modelName) {
         util.entering(request, "CldsService: GET model");
-        Date startTime = new Date();
+        final Date startTime = new Date();
         isAuthorized(permissionReadCl);
         logger.debug("GET model for  modelName={}", modelName);
         CldsModel cldsModel = CldsModel.retrieve(cldsDao, modelName, false);
@@ -323,7 +325,7 @@
      */
     public CldsModel putModel(String modelName, CldsModel cldsModel) {
         util.entering(request, "CldsService: PUT model");
-        Date startTime = new Date();
+        final Date startTime = new Date();
         isAuthorized(permissionUpdateCl);
         isAuthorizedForVf(cldsModel);
         logger.info("PUT model for  modelName={}", modelName);
@@ -350,7 +352,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadCl);
         logger.info("GET list of model names");
-        List<ValueItem> names = cldsDao.getModelNames();
+        final List<ValueItem> names = cldsDao.getModelNames();
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET model names completed");
@@ -409,11 +411,11 @@
             model.save(cldsDao, getUserId());
 
             // get vars and format if necessary
-            String prop = model.getPropText();
-            String bpmn = model.getBpmnText();
-            String docText = model.getDocText();
-            String controlName = model.getControlName();
-            String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
+            final String prop = model.getPropText();
+            final String bpmn = model.getBpmnText();
+            final String docText = model.getDocText();
+            final String controlName = model.getControlName();
+            final String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
             logger.info("PUT bpmnJson={}", bpmnJson);
             // Test flag coming from UI or from Clamp config
             boolean isTest = Boolean.parseBoolean(test)
@@ -471,7 +473,7 @@
      */
     public String postDcaeEvent(String test, DcaeEvent dcaeEvent) {
         util.entering(request, "CldsService: Post dcae event");
-        Date startTime = new Date();
+        final Date startTime = new Date();
         String userid = null;
         // TODO: allow auth checking to be turned off by removing the permission
         // type property
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
index f60c638..d107731 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * 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
@@ -79,7 +81,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadTemplate);
         logger.info("GET bpmnText for templateName=" + templateName);
-        CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
+        final CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET template bpmn completed");
@@ -100,7 +102,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadTemplate);
         logger.info("GET imageText for templateName=" + templateName);
-        CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
+        final CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET template image completed");
@@ -116,7 +118,7 @@
      */
     public CldsTemplate getTemplate(String templateName) {
         util.entering(request, "CldsTemplateService: GET template");
-        Date startTime = new Date();
+        final Date startTime = new Date();
         isAuthorized(permissionReadTemplate);
         logger.info("GET model for  templateName=" + templateName);
         CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
@@ -137,7 +139,7 @@
      */
     public CldsTemplate putTemplate(String templateName, CldsTemplate cldsTemplate) {
         util.entering(request, "CldsTemplateService: PUT template");
-        Date startTime = new Date();
+        final Date startTime = new Date();
         isAuthorized(permissionUpdateTemplate);
         logger.info("PUT Template for  templateName=" + templateName);
         logger.info("PUT bpmnText=" + cldsTemplate.getBpmnText());
@@ -162,7 +164,7 @@
         Date startTime = new Date();
         isAuthorized(permissionReadTemplate);
         logger.info("GET list of template names");
-        List<ValueItem> names = cldsDao.getTemplateNames();
+        final List<ValueItem> names = cldsDao.getTemplateNames();
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("GET template names completed");
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
index f2c75ea..81bafef 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * 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
@@ -84,7 +86,7 @@
      *         type
      */
     public ResponseEntity<?> parseToscaModelAndSave(String toscaModelName, CldsToscaModel cldsToscaModel) {
-        Date startTime = new Date();
+        final Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsToscaService: Parse Tosca model and save", getPrincipalName());
         // TODO revisit based on new permissions
         isAuthorized(permissionUpdateTosca);
@@ -107,7 +109,7 @@
         LoggingUtils.setRequestContext("CldsToscaService: Get All tosca models", getPrincipalName());
         // TODO revisit based on new permissions
         isAuthorized(permissionReadTosca);
-        List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getAllToscaModels()).get();
+        final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getAllToscaModels()).get();
         LoggingUtils.setTimeContext(startTime, new Date());
         LoggingUtils.setResponseContext("0", "Get All tosca models success", this.getClass().getName());
         auditLogger.info("Get All tosca models");
@@ -128,7 +130,8 @@
         LoggingUtils.setRequestContext("CldsToscaService: Get tosca models by model name", getPrincipalName());
         // TODO revisit based on new permissions
         isAuthorized(permissionReadTosca);
-        List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByName(toscaModelName)).get();
+        final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByName(toscaModelName))
+                .get();
         LoggingUtils.setTimeContext(startTime, new Date());
         LoggingUtils.setResponseContext("0", "Get tosca models by model name success", this.getClass().getName());
         auditLogger.info("GET tosca models by model name completed");
@@ -140,6 +143,7 @@
      * from the database.
      * 
      * @param policyType
+     *            The type of the policy
      * @return clds tosca model - CLDS tosca model for a given policy type
      */
     public CldsToscaModel getToscaModelsByPolicyType(String policyType) {
@@ -147,7 +151,8 @@
         LoggingUtils.setRequestContext("CldsToscaService: Get tosca models by policyType", getPrincipalName());
         // TODO revisit based on new permissions
         isAuthorized(permissionReadTosca);
-        List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByPolicyType(policyType)).get();
+        final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByPolicyType(policyType))
+                .get();
         LoggingUtils.setTimeContext(startTime, new Date());
         LoggingUtils.setResponseContext("0", "Get tosca models by policyType success", this.getClass().getName());
         auditLogger.info("GET tosca models by policyType completed");
