Changeset 11856 in josm for trunk/src/org
- Timestamp:
- 2017-04-08T01:51:12+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r11365 r11856 15 15 import java.awt.event.KeyEvent; 16 16 import java.awt.event.MouseEvent; 17 import java.io.BufferedInputStream;18 17 import java.io.BufferedReader; 19 18 import java.io.File; … … 507 506 tr("Save style ''{0}'' as ''{1}''", s.getDisplayString(), file.getPath())); 508 507 try { 509 InputStream in = s.getSourceInputStream(); 510 try (InputStream bis = new BufferedInputStream(in)) { 511 Files.copy(bis, file.toPath(), StandardCopyOption.REPLACE_EXISTING); 512 } finally { 513 s.closeSourceInputStream(in); 508 try (InputStream in = s.getSourceInputStream()) { 509 Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); 514 510 } 515 511 } catch (IOException e) { -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r11493 r11856 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.BufferedInputStream;7 6 import java.io.BufferedReader; 8 7 import java.io.ByteArrayOutputStream; … … 483 482 throw new IOException(tr("The requested URL {0} was not found", urlStr)); 484 483 } 485 try (InputStream bis = new BufferedInputStream(con.getContent())) {486 Files.copy( bis, destDirFile.toPath(), StandardCopyOption.REPLACE_EXISTING);484 try (InputStream is = con.getContent()) { 485 Files.copy(is, destDirFile.toPath(), StandardCopyOption.REPLACE_EXISTING); 487 486 } 488 487 activeConnection = null;
Note:
See TracChangeset
for help on using the changeset viewer.