Ignore:
Timestamp:
2017-12-17T00:17:20+01:00 (2 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/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java

    r12868 r13204  
    33
    44import java.io.File;
    5 import java.io.FileInputStream;
    6 import java.io.FileNotFoundException;
     5import java.io.IOException;
    76import java.io.InputStream;
     7import java.nio.file.Files;
     8import java.nio.file.InvalidPathException;
    89import java.util.Arrays;
    910import java.util.Collections;
     
    6364        if (grid != null) {
    6465            try {
    65                 return new FileInputStream(grid.getAbsoluteFile());
    66             } catch (FileNotFoundException ex) {
    67                 Logging.warn("NTV2 grid shift file not found: " + grid);
    68                 Logging.trace(ex);
     66                return Files.newInputStream(grid.getAbsoluteFile().toPath());
     67            } catch (IOException | InvalidPathException ex) {
     68                Logging.warn("Unable to open NTV2 grid shift file: " + grid);
     69                Logging.debug(ex);
    6970            }
    7071        }
Note: See TracChangeset for help on using the changeset viewer.