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 {
|
| 47 | 47 | int x = 0; |
| 48 | 48 | int y = 0; |
| 49 | 49 | // 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(); |
| 51 | 52 | final List<Integer> xArray = new ArrayList<>(maxArraySize); |
| 52 | 53 | final List<Integer> yArray = new ArrayList<>(maxArraySize); |
| 53 | 54 | for (CommandInteger command : commands) { |
| … |
… |
public class Geometry {
|
| 78 | 79 | shapes.add(area); |
| 79 | 80 | } |
| 80 | 81 | |
| 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()); |
| 82 | 84 | Area nArea = new Area(line); |
| 83 | 85 | // SonarLint thinks that this is never > 0. It can be. |
| 84 | 86 | if (areaAreaSq > 0) { |
| … |
… |
public class Geometry {
|
| 88 | 90 | } else { |
| 89 | 91 | throw new IllegalArgumentException(tr("{0} cannot have zero area", geometryType)); |
| 90 | 92 | } |
| | 93 | xArray.clear(); |
| | 94 | yArray.clear(); |
| 91 | 95 | } else { |
| 92 | 96 | throw new IllegalArgumentException(tr("{0} with {1} arguments is not understood", geometryType, operations.length)); |
| 93 | 97 | } |