From c53e027701daa18179b64f81b422b816f37ea9da Mon Sep 17 00:00:00 2001 From: sinthuja Date: Fri, 1 Sep 2017 13:02:13 +0530 Subject: [PATCH] Fixing https://github.com/wso2/product-iots/issues/1374. --- .../java/org/wso2/carbon/device/mgt/jaxrs/util/Constants.java | 2 +- .../mgt/core/service/DeviceManagementProviderServiceImpl.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/Constants.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/Constants.java index 5afbf58626..728c461c7b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/Constants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/Constants.java @@ -30,7 +30,7 @@ public class Constants { public static final String DEFAULT_STREAM_VERSION = "1.0.0"; public static final String SCOPE = "scope"; public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager"; - public static final int DEFAULT_PAGE_LIMIT = 10; + public static final int DEFAULT_PAGE_LIMIT = 50; public final class ErrorMessages { 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 a4afef2f48..0b346db8b9 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 @@ -1720,15 +1720,12 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv if (log.isDebugEnabled()) { log.debug("Get devices by name " + request.toString() + " and requiredDeviceInfo: " + requireDeviceInfo); } - List devices = new ArrayList<>(); List allDevices; int limit = DeviceManagerUtil.validateDeviceListPageSize(request.getRowCount()); try { DeviceManagementDAOFactory.openConnection(); allDevices = deviceDAO.getDevicesByNameAndType(request.getDeviceName(), request.getDeviceType(), this.getTenantId(), request.getStartIndex(), limit); - List filterd = null; - filterd.get(0); } catch (DeviceManagementDAOException e) { String msg = "Error occurred while fetching the list of devices that matches to '" + request.getDeviceName() + "'";