reduced some code smells 95/107295/2
authorIndrijeet kumar <indriku1@in.ibm.com>
Thu, 7 May 2020 04:27:19 +0000 (09:57 +0530)
committerIndrijeet Kumar <indriku1@in.ibm.com>
Thu, 7 May 2020 13:32:45 +0000 (13:32 +0000)
reduced some code smells

Issue-ID: PORTAL-813
Change-Id: I5de9eef7f9b4e7983a2893fe91c83226fe1903cd
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
13 files changed:
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceList.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/FormFieldList.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/FormatList.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/JavascriptList.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ObjectFactory.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/PredefinedValueList.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ReportMap.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/SemaphoreList.java
ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CollaborateListController.java
ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/DS2SampleController.java
ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/SharedContextRestClient.java
ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java
ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserProfileServiceImpl.java

index 86f2d9c..ac69dbd 100644 (file)
@@ -40,7 +40,6 @@
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
 // Generated on: 2016.06.07 at 02:07:29 PM EDT 
-//
 
 
 package org.onap.portalsdk.analytics.xmlobj;
@@ -104,7 +103,7 @@ public class DataSourceList {
      */
     public List<DataSourceType> getDataSource() {
         if (dataSource == null) {
-            dataSource = new ArrayList<DataSourceType>();
+            dataSource = new ArrayList<>();
         }
         return this.dataSource;
     }
index 9ddba79..817075d 100644 (file)
@@ -107,7 +107,7 @@ public class FormFieldList {
      */
     public List<FormFieldType> getFormField() {
         if (formField == null) {
-            formField = new ArrayList<FormFieldType>();
+            formField = new ArrayList<>();
         }
         return this.formField;
     }
index 129f500..d403798 100644 (file)
@@ -106,7 +106,7 @@ public class FormatList {
      */
     public List<FormatType> getFormat() {
         if (format == null) {
-            format = new ArrayList<FormatType>();
+            format = new ArrayList<>();
         }
         return this.format;
     }
index d2c0411..18d0667 100644 (file)
@@ -110,7 +110,7 @@ public class JavascriptList {
      */
     public List<JavascriptItemType> getJavascriptItem() {
         if (javascriptItem == null) {
-            javascriptItem = new ArrayList<JavascriptItemType>();
+            javascriptItem = new ArrayList<>();
         }
         return this.javascriptItem;
     }
index 189b44b..647afdb 100644 (file)
@@ -308,7 +308,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(namespace = "", name = "customReport")
     public JAXBElement<CustomReportType> createCustomReport(CustomReportType value) {
-        return new JAXBElement<CustomReportType>(_CustomReport_QNAME, CustomReportType.class, null, value);
+        return new JAXBElement<>(_CustomReport_QNAME, CustomReportType.class, null, value);
     }
 
     /**
@@ -317,7 +317,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(namespace = "", name = "comment")
     public JAXBElement<String> createComment(String value) {
-        return new JAXBElement<String>(_Comment_QNAME, String.class, null, value);
+        return new JAXBElement<>(_Comment_QNAME, String.class, null, value);
     }
 
 }
index 29baaf6..0752cab 100644 (file)
@@ -104,7 +104,7 @@ public class PredefinedValueList {
      */
     public List<String> getPredefinedValue() {
         if (predefinedValue == null) {
-            predefinedValue = new ArrayList<String>();
+            predefinedValue = new ArrayList<>();
         }
         return this.predefinedValue;
     }
index d0ce878..e4d4243 100644 (file)
@@ -455,7 +455,7 @@ public class ReportMap {
      */
     public List<Marker> getMarkers() {
         if (markers == null) {
-            markers = new ArrayList<Marker>();
+            markers = new ArrayList<>();
         }
         return this.markers;
     }
index 4193093..dc1d6b8 100644 (file)
@@ -104,7 +104,7 @@ public class SemaphoreList {
      */
     public List<SemaphoreType> getSemaphore() {
         if (semaphore == null) {
-            semaphore = new ArrayList<SemaphoreType>();
+            semaphore = new ArrayList<>();
         }
         return this.semaphore;
     }
index a133a15..e251525 100644 (file)
@@ -70,7 +70,7 @@ public class CollaborateListController  extends RestrictedBaseController {
        
        @RequestMapping(value = {"/collaborate_list" }, method = RequestMethod.GET)
        public ModelAndView ProfileSearch(HttpServletRequest request) {
-               Map<String, Object> model = new HashMap<String, Object>();
+               Map<String, Object> model = new HashMap<>();
                ObjectMapper mapper = new ObjectMapper();
                User user = UserUtils.getUserSession(request);
                
index 4a27801..58eda31 100644 (file)
@@ -65,7 +65,7 @@ public class DS2SampleController extends UnRestrictedBaseController {
 
        @RequestMapping(value = { "/ds2_sample" }, method = RequestMethod.GET)
        public ModelAndView ProfileSearch(HttpServletRequest request) {
-               Map<String, Object> model = new HashMap<String, Object>();
+               Map<String, Object> model = new HashMap<>();
                return new ModelAndView("ds2_sample", "model", model);
        }
 
index 17ac9e1..6c06cc0 100644 (file)
@@ -89,8 +89,8 @@ public class SharedContextRestClient extends PortalRestClientBase {
                String restUrl = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL);
                if (restUrl == null || restUrl.length() == 0)
                        throw new IllegalArgumentException("getSharedContextUrl: no property " + PortalApiConstants.ECOMP_REST_URL);
-               String contextUrl = restUrl + (restUrl.endsWith("/") ? "" : "/") + "context/";
-               return contextUrl;
+               
+               return restUrl + (restUrl.endsWith("/") ? "" : "/") + "context/";
        }
 
        /**
index 6965165..ab4c36c 100644 (file)
@@ -98,7 +98,7 @@ public class UrlAccessImpl implements UrlAccessService {
 
                        if (currentFirstUrl != null) {
 
-                               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                               List<Criterion> restrictionsList = new ArrayList<>();
                                Criterion criterion1 = Restrictions.like("urlsAccessibleKey.url", currentFirstUrl + "%");
                                restrictionsList.add(criterion1);
                                list = dataAccessService.getList(UrlsAccessible.class, null, restrictionsList, null);
index caa8d2a..879a11d 100644 (file)
@@ -69,7 +69,7 @@ public class UserProfileServiceImpl implements UserProfileService {
        @SuppressWarnings("unchecked")
        public User getUserByLoginId(String loginId) {
                User user = null;
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               List<Criterion> restrictionsList = new ArrayList<>();
                Criterion criterion1 = Restrictions.eq("loginId", loginId);
                restrictionsList.add(criterion1);
                List<User> users = (List<User>) getDataAccessService().getList(User.class, null, restrictionsList, null);