Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageMetadata.java
r18592 r19249 7 7 import java.io.UncheckedIOException; 8 8 import java.net.URI; 9 import java.nio.file.FileSystemNotFoundException; 9 10 import java.time.Instant; 10 11 import java.util.List; … … 262 263 /** 263 264 * Extract GPS metadata from image EXIF. Has no effect if the image file is not set 264 * 265 * <p> 265 266 * If successful, fills in the LatLon, speed, elevation, image direction, and other attributes 266 267 * @since 18592 (interface), 9270 (GpxImageEntry) … … 272 273 } catch (IOException e) { 273 274 throw new UncheckedIOException(e); 275 } catch (IllegalArgumentException | FileSystemNotFoundException e) { 276 throw new UncheckedIOException(new IOException(e)); 274 277 } 275 278 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
r18895 r19249 7 7 import java.io.File; 8 8 import java.net.MalformedURLException; 9 import java.net.URI; 10 import java.net.URL; 9 11 10 12 import org.junit.jupiter.api.AfterEach; … … 17 19 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 18 20 import org.openstreetmap.josm.testutils.annotations.Main; 21 import org.openstreetmap.josm.tools.PlatformManager; 19 22 20 23 /** … … 60 63 assertDoesNotThrow(() -> marker.actionPerformed(null)); 61 64 } 65 66 /** 67 * Windows does not like {@code :} to appear multiple times in a path. 68 * @throws MalformedURLException if the URI fails to create and convert to a URL. 69 */ 70 @Test 71 void testNonRegression23978() throws MalformedURLException { 72 final URL testURL; 73 if (PlatformManager.isPlatformWindows()) { 74 // This throws the InvalidPathException (subclass of IllegalArgumentException), and is what the initial problem was. 75 testURL = URI.create("file:/c:/foo/c:/bar/image.jpg").toURL(); 76 } else { 77 // This throws an IllegalArgumentException. 78 testURL = new URL("file:/foobar/image.jpg#hashtagForIAE"); 79 } 80 ImageMarker imageMarker = new ImageMarker(LatLon.ZERO, testURL, 81 new MarkerLayer(new GpxData(), null, null, null), 0, 0); 82 assertDoesNotThrow(() -> imageMarker.actionPerformed(null)); 83 } 62 84 }
Note:
See TracChangeset
for help on using the changeset viewer.