Eliraz Levi has posted comments on this change.

Change subject: tools: CidrValidation Utils
......................................................................


Patch Set 7:

(3 comments)

http://gerrit.ovirt.org/#/c/32539/7/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/CidrValidator.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/CidrValidator.java:

Line 14:      * </ul>
Line 15:      * <p>
Line 16:      * <b>Note!</b> the function is not validating that IP and mask 
match to a network address, please see @see
Line 17:      * {@link CidrValidator#isCidrFormatValid(String)}
Line 18:      * @param cidr
> if you put @param , please add some description to it
Done
Line 19:      * @return true if correct format, false otherwise.
Line 20:      */
Line 21:     public static boolean isCidrFormatValid(String cidr) {
Line 22:         return (cidr == null || 
!cidr.matches(ValidationUtils.CIDR_FORMAT_PATTERN)) ?


Line 17:      * {@link CidrValidator#isCidrFormatValid(String)}
Line 18:      * @param cidr
Line 19:      * @return true if correct format, false otherwise.
Line 20:      */
Line 21:     public static boolean isCidrFormatValid(String cidr) {
> can the methods be non-static?
Done
Line 22:         return (cidr == null || 
!cidr.matches(ValidationUtils.CIDR_FORMAT_PATTERN)) ?
Line 23:                 false : true;
Line 24:     }
Line 25: 


Line 52:     }
Line 53: 
Line 54:     private static boolean isNetworkAddress(int ip, int mask) {
Line 55:         int temp = 1;
Line 56:         for (int i = 0; i < 32-mask; i++) {
> the new version of the method according to the requirements:
modified the function
Line 57:             if ((temp & ip) != 0) {
Line 58:                 return false;
Line 59:             }
Line 60: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib1277dbc815953926fe1648350cd55cb75e1084a
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eliraz Levi <el...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Eliraz Levi <el...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
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