- Timestamp:
- 2013-08-31T10:23:58+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r6175 r6211 113 113 } 114 114 StyleCache style = osm.mappaintStyle != null ? osm.mappaintStyle : StyleCache.EMPTY_STYLECACHE; 115 osm.mappaintStyle = style.put(p.a, p.b); 115 try { 116 osm.mappaintStyle = style.put(p.a, p.b); 117 } catch (StyleCache.RangeViolatedError e) { 118 throw new AssertionError("Range violated. object: " + osm.getPrimitiveId() + ", current style: "+osm.mappaintStyle 119 + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b); 120 } 116 121 osm.mappaintCacheIdx = cacheIdx; 117 122 return p; -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
r6070 r6211 14 14 /** 15 15 * Caches styles for a single primitive. 16 * Splits the range of possible scale values (0 < scale <+Infinity) into multiple16 * Splits the range of possible scale values (0 < scale < +Infinity) into multiple 17 17 * subranges, for each scale range it keeps a list of styles. 18 18 * Immutable class, equals & hashCode is required (the same for StyleList, ElemStyle … … 142 142 } 143 143 144 // this exception type is for debugging #8997 and can later be replaced 145 // by AssertionError 146 public static class RangeViolatedError extends Error { 147 } 148 144 149 /** 145 150 * ASCII-art explanation: … … 159 164 if (bd.get(i) == lower) { 160 165 if (upper > bd.get(i+1)) 161 throw new AssertionError("the new range must be within a single subrange");166 throw new RangeViolatedError(); 162 167 if (data.get(i) != null) 163 168 throw new AssertionError("the new range must be within a subrange that has no data");
Note:
See TracChangeset
for help on using the changeset viewer.