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/PluginInformation.java

    r12620 r13204  
    55
    66import java.io.File;
    7 import java.io.FileInputStream;
    87import java.io.IOException;
    98import java.io.InputStream;
    109import java.lang.reflect.Constructor;
    1110import java.net.URL;
     11import java.nio.file.Files;
     12import java.nio.file.InvalidPathException;
    1213import java.text.MessageFormat;
    1314import java.util.ArrayList;
     
    114115        this.file = file;
    115116        try (
    116             FileInputStream fis = new FileInputStream(file);
     117            InputStream fis = Files.newInputStream(file.toPath());
    117118            JarInputStream jar = new JarInputStream(fis)
    118119        ) {
     
    122123            scanManifest(manifest, false);
    123124            libraries.add(0, Utils.fileToURL(file));
    124         } catch (IOException e) {
     125        } catch (IOException | InvalidPathException e) {
    125126            throw new PluginException(name, e);
    126127        }
Note: See TracChangeset for help on using the changeset viewer.