Martin Peřina has posted comments on this change. Change subject: core: replace regexp validation for user email. ......................................................................
Patch Set 1: (2 comments) http://gerrit.ovirt.org/#/c/28742/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EventSubscriptionCommandBase.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EventSubscriptionCommandBase.java: Line 148: * The input email. Line 149: * @return <c>true</c> if [is valid email] [the specified input email]; Line 150: * otherwise, <c>false</c>. Line 151: */ Line 152: protected static boolean ValidatMailAddress(String inputEmail) { > Sure. I think this can be done in the same patch no? OK Line 153: try { Line 154: new InternetAddress(inputEmail, true); Line 155: } catch (AddressException e) { Line 156: return false; Line 151: */ Line 152: protected static boolean ValidatMailAddress(String inputEmail) { Line 153: try { Line 154: new InternetAddress(inputEmail, true); Line 155: } catch (AddressException e) { > we can assume it is not null based on how it is called: Well, since empty is not valid email address, I would move the test into validate method and the call could be only: if (!ValidatMailAddress(mailAdress)) That seems more logical to me. Line 156: return false; Line 157: } Line 158: return true; Line 159: } -- To view, visit http://gerrit.ovirt.org/28742 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I18904a669453baef632af1cd427b61852e7ab583 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: mooli tayer <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: mooli tayer <[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
