Hello Eli Mesika,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18390
to review the following change.
Change subject: core: Underscores in tag names break tags
......................................................................
core: Underscores in tag names break tags
Fixing tag regular expression matching in TagHandler.
We are adding backslashes for the SQL search query but should remove
them when the regular expression is matched.
Change-Id: I0925cdba0ed34e3dc68a8396eca0b17589dfa853
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=949484
Signed-off-by: Eli Mesika <[email protected]>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TagsDirector.java
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/18390/1
diff --git
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TagsDirector.java
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TagsDirector.java
index 6d8960f..e06385a 100644
---
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TagsDirector.java
+++
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TagsDirector.java
@@ -302,6 +302,9 @@
private void RecursiveGetTagsAndChildrenByRegExp(String tagNameRegExp,
StringBuilder sb, tags tag, TagReturnValueIndicator indicator ) {
if ((tag.getChildren() != null) && (tag.getChildren().size() > 0)) {
+ // The following line replaces '\\' in the expression that may be
added by handling a '_' character with empty string.
+ // since we have here both String and RegExp , each backslash char
is represented by four backslash chars , so for marching 2 we will need 8
+ tagNameRegExp=tagNameRegExp.replaceAll("\\\\\\\\", "");
for (tags child : tag.getChildren()) {
if (Regex.IsMatch(child.gettag_name(), tagNameRegExp))
// the tag matches the regular expression -> add it and all its
--
To view, visit http://gerrit.ovirt.org/18390
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0925cdba0ed34e3dc68a8396eca0b17589dfa853
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches