Ori Liel has posted comments on this change.

Change subject: rest-api: validation of max parameter in restapi
......................................................................


Patch Set 2:

(2 comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendResource.java
Line 131:             HashMap<String,String> matrixConstraints = 
QueryHelper.getMatrixConstraints(getUriInfo(), MAX);
Line 132:             String maxString = matrixConstraints.get(MAX);
Line 133:             try {
Line 134:                 Integer max = Integer.valueOf(maxString);
Line 135:                 if (max < -1){
should be <0, no?
Line 136:                     return failMaxResults(maxString);
Line 137:                 }
Line 138:                 return max;
Line 139:             } catch (NumberFormatException e) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BaseBackendResource.java
Line 161:             return identifier;
Line 162:         }
Line 163:     }
Line 164: 
Line 165:     protected class MalformedNumberException extends 
BackendFailureException {
I think it's not right to inherit BackendFailureException because the problem 
isn't in the Backend layer. I think the right exception to inherit is 
WebFalutException
Line 166:         public MalformedNumberException(String msg, Status status ) {
Line 167:             super(msg, status);
Line 168:         }
Line 169:     }


-- 
To view, visit http://gerrit.ovirt.org/18043
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae3397dba4dffbff2ecf7d7601861540b52aa9bb
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mta...@redhat.com>
Gerrit-Reviewer: Eli Mesika <elimes...@gmail.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: mooli tayer <mta...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to