- Timestamp:
- 2016-04-15T09:42:16+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/DividedScale.java
r9669 r10145 118 118 * @param upper upper bound 119 119 */ 120 pr otectedvoid putImpl(T o, double lower, double upper) {120 private void putImpl(T o, double lower, double upper) { 121 121 int i = 0; 122 122 while (bd.get(i) < lower) { … … 164 164 } 165 165 166 /** 167 * Runs a consistency test. 168 * @throws AssertionError When an invariant is broken. 169 */ 166 170 public void consistencyTest() { 167 171 if (bd.size() < 2) throw new AssertionError(bd); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
r10000 r10145 9 9 /** 10 10 * Caches styles for a single primitive. 11 * <p> 12 * This object is immutable. 11 13 */ 12 14 public final class StyleCache { … … 31 33 } 32 34 35 /** 36 * Creates a new copy of this style cache with a new entry added. 37 * @param o The style to cache. 38 * @param r The range the style is for. 39 * @param selected The style list we should use (selected/unselected) 40 * @return The new object. 41 */ 33 42 public StyleCache put(StyleElementList o, Range r, boolean selected) { 34 43 StyleCache s = new StyleCache(this); … … 37 46 DividedScale<StyleElementList> ds = s.states[idx]; 38 47 if (ds == null) { 39 ds = s.states[idx] =new DividedScale<>();48 ds = new DividedScale<>(); 40 49 } 41 ds.putImpl(o, r.getLower(), r.getUpper()); 42 ds.consistencyTest(); 50 s.states[idx] = ds.put(o, r); 43 51 s.intern(); 44 52 return s;
Note:
See TracChangeset
for help on using the changeset viewer.