Skip to content

Commit

Permalink
fix bug: coords must not be final
Browse files Browse the repository at this point in the history
  • Loading branch information
cpesch committed Dec 29, 2023
1 parent c89fe0f commit 1dbccd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public void read(InputStream source, ParserContext<NavigonCruiserRoute> context)

private Root createRoute(NavigonCruiserRoute route) {
Route result = new Route();
for (Wgs84Position position : route.getPositions()) {
result.getCoords().add(formatDoubleAsString(position.getLatitude(), 5) + "," +
formatDoubleAsString(position.getLongitude(), 5));
}
List<String> coords = route.getPositions().stream()
.map(position -> formatDoubleAsString(position.getLatitude(), 5) + "," +
formatDoubleAsString(position.getLongitude(), 5))
.toList();
result.setCreator(GENERATED_BY);
result.setName(route.getName());

result.setCoords(coords);
return new Root(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,31 @@

@JsonIgnoreProperties(ignoreUnknown = true)
public class Route {
private final List<String> coords = new ArrayList<>();

public int v = 1;
public Settings settings = new Settings();

private List<String> coords = new ArrayList<>();
private String name = null;
private String creator = null;

public List<String> getCoords() {
return coords;
}

public String getName() {
return name;
public void setCoords(List<String> coords) {
this.coords = coords;
}

public String getCreator() {
return creator;
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
Expand Down

0 comments on commit 1dbccd8

Please sign in to comment.