Moti Asayag has posted comments on this change.

Change subject: backend: adding @Mask annotation
......................................................................


Patch Set 16:

(3 comments)

https://gerrit.ovirt.org/#/c/35155/16/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/AConstraint.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/AConstraint.java:

Line 1: package org.ovirt.engine.core.common.validation;
Line 2: 
Line 3: import javax.validation.ConstraintValidatorContext;
Line 4: 
Line 5: public class AConstraint {
> Done
Done
Line 6: 
Line 7:     private static AConstraint aConstraint = new AConstraint();
Line 8: 
Line 9:     private AConstraint() {


https://gerrit.ovirt.org/#/c/35155/16/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/MaskConstraint.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/MaskConstraint.java:

Line 13:     }
Line 14: 
Line 15:     @Override
Line 16:     public boolean isValid(String mask, ConstraintValidatorContext 
context) {
Line 17:         if (mask.isEmpty()) {
what if the mask is null ?
Line 18:             return true;
Line 19:         }
Line 20: 
Line 21:         boolean isMaskFormatValid = isMaskFormatValid(mask);


Line 19:         }
Line 20: 
Line 21:         boolean isMaskFormatValid = isMaskFormatValid(mask);
Line 22:         AConstraint.AConstraintArgsFormatValue args = new
Line 23:                 
AConstraint.AConstraintArgsFormatValue(isMaskFormatValid,
isMaskFormatValid is reserved for static methods / getter of boolean. For local 
boolean variables or class variable please omit the 'is'  prefix.
Line 24:                         isMaskFormatValid ? isMaskValid(mask) : false,
Line 25:                         
VdcBllMessages.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_FORMAT.name(),
Line 26:                         
VdcBllMessages.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_VALUE.name());
Line 27:         return AConstraint.getInstance().isValid(args, context, 
"mask");//$NON-NLS-1$


-- 
To view, visit https://gerrit.ovirt.org/35155
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If92f2ec51f9cb647d6008b2fd2b1ab4c3db1d3f1
Gerrit-PatchSet: 16
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eliraz Levi <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Eliraz Levi <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to