Changeset 13698 in josm


Ignore:
Timestamp:
2018-05-01T21:51:12+02:00 (7 years ago)
Author:
Don-vip
Message:

fix PMD violations

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RightAngleBuildingTest.java

    r13690 r13698  
    4747        List<Pair<Double, Node>> angles = w.getAngles();
    4848        for (Pair<Double, Node> pair: angles) {
    49             if (checkAngle(w, pair.a, pair.b)) {
     49            if (checkAngle(pair.a)) {
    5050                TestError.Builder builder = TestError.builder(this, Severity.WARNING, 3701)
    5151                                                     .message(tr("Building with an almost square angle"))
     
    7676    }
    7777
    78     private boolean checkAngle(Way w, double angle, Node n) {
     78    private boolean checkAngle(double angle) {
    7979        double difference = Math.abs(angle - 90);
    8080        return difference > minAngleDelta && difference < maxAngleDelta;
  • trunk/src/org/openstreetmap/josm/tools/WindowsShortcut.java

    r13697 r13698  
    44import java.io.ByteArrayOutputStream;
    55import java.io.File;
    6 import java.io.FileInputStream;
    76import java.io.IOException;
    87import java.io.InputStream;
    98import java.nio.charset.StandardCharsets;
     9import java.nio.file.Files;
    1010import java.text.ParseException;
    1111import java.util.Locale;
     
    4646        final int minimum_length = 0x64;
    4747        boolean isPotentiallyValid = false;
    48         try (InputStream fis = new FileInputStream(file)) {
     48        try (InputStream fis = Files.newInputStream(file.toPath())) {
    4949            isPotentiallyValid = file.isFile()
    5050                && file.getName().toLowerCase(Locale.ENGLISH).endsWith(".lnk")
     
    6262     */
    6363    public WindowsShortcut(File file) throws IOException, ParseException {
    64         try (InputStream in = new FileInputStream(file)) {
     64        try (InputStream in = Files.newInputStream(file.toPath())) {
    6565            parseLink(getBytes(in));
    6666        }
Note: See TracChangeset for help on using the changeset viewer.