Changeset 11804 in josm
- Timestamp:
- 2017-04-01T00:10:42+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r11747 r11804 197 197 } 198 198 199 /** 200 * Determines if the given tag key is already used (by all selected primitives, not just some of them) 201 * @param key the key to check 202 * @return {@code true} if the key is used by all selected primitives (key not unset for at least one primitive) 203 */ 204 @SuppressWarnings("unchecked") 199 205 private boolean containsDataKey(String key) { 200 206 return IntStream.range(0, tagData.getRowCount()) 201 .mapToObj(i -> tagData.getValueAt(i, 0) /* sic! do not use getDataKey*/) 202 .anyMatch(key::equals); 207 .filter(i -> key.equals(tagData.getValueAt(i, 0)) /* sic! do not use getDataKey*/ 208 && !((Map<String, Integer>) tagData.getValueAt(i, 1)).containsKey("") /* sic! do not use getDataValues*/) 209 .findAny().isPresent(); 203 210 } 204 211 … … 866 873 for (int i = 0; i < tags.size() && count < tagsToShow; i++) { 867 874 final Tag t = tags.get(i); 868 boolean keyExists = keyExists(t);875 boolean keyExists = containsDataKey(t.getKey()); 869 876 if (keyExists && PROPERTY_RECENT_EXISTING.get() == RecentExisting.HIDE) 870 877 continue; … … 1074 1081 } 1075 1082 1076 private boolean keyExists(final Tag t) {1077 return valueCount.containsKey(t.getKey());1078 }1079 1080 1083 private void refreshRecentTags() { 1081 1084 switch (PROPERTY_REFRESH_RECENT.get()) {
Note:
See TracChangeset
for help on using the changeset viewer.