Sandro Bonazzola has posted comments on this change. Change subject: core: fix search on fedora 21 ......................................................................
Patch Set 2: Code-Review-1 (1 comment) Please fix http://gerrit.ovirt.org/#/c/36282/2/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/BaseConditionFieldAutoCompleter.java File backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/BaseConditionFieldAutoCompleter.java: Line 168: relations = "NOT " + getLikeSyntax(caseSensitive); Line 169: } Line 170: // Sort according to the value (real column name) in order not to rely on random access from map Line 171: SortedSet<Map.Entry<String, String>> sortedEntrySet = new TreeSet<>(new ColNameMapEntryComparator()); Line 172: sortedEntrySet.addAll(columnNameDict.entrySet()); >From jenkins failing job: BaseConditionFieldAutoCompleter.java:172, DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS, Priority: Low Adding elements of an entry set may fail due to reuse of Map.Entry object in org.ovirt.engine.core.searchbackend.BaseConditionFieldAutoCompleter.buildFreeTextConditionSql(String, String, String, boolean) The entrySet() method is allowed to return a view of the underlying Map in which a single Entry object is reused and returned during the iteration. As of Java 1.6, both IdentityHashMap and EnumMap did so. When iterating through such a Map, the Entry value is only valid until you advance to the next iteration. If, for example, you try to pass such an entrySet to an addAll method, things will go badly wrong. Line 173: for (Map.Entry<String, String> columnNameEntry : sortedEntrySet) { Line 174: if (typeDict.get(columnNameEntry.getKey()) == String.class && !notFreeTextSearchableFieldsList.contains(columnNameEntry.getKey())) { Line 175: if (firstTime) { Line 176: firstTime = false; -- To view, visit http://gerrit.ovirt.org/36282 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e6f2cb0832dc21be9fab9f24858e6f7c4c613ba Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Liran Zelkha <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Ravi Nori <[email protected]> Gerrit-Reviewer: Sandro Bonazzola <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[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
