Changeset 8575 in josm


Ignore:
Timestamp:
2015-07-06T12:38:22+02:00 (6 years ago)
Author:
bastiK
Message:

see #11607 - more debugging output for error in StyleCache

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r8510 r8575  
    130130            osm.mappaintStyle = style.put(p.a, p.b);
    131131        } catch (StyleCache.RangeViolatedError e) {
    132             throw new AssertionError("Range violated. object: " + osm.getPrimitiveId() + ", current style: "+osm.mappaintStyle
    133                     + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b, e);
     132            throw new AssertionError("Range violated: " + e.getMessage() + " (object: " + osm.getPrimitiveId() + ", current style: "+osm.mappaintStyle
     133                    + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ")", e);
    134134        }
    135135        osm.mappaintCacheIdx = cacheIdx;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r8510 r8575  
    148148    // by AssertionError
    149149    public static class RangeViolatedError extends Error {
     150        public RangeViolatedError() {
     151        }
     152
     153        public RangeViolatedError(String message) {
     154            super(message);
     155        }
    150156    }
    151157
     
    167173        if (bd.get(i) == lower) {
    168174            if (upper > bd.get(i+1))
    169                 throw new RangeViolatedError();
     175                throw new RangeViolatedError("the new range must be within a single subrange (1)");
    170176            if (data.get(i) != null)
    171                 throw new AssertionError("the new range must be within a subrange that has no data");
     177                throw new RangeViolatedError("the new range must be within a subrange that has no data");
    172178
    173179            if (bd.get(i+1) == upper) {
     
    186192        } else {
    187193            if (bd.get(i) < upper)
    188                 throw new AssertionError("the new range must be within a single subrange");
     194                throw new RangeViolatedError("the new range must be within a single subrange (2)");
    189195            if (data.get(i-1) != null)
    190196                throw new AssertionError();
Note: See TracChangeset for help on using the changeset viewer.