Changeset 17800 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2021-04-19T21:45:11+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r17781 r17800 8 8 import java.text.MessageFormat; 9 9 import java.util.ArrayList; 10 import java.util.Arrays; 10 11 import java.util.Collection; 11 12 import java.util.Collections; … … 215 216 return; 216 217 int count = counter.getAsInt(); 217 if (link. conds == null || link.conds.isEmpty()) {218 if (link.getConditions().isEmpty()) { 218 219 // index is not needed, we can avoid the sequential search below 219 220 e.parent = parent; … … 235 236 236 237 private boolean firstAndLastOnly() { 237 return link. conds.stream().allMatch(c -> c instanceof IndexCondition && ((IndexCondition) c).isFirstOrLast);238 return link.getConditions().stream().allMatch(c -> c instanceof IndexCondition && ((IndexCondition) c).isFirstOrLast); 238 239 } 239 240 … … 574 575 } 575 576 } else if (ChildOrParentSelectorType.CHILD == type 576 && link.conds != null && !link.conds.isEmpty()577 && link. conds.get(0) instanceof OpenEndPseudoClassCondition) {577 && !link.getConditions().isEmpty() 578 && link.getConditions().get(0) instanceof OpenEndPseudoClassCondition) { 578 579 if (e.osm instanceof INode) { 579 580 e.osm.visitReferrers(new MultipolygonOpenEndFinder(e)); … … 638 639 abstract class AbstractSelector implements Selector { 639 640 640 pr otectedfinalList<Condition>conds;641 private final Condition[] conds; 641 642 642 643 protected AbstractSelector(List<Condition> conditions) { 643 this.conds = Utils.toUnmodifiableList(conditions);644 this.conds = conditions.toArray(new Condition[0]); 644 645 } 645 646 … … 666 667 @Override 667 668 public List<Condition> getConditions() { 668 return conds;669 return Arrays.asList(conds); 669 670 } 670 671 } … … 703 704 @Override 704 705 public String toString() { 705 return "LinkSelector{conditions=" + conds+ '}';706 return "LinkSelector{conditions=" + getConditions() + '}'; 706 707 } 707 708 } … … 832 833 return base 833 834 + (Range.ZERO_TO_INFINITY.equals(range) ? "" : range) 834 + ( conds != null ? conds.stream().map(String::valueOf).collect(Collectors.joining("")): "")835 + (getConditions().stream().map(String::valueOf).collect(Collectors.joining(""))) 835 836 + (subpart != null && subpart != Subpart.DEFAULT_SUBPART ? ("::" + subpart) : ""); 836 837 }
Note:
See TracChangeset
for help on using the changeset viewer.