Sonar major issues 77/60277/1
authorSumapriya Sarvepalli <ss00493505@techmahindra.com>
Mon, 13 Aug 2018 10:31:34 +0000 (16:01 +0530)
committerSumapriya Sarvepalli <ss00493505@techmahindra.com>
Mon, 13 Aug 2018 10:31:34 +0000 (16:01 +0530)
 Replace the type specification in this constructor call with the diamond operator
Sonar Link:
https://sonar.onap.org/code?id=org.onap.portal.sdk%3Aepsdk-project&selected=org.onap.portal.sdk%3Aepsdk-app-common%3Asrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fservice%2FOnBoardingApiServiceImpl.java
Location:
epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java
Line No: L282 L302 L326 L360

Change-Id: Ice2ab43f0a9db648d2a5b40fc21eebbd536f37e9
Issue-ID: PORTAL-353
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java

index 871a375..966eb8f 100644 (file)
@@ -279,7 +279,7 @@ public class OnBoardingApiServiceImpl implements IPortalRestAPIService, IPortalR
                                }
                         else {
                                List<User> users = userProfileService.findAllActive();
-                               List<EcompUser> ecompUsers = new ArrayList<EcompUser>();
+                               List<EcompUser> ecompUsers = new ArrayList<>();
                                for (User user : users)
                                        ecompUsers.add(UserUtils.convertToEcompUser(user));
                                return ecompUsers;
@@ -299,7 +299,7 @@ public class OnBoardingApiServiceImpl implements IPortalRestAPIService, IPortalR
        public List<EcompRole> getAvailableRoles(String requestedLoginId) throws PortalAPIException {
                try {
                        List<Role> roles = roleService.getActiveRoles(requestedLoginId);
-                       List<EcompRole> ecompRoles = new ArrayList<EcompRole>();
+                       List<EcompRole> ecompRoles = new ArrayList<>();
                        for (Role role : roles)
                                ecompRoles.add(UserUtils.convertToEcompRole(role));
                        return ecompRoles;
@@ -323,7 +323,7 @@ public class OnBoardingApiServiceImpl implements IPortalRestAPIService, IPortalR
                         * TypeFactory.defaultInstance().constructCollectionType(List.class,
                         * EcompRole.class));
                         */
-                       SortedSet<Role> roles = new TreeSet<Role>();
+                       SortedSet<Role> roles = new TreeSet<>();
                        for (EcompRole role : rolesJson) {
                                roles.add(roleService.getRole(loginId,role.getId()));
                        }
@@ -357,7 +357,7 @@ public class OnBoardingApiServiceImpl implements IPortalRestAPIService, IPortalR
        public List<EcompRole> getUserRoles(String loginId) throws PortalAPIException {
                if (logger.isDebugEnabled())
                        logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## loginId: {}", loginId);
-               List<EcompRole> ecompRoles = new ArrayList<EcompRole>();
+               List<EcompRole> ecompRoles = new ArrayList<>();
                try {
 
                        if (isCentralized.equals(isAccessCentralized)) {