Changeset 13030 in josm for trunk


Ignore:
Timestamp:
2017-10-21T14:25:59+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15465 - validate WaySegment constructor arguments

File:
1 edited

Legend:

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

    r11893 r13030  
    2525     * @param w The way
    2626     * @param i The node lower index
     27     * @throws IllegalArgumentException in case of invalid index
    2728     */
    2829    public WaySegment(Way w, int i) {
    2930        way = w;
    3031        lowerIndex = i;
     32        if (i < 0 || i >= w.getNodesCount() - 1) {
     33            throw new IllegalArgumentException(toString());
     34        }
    3135    }
    3236
Note: See TracChangeset for help on using the changeset viewer.