From bb507173703f03f8565676ff18323e43aba6f506 Mon Sep 17 00:00:00 2001 From: ThilinaPremachandra Date: Wed, 14 Jun 2023 17:45:27 +0530 Subject: [PATCH] remove unnecessary imports, fixes line issues --- .../jaxrs/service/impl/GroupManagementServiceImpl.java | 4 ---- .../device/mgt/core/dao/impl/AbstractGroupDAOImpl.java | 4 ---- .../mgt/core/service/GroupManagementProviderService.java | 5 ++--- .../core/service/GroupManagementProviderServiceImpl.java | 8 ++------ 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java index b68bbd0f3a..ef9928dc39 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java @@ -49,9 +49,6 @@ import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.transaction.UserTransaction; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -467,5 +464,4 @@ public class GroupManagementServiceImpl implements GroupManagementService { return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).build(); } } - } \ No newline at end of file diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java index 7331ab6ad5..5f29424336 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java @@ -197,8 +197,6 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO { if (hasStatus) { stmt.setString(7, deviceGroup.getStatus()); } - - stmt.executeUpdate(); rs = stmt.getGeneratedKeys(); if (rs.next()) { @@ -239,8 +237,6 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO { if (hasStatus) { stmt.setString(7, groups.getStatus()); } - - stmt.executeUpdate(); rs = stmt.getGeneratedKeys(); if (rs.next()) { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java index f65244842c..f52524db91 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java @@ -46,13 +46,12 @@ public interface GroupManagementProviderService { /** * Add new device group and create default role with default permissions. * - * @param groups to add + * @param groups to add * @param defaultRole of the deviceGroup * @param defaultPermissions of the default role * @throws GroupManagementException */ - void createGroupWithRoles(DeviceGroupRoleWrapper groups, String defaultRole, - String[] defaultPermissions )throws GroupManagementException, GroupAlreadyExistException, RoleDoesNotExistException; + void createGroupWithRoles(DeviceGroupRoleWrapper groups, String defaultRole, String[] defaultPermissions) throws GroupManagementException, GroupAlreadyExistException, RoleDoesNotExistException; /** * Update existing device group. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java index 40d45b0963..2d0b82c194 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java @@ -147,9 +147,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid } } - - public void createGroupWithRoles(DeviceGroupRoleWrapper groups, String defaultRole, String[] defaultPermissions) - throws GroupManagementException, GroupAlreadyExistException { + public void createGroupWithRoles(DeviceGroupRoleWrapper groups, String defaultRole, String[] defaultPermissions) throws GroupManagementException, GroupAlreadyExistException { if (groups == null) { String msg = "Received incomplete data for createGroup"; log.error(msg); @@ -168,9 +166,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid } else { DeviceGroup immediateParentGroup = groupDAO.getGroup(groups.getParentGroupId(), tenantId); if (immediateParentGroup == null) { - String msg = "Parent group with group ID '" + groups.getParentGroupId() - + "' does not exist. Hence creating of group '" + groups.getName() - + "' was not success"; + String msg = "Parent group with group ID '" + groups.getParentGroupId() + "' does not exist. Hence creating of group '" + groups.getName() + "' was not success"; log.error(msg); throw new GroupManagementException(msg); }