From ee6def99188250bf77ff6d009630cce5fb40611b Mon Sep 17 00:00:00 2001
From: "p.borelowski"
Date: Thu, 25 Apr 2019 15:06:43 +0200
Subject: Fixed Checkstyle issues
Fixed most audit checkstyle issues in the five java files
Change-Id: I73862820e662893106bfa1493e5be4791e98011b
Issue-ID: CLAMP-328
Signed-off-by: p.borelowski
---
.../java/org/onap/clamp/clds/ClampServlet.java | 24 ++++++++++---------
src/main/java/org/onap/clamp/clds/dao/CldsDao.java | 19 ++++++++-------
.../org/onap/clamp/clds/service/CldsService.java | 28 ++++++++++++----------
.../clamp/clds/service/CldsTemplateService.java | 12 ++++++----
.../onap/clamp/clds/service/CldsToscaService.java | 13 ++++++----
5 files changed, 54 insertions(+), 42 deletions(-)
(limited to 'src/main/java/org/onap')
diff --git a/src/main/java/org/onap/clamp/clds/ClampServlet.java b/src/main/java/org/onap/clamp/clds/ClampServlet.java
index 90d0693d..86524d1c 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 @@ package org.onap.clamp.clds;
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.context.SecurityContextHolder;
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 @@ public class ClampServlet extends CamelHttpTransportServlet {
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 @@ public class ClampServlet extends CamelHttpTransportServlet {
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 44228b22..16a6a748 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 @@ public class CldsDao {
}
/**
- * Helper method to setup the base template properties
+ * Helper method to setup the base template properties.
*
* @param template
* the template
@@ -474,7 +474,7 @@ public class CldsDao {
}
/**
- * 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 @@ public class CldsDao {
String dictElementShortName) {
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
List 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