From 9246cdcf30839359a9e15625a9ceee9c226b7d07 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 25 Aug 2016 12:28:55 +0530 Subject: [PATCH] Return empty array when results not found with since parameter --- .../mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 9cd1bda1ca..705328d96a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -18,6 +18,7 @@ */ package org.wso2.carbon.device.mgt.jaxrs.service.impl; +import com.google.gson.JsonArray; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; @@ -127,8 +128,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { request.setSince(sinceDate); result = dms.getAllDevices(request); if (result == null || result.getData() == null || result.getData().size() <= 0) { - return Response.status(Response.Status.OK).entity("No device is modified " + - "after the timestamp provided in 'since' filter").build(); + return Response.status(Response.Status.OK).entity(new JsonArray()).build(); } } else { result = dms.getAllDevices(request);