Changeset 30738 in osm for applications/editors/josm/plugins/walkingpapers
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersAddLayerAction.java
r29854 r30738 25 25 } 26 26 27 public void actionPerformed(ActionEvent e) { 27 @Override 28 public void actionPerformed(ActionEvent e) { 28 29 String wpid = JOptionPane.showInputDialog(Main.parent, 29 30 tr("Enter a walking-papers.org URL or ID (the bit after the ?id= in the URL)"), … … 51 52 String tile = null; 52 53 53 try { 54 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(wpUrl).openStream(), "utf-8")); 54 try (BufferedReader r = new BufferedReader(new InputStreamReader(new URL(wpUrl).openStream(), "utf-8"))) { 55 55 for (String line = r.readLine(); line != null; line = r.readLine()) { 56 56 m = spanPattern.matcher(line); … … 65 65 } 66 66 } 67 r.close(); 68 if ((tile == null) || (north == 0 && south == 0) || (east == 0 && west == 0)) throw new Exception(); 67 if ((tile == null) || (north == 0 && south == 0) || (east == 0 && west == 0)) { 68 throw new IllegalStateException(); 69 } 69 70 } catch (Exception ex) { 70 71 JOptionPane.showMessageDialog(Main.parent,tr("Could not read information from walking-papers.org the id \"{0}\"", mungedWpId));
Note:
See TracChangeset
for help on using the changeset viewer.