From fc7f80c543c9c627df5c5cc29b498452e2fa6f58 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 22 Feb 2018 13:03:16 +0530 Subject: [PATCH 1/2] Removing un-necessary checks when retrieving getAllDeviceInfo --- .../core/service/DeviceManagementProviderServiceImpl.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index cd82f01d2b4..13ab28dd798 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -2535,14 +2535,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv * of the given device list. */ private List getAllDeviceInfo(List allDevices) throws DeviceManagementException { - if (allDevices.size() == 0) { - String msg = "Received empty device list for getAllDeviceInfo"; - log.error(msg); - throw new DeviceManagementException(msg); - } - if (log.isDebugEnabled()) { - log.debug("Get all device info of devices, num of devices: " + allDevices.size()); - } List devices = new ArrayList<>(); for (Device device : allDevices) { device.setDeviceInfo(this.getDeviceInfo(device)); From 90d38bf69903f424e179a02d48f44a0777896fee Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 22 Feb 2018 13:07:48 +0530 Subject: [PATCH 2/2] Adding debug logs --- .../mgt/core/service/DeviceManagementProviderServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 13ab28dd798..2b5c88b036d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -2535,6 +2535,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv * of the given device list. */ private List getAllDeviceInfo(List allDevices) throws DeviceManagementException { + if (log.isDebugEnabled()) { + log.debug("Get all device info of devices, num of devices: " + allDevices.size()); + } List devices = new ArrayList<>(); for (Device device : allDevices) { device.setDeviceInfo(this.getDeviceInfo(device));