Ticket #21254: 21254.fixup.patch

File 21254.fixup.patch, 2.1 KB (added by taylor.smock, 4 years ago)

Fix lint issues, fix broken test

  • src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java

    diff --git a/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java b/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java
    index 5186c624a2..87aff165f7 100644
    a b public class Geometry {  
    4747            int x = 0;
    4848            int y = 0;
    4949            // Area is used to determine the inner/outer of a polygon
    50             final int maxArraySize = commands.stream().filter(command -> command.getType() != Command.ClosePath).mapToInt(command -> command.getOperations().length).sum();
     50            final int maxArraySize = commands.stream().filter(command -> command.getType() != Command.ClosePath)
     51                    .mapToInt(command -> command.getOperations().length).sum();
    5152            final List<Integer> xArray = new ArrayList<>(maxArraySize);
    5253            final List<Integer> yArray = new ArrayList<>(maxArraySize);
    5354            for (CommandInteger command : commands) {
    public class Geometry {  
    7879                        shapes.add(area);
    7980                    }
    8081
    81                     final double areaAreaSq = calculateSurveyorsArea(xArray.stream().mapToInt(i -> i).toArray(), yArray.stream().mapToInt(i -> i).toArray());
     82                    final double areaAreaSq = calculateSurveyorsArea(xArray.stream().mapToInt(i -> i).toArray(),
     83                            yArray.stream().mapToInt(i -> i).toArray());
    8284                    Area nArea = new Area(line);
    8385                    // SonarLint thinks that this is never > 0. It can be.
    8486                    if (areaAreaSq > 0) {
    public class Geometry {  
    8890                    } else {
    8991                        throw new IllegalArgumentException(tr("{0} cannot have zero area", geometryType));
    9092                    }
     93                    xArray.clear();
     94                    yArray.clear();
    9195                } else {
    9296                    throw new IllegalArgumentException(tr("{0} with {1} arguments is not understood", geometryType, operations.length));
    9397                }