Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java
r18613 r18634 5 5 6 6 import java.awt.event.ActionEvent; 7 import java.io.UncheckedIOException; 7 8 import java.net.URI; 8 9 import java.net.URISyntaxException; … … 67 68 } catch (URISyntaxException e) { 68 69 Logging.trace(e); 69 new Notification(tr("Malformed URI: ", this.imageUrl.toExternalForm())).setIcon(JOptionPane.WARNING_MESSAGE).show(); 70 new Notification(tr("Malformed URI: {0}", this.imageUrl.toExternalForm())).setIcon(JOptionPane.WARNING_MESSAGE).show(); 71 } catch (UncheckedIOException e) { 72 Logging.trace(e); 73 new Notification(tr("IO Exception: {0}\n{1}", this.imageUrl.toExternalForm(), e.getCause().getMessage())) 74 .setIcon(JOptionPane.WARNING_MESSAGE).show(); 70 75 } 71 76 return null; -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
r18593 r18634 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 4 5 import static org.junit.jupiter.api.Assertions.assertEquals; 5 6 … … 40 41 assertEquals(LatLon.ZERO, wpt.getCoor()); 41 42 } 43 44 /** 45 * Non-regression test for #22638: NoSuchFileException causes a crash 46 */ 47 @Test 48 void testTicket22638() throws MalformedURLException { 49 ImageMarker marker = new ImageMarker( 50 LatLon.ZERO, 51 new File(TestUtils.getRegressionDataFile(12255, "no_such.jpg")).toURI().toURL(), 52 new MarkerLayer(new GpxData(), null, null, null), 53 1d, 2d); 54 assertDoesNotThrow(() -> marker.actionPerformed(null)); 55 } 42 56 }
Note:
See TracChangeset
for help on using the changeset viewer.