Changeset 10212 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2016-05-15T00:51:10+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r10194 r10212 192 192 } catch (OsmTransferException e) { 193 193 throw e; 194 } catch ( Exception e) {194 } catch (IllegalDataException | IOException e) { 195 195 throw new OsmTransferException(e); 196 196 } finally { -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r10194 r10212 352 352 Utils.close(zipFile); 353 353 } 354 } catch ( Exception e) {354 } catch (IOException e) { 355 355 if (file.getName().endsWith(".zip")) { 356 356 Main.warn(tr("Failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}", -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r9231 r10212 99 99 } 100 100 return false; 101 } catch ( Exception e) {101 } catch (IOException e) { 102 102 displayError(f, e); 103 103 return false; … … 138 138 importData(files, progressMonitor); 139 139 return true; 140 } catch ( Exception e) {140 } catch (IOException | IllegalDataException e) { 141 141 Main.error(e); 142 142 HelpAwareOptionPane.showMessageDialogInEDT( -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r10045 r10212 409 409 try { 410 410 currentWayPoint.put(localName, Float.valueOf(accumulator.toString())); 411 } catch ( Exception e) {411 } catch (NumberFormatException e) { 412 412 currentWayPoint.put(localName, 0f); 413 413 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r9325 r10212 522 522 try { 523 523 result = new FetchResult(OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(pkg.size(), false)), null); 524 } catch ( Exception e) {524 } catch (IllegalDataException e) { 525 525 throw new OsmTransferException(e); 526 526 } … … 550 550 try { 551 551 result = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(1, false)); 552 } catch ( Exception e) {552 } catch (IllegalDataException e) { 553 553 throw new OsmTransferException(e); 554 554 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r10051 r10212 263 263 Main.addNetworkError(url, Utils.getRootCause(e)); 264 264 throw new OsmApiInitializationException(e); 265 } catch ( Exception e) {265 } catch (SAXException | IOException | ParserConfigurationException e) { 266 266 initialized = false; 267 267 throw new OsmApiInitializationException(e); -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r8513 r10212 144 144 .append('>'); 145 145 } 146 } catch ( Exception e) {146 } catch (IllegalArgumentException e) { 147 147 // Ignored 148 148 if (Main.isTraceEnabled()) { … … 157 157 .append('>'); 158 158 } 159 } catch ( Exception e) {159 } catch (IllegalArgumentException e) { 160 160 // Ignored 161 161 if (Main.isTraceEnabled()) { -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r10001 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.io.InputStreamReader; … … 283 284 } catch (ParserConfigurationException | SAXException e) { 284 285 throw new IllegalDataException(e.getMessage(), e); 285 } catch ( Exception e) {286 } catch (IOException e) { 286 287 throw new IllegalDataException(e); 287 288 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r9326 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.io.InputStreamReader; … … 651 652 else 652 653 throw new IllegalDataException(msg, e); 653 } catch ( Exception e) {654 } catch (IOException e) { 654 655 throw new IllegalDataException(e); 655 656 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java
r9231 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.text.MessageFormat; … … 135 136 } catch (OsmTransferException e) { 136 137 throw e; 137 } catch ( Exception e) {138 } catch (IOException | IllegalDataException e) { 138 139 if (cancel) 139 140 return null; -
trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java
r9231 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.text.MessageFormat; … … 12 13 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 13 14 import org.openstreetmap.josm.tools.CheckParameterUtil; 15 import org.xml.sax.SAXException; 14 16 15 17 /** … … 72 74 } catch (OsmTransferException e) { 73 75 throw e; 74 } catch ( Exception e) {76 } catch (IOException | SAXException e) { 75 77 if (cancel) 76 78 return null; -
trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java
r9990 r10212 52 52 } catch (OsmTransferException e) { 53 53 throw e; 54 } catch ( Exception e) {54 } catch (IOException | SAXException | IllegalDataException e) { 55 55 if (cancel) 56 56 return null; -
trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
r8510 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.text.MessageFormat; … … 134 135 if (cancel) return null; 135 136 throw e; 136 } catch ( Exception e) {137 } catch (IOException | IllegalDataException e) { 137 138 if (cancel) return null; 138 139 throw new OsmTransferException(e); -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r9732 r10212 144 144 try { 145 145 response = client.connect(progressMonitor); 146 } catch ( Exception e) {146 } catch (IOException e) { 147 147 Main.error(e); 148 148 OsmTransferException ote = new OsmTransferException( … … 163 163 try { 164 164 errorBody = response.fetchContent(); 165 } catch ( Exception e) {165 } catch (IOException e) { 166 166 errorBody = tr("Reading error text failed."); 167 167 } … … 173 173 } catch (OsmTransferException e) { 174 174 throw e; 175 } catch ( Exception e) {175 } catch (IOException e) { 176 176 throw new OsmTransferException(e); 177 177 } -
trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
r8540 r10212 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.util.LinkedList; … … 9 10 10 11 import javax.xml.parsers.DocumentBuilderFactory; 12 import javax.xml.parsers.ParserConfigurationException; 11 13 import javax.xml.xpath.XPath; 12 14 import javax.xml.xpath.XPathConstants; … … 23 25 import org.w3c.dom.Node; 24 26 import org.w3c.dom.NodeList; 27 import org.xml.sax.SAXException; 25 28 26 29 public class OsmServerUserInfoReader extends OsmServerReader { … … 178 181 } catch (OsmTransferException e) { 179 182 throw e; 180 } catch ( Exception e) {183 } catch (IOException | ParserConfigurationException | SAXException e) { 181 184 throw new OsmTransferException(e); 182 185 } finally { -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r9171 r10212 19 19 import javax.xml.parsers.DocumentBuilder; 20 20 import javax.xml.parsers.DocumentBuilderFactory; 21 import javax.xml.parsers.ParserConfigurationException; 21 22 22 23 import org.openstreetmap.josm.Main; … … 142 143 builderFactory.setValidating(false); 143 144 builderFactory.setNamespaceAware(true); 144 DocumentBuilder builder = null; 145 builder = builderFactory.newDocumentBuilder(); 145 DocumentBuilder builder = builderFactory.newDocumentBuilder(); 146 146 builder.setEntityResolver(new EntityResolver() { 147 147 @Override … … 151 151 } 152 152 }); 153 Document document = null; 154 document = builder.parse(new InputSource(new StringReader(incomingData))); 153 Document document = builder.parse(new InputSource(new StringReader(incomingData))); 155 154 156 155 // Some WMS service URLs specify a different base URL for their GetMap service … … 193 192 List<Element> children = getChildren(capabilityElem, "Layer"); 194 193 layers = parseLayers(children, new HashSet<String>()); 195 } catch ( Exception e) {194 } catch (MalformedURLException | ParserConfigurationException | SAXException e) { 196 195 throw new WMSGetCapabilitiesException(e, incomingData); 197 196 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r9078 r10212 36 36 instance4 = new RemoteControlHttpServer(port, false); 37 37 instance4.start(); 38 } catch ( Exception ex) {38 } catch (IOException ex) { 39 39 Main.warn(marktr("Cannot start IPv4 remotecontrol server on port {0}: {1}"), 40 40 Integer.toString(port), ex.getLocalizedMessage()); … … 43 43 instance6 = new RemoteControlHttpServer(port, true); 44 44 instance6.start(); 45 } catch ( Exception ex) {45 } catch (IOException ex) { 46 46 /* only show error when we also have no IPv4 */ 47 47 if (instance4 == null) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r10060 r10212 333 333 instance4 = new RemoteControlHttpsServer(port, false); 334 334 instance4.start(); 335 } catch ( Exception ex) {335 } catch (IOException | GeneralSecurityException ex) { 336 336 Main.warn(marktr("Cannot start IPv4 remotecontrol https server on port {0}: {1}"), 337 337 Integer.toString(port), ex.getLocalizedMessage()); … … 340 340 instance6 = new RemoteControlHttpsServer(port, true); 341 341 instance6.start(); 342 } catch ( Exception ex) {342 } catch (IOException | GeneralSecurityException ex) { 343 343 /* only show error when we also have no IPv4 */ 344 344 if (instance4 == null) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r9732 r10212 47 47 } 48 48 } 49 } catch ( Exception ex) {49 } catch (RuntimeException ex) { 50 50 Main.warn("RemoteControl: Error parsing import remote control request:"); 51 51 Main.error(ex); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r10131 r10212 145 145 } 146 146 } 147 } catch ( Exception ex) {147 } catch (RuntimeException ex) { 148 148 Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:"); 149 149 Main.error(ex); -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r9746 r10212 9 9 import java.io.OutputStream; 10 10 import java.io.OutputStreamWriter; 11 import java.lang.reflect.Constructor;12 11 import java.nio.charset.StandardCharsets; 13 12 import java.util.ArrayList; … … 97 96 return null; 98 97 try { 99 Constructor<? extends SessionLayerExporter> constructor = exporterClass.getConstructor(layerClass); 100 return constructor.newInstance(layer); 101 } catch (Exception e) { 98 return exporterClass.getConstructor(layerClass).newInstance(layer); 99 } catch (ReflectiveOperationException e) { 102 100 throw new RuntimeException(e); 103 101 }
Note:
See TracChangeset
for help on using the changeset viewer.