Kobi Ianko has posted comments on this change. Change subject: webadmin: Replace inner variable references in failure messages ......................................................................
Patch Set 2: (1 comment) http://gerrit.ovirt.org/#/c/26621/2/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java File frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java: Line 169: RegExp regex = RegExp.compile(VARIABLE_PATTERN, "gi"); //$NON-NLS-1$ //$NON-NLS-2$ Line 170: Line 171: MatchResult result; Line 172: while (returnValue.length() > 0) { Line 173: result = regex.exec(returnValue); something here looks fishy to me... returnValue is the input for function and I don't think the exec will change it... it will remain >0 for ever. it looks like in some cases we will have infinite looping another way to handle the regexp: (copied from stackoverflow...) RegExp regExp = RegExp.compile(patternStr); MatchResult matcher = regExp.exec(inputStr); boolean matchFound = (matcher != null); // equivalent to regExp.test(inputStr); if (matchFound) { // Get all groups for this match for (int i=0; i<=matcher.getGroupCount(); i++) { String groupStr = matcher.getGroup(i); System.out.println(groupStr); } } Line 174: if (result == null) { Line 175: // No more matches Line 176: break; Line 177: } -- To view, visit http://gerrit.ovirt.org/26621 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If70582ae35b8f94b4101dfc33865cc7976fd625c Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Kobi Ianko <k...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Vojtech Szocs <vsz...@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