Skip to content

Commit

Permalink
[8.13.x][RHPAM-4644] Bump protobuf-java to 3.19.6 (kiegroup#863)
Browse files Browse the repository at this point in the history
* [RHPAM-4644][7.67.x-blue] Bump protobuf-java from 3.19.6

* Upgrade Graphhopper to match protobuf (#1)

Co-authored-by: Radovan Synek <[email protected]>

---------

Co-authored-by: Radovan Synek <[email protected]>
Co-authored-by: Radovan Synek <[email protected]>
  • Loading branch information
3 people authored May 4, 2023
1 parent 73a6283 commit 3196dfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import com.graphhopper.GHRequest;
import com.graphhopper.GHResponse;
import com.graphhopper.config.Profile;
import com.graphhopper.reader.osm.GraphHopperOSM;
import com.graphhopper.util.PointList;
import com.graphhopper.util.shapes.BBox;
Expand All @@ -46,11 +47,14 @@
@IfBuildProperty(name = "app.routing.engine", stringValue = "GRAPHHOPPER", enableIfMissing = true)
class GraphHopperRouter implements Router, DistanceCalculator, Region {

private static final String CAR_PROFILE = "car";

private final GraphHopperOSM graphHopper;

@Inject
GraphHopperRouter(GraphHopperOSM graphHopper) {
this.graphHopper = graphHopper;
this.graphHopper.setProfiles(new Profile(CAR_PROFILE));
}

@Override
Expand All @@ -60,6 +64,7 @@ public List<Coordinates> getPath(Coordinates from, Coordinates to) {
from.longitude().doubleValue(),
to.latitude().doubleValue(),
to.longitude().doubleValue());
ghRequest.setProfile(CAR_PROFILE);
PointList points = graphHopper.route(ghRequest).getBest().getPoints();
return StreamSupport.stream(points.spliterator(), false)
.map(ghPoint3D -> Coordinates.of(ghPoint3D.lat, ghPoint3D.lon))
Expand All @@ -73,6 +78,7 @@ public long travelTimeMillis(Coordinates from, Coordinates to) {
from.longitude().doubleValue(),
to.latitude().doubleValue(),
to.longitude().doubleValue());
ghRequest.setProfile(CAR_PROFILE);
GHResponse ghResponse = graphHopper.route(ghRequest);
// TODO return wrapper that can hold both the result and error explanation instead of throwing exception
if (ghResponse.hasErrors()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import com.graphhopper.GHRequest;
import com.graphhopper.GHResponse;
import com.graphhopper.PathWrapper;
import com.graphhopper.ResponsePath;
import com.graphhopper.reader.osm.GraphHopperOSM;
import com.graphhopper.storage.GraphHopperStorage;
import com.graphhopper.util.PointList;
Expand All @@ -50,7 +50,7 @@ class GraphHopperRouterTest {
@Mock
private GHResponse ghResponse;
@Mock
private PathWrapper pathWrapper;
private ResponsePath pathWrapper;
@Mock
private GraphHopperStorage graphHopperStorage;

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
</modules>

<properties>
<version.com.graphhopper>0.13.0-pre13</version.com.graphhopper>
<version.com.graphhopper>1.0</version.com.graphhopper>
<version.com.neovisionaries>1.27</version.com.neovisionaries>
<version.frontend-maven-plugin>1.11.3</version.frontend-maven-plugin>
<version.node>v12.16.2</version.node>
<version.npm>6.14.18</version.npm>
<!-- Override protobuf version from Quarkus to make it compatible with GraphHopper. -->
<protobuf-java.version>3.6.1</protobuf-java.version>
<version.com.google.protobuf>3.6.1</version.com.google.protobuf>
<protobuf-java.version>3.19.6</protobuf-java.version>
<version.com.google.protobuf>3.19.6</version.com.google.protobuf>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit 3196dfd

Please sign in to comment.