Ignore:
Timestamp:
2017-12-17T00:17:20+01:00 (6 years ago)
Author:
Don-vip
Message:

enable new PMD rule AvoidFileStream - see https://pmd.github.io/pmd-6.0.0/pmd_rules_java_performance.html#avoidfilestream / https://bugs.openjdk.java.net/browse/JDK-8080225 for details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java

    r13050 r13204  
    77import java.awt.image.BufferedImage;
    88import java.io.File;
    9 import java.io.FileInputStream;
    109import java.io.FileNotFoundException;
    1110import java.io.IOException;
     11import java.nio.file.Files;
     12import java.nio.file.Paths;
    1213import java.util.ArrayList;
    1314import java.util.List;
     
    543544    }
    544545
    545     private DataSet loadDataset() throws FileNotFoundException, IllegalDataException {
     546    private DataSet loadDataset() throws IOException, IllegalDataException {
    546547        if (argInput == null) {
    547548            throw new IllegalArgumentException(tr("Missing argument - input data file ({0})", "--input|-i"));
    548549        }
    549550        try {
    550             return OsmReader.parseDataSet(new FileInputStream(argInput), null);
     551            return OsmReader.parseDataSet(Files.newInputStream(Paths.get(argInput)), null);
    551552        } catch (IllegalDataException e) {
    552553            throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage());
Note: See TracChangeset for help on using the changeset viewer.