Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/**
* Interface definition for structures defined in <a href="https://geojson.org">GeoJSON</a>
* format. copied from Spring Data Mongodb
* format. copied from Spring Data Mongodb
*
* @author Christoph Strobl
* @since 1.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static GeoJsonLineString of(Point first, Point second, Point... others) {
Assert.notNull(second, "Second point must not be null!");
Assert.notNull(others, "Additional points must not be null!");

List<Point> points = new ArrayList<>();
List<Point> points = new ArrayList<>(2 + others.length);
points.add(first);
points.add(second);
points.addAll(Arrays.asList(others));
Expand Down Expand Up @@ -103,7 +103,7 @@ public static GeoJsonLineString of(GeoPoint first, GeoPoint second, GeoPoint...
Assert.notNull(second, "Second point must not be null!");
Assert.notNull(others, "Additional points must not be null!");

List<Point> points = new ArrayList<>();
List<Point> points = new ArrayList<>(2 + others.length);
points.add(GeoPoint.toPoint(first));
points.add(GeoPoint.toPoint(second));
points.addAll(Arrays.stream(others).map(GeoPoint::toPoint).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static GeoJsonMultiPoint of(Point first, Point second, Point... others) {
Assert.notNull(second, "Second point must not be null!");
Assert.notNull(others, "Additional points must not be null!");

List<Point> points = new ArrayList<>();
List<Point> points = new ArrayList<>(2 + others.length);
points.add(first);
points.add(second);
points.addAll(Arrays.asList(others));
Expand Down Expand Up @@ -103,7 +103,7 @@ public static GeoJsonMultiPoint of(GeoPoint first, GeoPoint second, GeoPoint...
Assert.notNull(second, "Second point must not be null!");
Assert.notNull(others, "Additional points must not be null!");

List<Point> points = new ArrayList<>();
List<Point> points = new ArrayList<>(2 + others.length);
points.add(GeoPoint.toPoint(first));
points.add(GeoPoint.toPoint(second));
points.addAll(Arrays.stream(others).map(GeoPoint::toPoint).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ public List<GeoJsonLineString> getCoordinates() {
@SafeVarargs
private static <T> List<T> asList(T first, T second, T third, T fourth, T... others) {

ArrayList<T> result = new ArrayList<>(3 + others.length);
Assert.notNull(first, "First element must not be null!");
Assert.notNull(second, "Second element must not be null!");
Assert.notNull(third, "Third element must not be null!");
Assert.notNull(fourth, "Fourth element must not be null!");
Assert.notNull(others, "Additional elements must not be null!");

ArrayList<T> result = new ArrayList<>(4 + others.length);

result.add(first);
result.add(second);
Expand Down