- Timestamp:
- 2023-08-23T13:53:32+02:00 (11 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r18818 r18819 188 188 <!-- Indicate that this jar may have version specific classes. Only used in Java9+. --> 189 189 <attribute name="Multi-Release" value="true"/> 190 <attribute name="Automatic-Module-Name" value="org.openstreetmap.josm"/>191 190 </manifest> 192 191 </jar> -
trunk/src/org/openstreetmap/josm/io/GpxParser.java
r18818 r18819 638 638 currentState = states.pop(); 639 639 convertUrlToLink(currentWayPoint.attr); 640 if (!currentWayPoint.isLatLonKnown()) { 641 throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName)); 642 } 640 643 currentRoute.routePoints.add(currentWayPoint); 641 644 break; … … 643 646 currentState = states.pop(); 644 647 convertUrlToLink(currentWayPoint.attr); 648 if (!currentWayPoint.isLatLonKnown()) { 649 throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName)); 650 } 645 651 currentTrackSeg.add(currentWayPoint); 646 652 break; … … 649 655 convertUrlToLink(currentWayPoint.attr); 650 656 currentWayPoint.getExtensions().addAll(currentExtensionCollection); 657 if (!currentWayPoint.isLatLonKnown()) { 658 currentExtensionCollection.clear(); 659 throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName)); 660 } 651 661 data.waypoints.add(currentWayPoint); 652 662 currentExtensionCollection.clear(); -
trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
r18818 r18819 104 104 105 105 @ParameterizedTest 106 @ValueSource(strings = "<gpx><wpt></wpt></gpx>") 106 @ValueSource(strings = { 107 "<gpx><wpt></wpt></gpx>", 108 "<gpx><trk><trkseg><trkpt></trkpt></trkseg></trk></gpx>", 109 "<gpx><rte><rtept></rtept></rte></gpx>" 110 }) 107 111 void testIncompleteLocations(String gpx) { 108 112 SAXException saxException = assertThrows(SAXException.class, … … 111 115 if ("<wpt>".regionMatches(0, gpx, 5, 4)) { 112 116 type = "wpt"; 117 } else if ("<trkpt>".regionMatches(0, gpx, 18, 7)) { 118 type = "trkpt"; 119 } else if ("<rtept>".regionMatches(0, gpx, 10, 7)) { 120 type = "rtept"; 113 121 } else { 114 122 fail("You need to add code to tell us what the exception for \"" + gpx + "\" should be");
Note:
See TracChangeset
for help on using the changeset viewer.