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/plugins/ReadLocalPluginInformationTask.java

    r12620 r13204  
    55
    66import java.io.File;
    7 import java.io.FileInputStream;
    87import java.io.FilenameFilter;
    98import java.io.IOException;
     9import java.io.InputStream;
     10import java.nio.file.Files;
     11import java.nio.file.InvalidPathException;
    1012import java.util.ArrayList;
    1113import java.util.Collection;
     
    145147
    146148    protected void processLocalPluginInformationFile(File file) throws PluginListParseException {
    147         try (FileInputStream fin = new FileInputStream(file)) {
     149        try (InputStream fin = Files.newInputStream(file.toPath())) {
    148150            List<PluginInformation> pis = new PluginListParser().parse(fin);
    149151            for (PluginInformation pi : pis) {
     
    154156                availablePlugins.put(pi.name, pi);
    155157            }
    156         } catch (IOException e) {
     158        } catch (IOException | InvalidPathException e) {
    157159            throw new PluginListParseException(e);
    158160        }
Note: See TracChangeset for help on using the changeset viewer.