Changeset 13224 in josm


Ignore:
Timestamp:
2017-12-18T16:16:50+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #15678 - StringIndexOutOfBoundsException in OsmPrimitiveComparator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java

    r12663 r13224  
    2525     */
    2626    public static Comparator<OsmPrimitive> comparingNames() {
    27         final Comparator<String> digitsLast = comparing(str -> Character.isDigit(str.charAt(0)) ? 1 : 0);
     27        final Comparator<String> digitsLast = comparing(str -> !str.isEmpty() && Character.isDigit(str.charAt(0)) ? 1 : 0);
    2828        return comparing(memoize(DefaultNameFormatter.getInstance()::format),
    2929                digitsLast.thenComparing(AlphanumComparator.getInstance()));
Note: See TracChangeset for help on using the changeset viewer.