Changeset 6211 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2013-08-31T10:23:58+02:00 (11 years ago)
Author:
bastiK
Message:

see #8997 - add more debug output in case of error

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  
    113113        }
    114114        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        }
    116121        osm.mappaintCacheIdx = cacheIdx;
    117122        return p;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r6070 r6211  
    1414/**
    1515 * Caches styles for a single primitive.
    16  * Splits the range of possible scale values (0 < scale < +Infinity) into multiple
     16 * Splits the range of possible scale values (0 &lt; scale &lt; +Infinity) into multiple
    1717 * subranges, for each scale range it keeps a list of styles.
    1818 * Immutable class, equals & hashCode is required (the same for StyleList, ElemStyle
     
    142142    }
    143143
     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
    144149    /**
    145150     * ASCII-art explanation:
     
    159164        if (bd.get(i) == lower) {
    160165            if (upper > bd.get(i+1))
    161                 throw new AssertionError("the new range must be within a single subrange");
     166                throw new RangeViolatedError();
    162167            if (data.get(i) != null)
    163168                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.