Changeset 17101 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-10-07T20:01:13+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
r16630 r17101 3 3 4 4 import java.util.Arrays; 5 import java.util.Map; 5 6 import java.util.Optional; 7 import java.util.concurrent.ConcurrentHashMap; 8 import java.util.function.Function; 6 9 7 import org.openstreetmap.josm.data.osm.Storage;8 10 import org.openstreetmap.josm.tools.Pair; 9 11 … … 16 18 17 19 // TODO: clean up the intern pool from time to time (after purge or layer removal) 18 private static final Storage<StyleCache> internPool = new Storage<>();20 private static final Map<StyleCache, StyleCache> internPool = new ConcurrentHashMap<>(); 19 21 20 22 /** … … 98 100 */ 99 101 private StyleCache intern() { 100 return internPool. putUnique(this);102 return internPool.computeIfAbsent(this, Function.identity()); 101 103 } 102 104 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r17042 r17101 653 653 public boolean matches(Environment env) { 654 654 CheckParameterUtil.ensureParameterNotNull(env, "env"); 655 for (Condition c : conds){655 return conds.stream().allMatch(c -> { 656 656 try { 657 if (!c.applies(env)) return false;657 return c.applies(env); 658 658 } catch (PatternSyntaxException e) { 659 659 Logging.log(Logging.LEVEL_ERROR, "PatternSyntaxException while applying condition" + c + ':', e); 660 660 return false; 661 661 } 662 } 663 return true; 662 }); 664 663 } 665 664
Note:
See TracChangeset
for help on using the changeset viewer.