From 0498c68ca56e948ca03ebff2fa613409018fc62e Mon Sep 17 00:00:00 2001 From: charitha Date: Wed, 12 Oct 2016 12:55:59 +0530 Subject: [PATCH] Add validation to maximum limit value (cherry picked from commit 4ed757f) --- .../mgt/jaxrs/service/impl/util/RequestValidationUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java index 603cbe2005..00c7a503e2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/RequestValidationUtil.java @@ -337,10 +337,10 @@ public class RequestValidationUtil { new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage("Request parameter limit is a " + "negative value.").build()); } - if (limit - offset > 100) { + if (limit > 100) { throw new InputValidationException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage("Request results list should" + - " be less than or equal 100 values.").build()); + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage("Request parameter limit should" + + " be less than or equal to 100.").build()); } }