Ticket #21881: 21881-msg.patch
File 21881-msg.patch, 2.7 KB (added by , 13 days ago) |
---|
-
src/org/openstreetmap/josm/data/osm/IWaySegment.java
96 96 * @param first first node 97 97 * @param second second node 98 98 * @return way segment 99 * @throws IllegalArgumentException if the node pair is not part ofway99 * @throws IllegalArgumentException if the node pair is a segment of the way 100 100 */ 101 101 public static <N extends INode, W extends IWay<N>> IWaySegment<N, W> forNodePair(W way, N first, N second) { 102 102 int endIndex = way.getNodesCount() - 1; … … 107 107 } 108 108 endIndex--; 109 109 } 110 throw new IllegalArgumentException("Node pair is not part ofway!");110 throw new IllegalArgumentException("Node pair is not a segment of the way!"); 111 111 } 112 112 113 113 /** -
src/org/openstreetmap/josm/data/osm/WaySegment.java
25 25 * @param first first node 26 26 * @param second second node 27 27 * @return way segment 28 * @throws IllegalArgumentException if the node pair is not part ofway28 * @throws IllegalArgumentException if the node pair is a segment of the way 29 29 */ 30 30 public static WaySegment forNodePair(Way way, Node first, Node second) { 31 31 int endIndex = way.getNodesCount() - 1; … … 36 36 } 37 37 endIndex--; 38 38 } 39 throw new IllegalArgumentException(" The node pair is not consecutive part of the way!");39 throw new IllegalArgumentException("Node pair is not a segment of the way!"); 40 40 } 41 41 42 42 /** -
test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java
36 36 assertEquals(WaySegment.forNodePair(w, n1, n4).getLowerIndex(), 4); 37 37 assertEquals(WaySegment.forNodePair(w, n4, n1).getLowerIndex(), 5); 38 38 IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> WaySegment.forNodePair(w, n3, n4)); 39 assertEquals(" The node pair is not consecutive part of the way!", iae.getMessage());39 assertEquals("Node pair is not a segment of the way!", iae.getMessage()); 40 40 } 41 41 }