Ignore:
Timestamp:
2017-04-08T01:51:12+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:IOI_DOUBLE_BUFFER_COPY - Performance - Method passes a Buffered Stream/Reader/Writer to a already buffering copy method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r11493 r11856  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.io.BufferedInputStream;
    76import java.io.BufferedReader;
    87import java.io.ByteArrayOutputStream;
     
    483482                throw new IOException(tr("The requested URL {0} was not found", urlStr));
    484483            }
    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);
    487486            }
    488487            activeConnection = null;
Note: See TracChangeset for help on using the changeset viewer.