Changeset 1827 in josm for trunk/src/org
- Timestamp:
- 2009-07-25T11:12:35+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
r1811 r1827 32 32 public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException { 33 33 progressMonitor.beginTask("", 1); 34 InputStream in = null; 34 35 try { 35 36 progressMonitor.subTask(tr("Downloading OSM data...")); … … 42 43 } 43 44 44 final InputStreamin = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true));45 in = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true)); 45 46 if (in == null) 46 47 return null; 47 48 final OsmReader osm = OsmReader.parseDataSetOsm(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); 48 49 final DataSet data = osm.getDs(); 49 50 in.close();51 activeConnection = null;52 50 return data; 53 } catch (IOException e) {54 if (cancel)55 return null;56 throw new OsmTransferException(e);57 } catch (SAXException e) {58 throw new OsmTransferException(e);59 51 } catch(OsmTransferException e) { 52 if (cancel) return null; 60 53 throw e; 61 54 } catch (Exception e) { 62 if (cancel) 63 return null; 55 if (cancel) return null; 64 56 throw new OsmTransferException(e); 65 57 } finally { 66 58 progressMonitor.finishTask(); 59 if (in!=null) { 60 try { 61 in.close(); 62 } catch(Exception e) {} 63 } 64 activeConnection = null; 67 65 } 68 66 }
Note:
See TracChangeset
for help on using the changeset viewer.