- Timestamp:
- 2024-05-14T19:29:53+02:00 (9 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/AbstractReader.java
r18697 r19079 88 88 89 89 /** 90 * A lookup table to avoid calling {@link String#intern()} unnecessarily. 91 */ 92 private final Map<String, String> tagMap = new HashMap<>(); 93 94 /** 90 95 * The dataset to add parsed objects to. 91 96 */ … … 370 375 } 371 376 } 377 this.tagMap.clear(); 372 378 progressMonitor.finishTask(); 373 379 progressMonitor.removeCancelListener(cancelListener); … … 605 611 ((AbstractPrimitive) t).setModified(true); 606 612 } else { 607 t.put( key.intern(), value.intern());613 t.put(this.tagMap.computeIfAbsent(key, Utils::intern), this.tagMap.computeIfAbsent(value, Utils::intern)); 608 614 } 609 615 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r19050 r19079 739 739 */ 740 740 public static boolean isBlank(String string) { 741 return string == null || strip(string).isEmpty();741 return isStripEmpty(string); 742 742 } 743 743 … … 763 763 */ 764 764 public static boolean isStripEmpty(String str) { 765 return str == null || IntStream.range(0, str.length()).allMatch(i -> isStrippedChar(str.charAt(i), null)); 765 if (str != null && !str.isBlank()) { 766 for (int i = 0; i < str.length(); i++) { 767 if (!isStrippedChar(str.charAt(i), null)) { 768 return false; 769 } 770 } 771 } 772 return true; 766 773 } 767 774
Note:
See TracChangeset
for help on using the changeset viewer.