From e5facf03e1b6d7c68e652b74d4a58479dd35fb44 Mon Sep 17 00:00:00 2001 From: Santiago Pericas-Geertsen Date: Tue, 6 Aug 2024 16:14:37 -0400 Subject: [PATCH] Upgrades gRPC dependencies to latest versions. Drops dependency on protobuf lite in favor of the full version which we already depended on. Signed-off-by: Santiago Pericas-Geertsen --- dependencies/pom.xml | 4 ++-- grpc/core/src/main/java/module-info.java | 1 - microprofile/grpc/server/src/main/java/module-info.java | 1 - .../java/io/helidon/webserver/grpc/ProtoMarshaller.java | 8 ++++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 98f6aac1ac4..a0aad80c7a2 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -53,12 +53,12 @@ 1.34.1 1.33.3 2.3.3 - 3.21.7 + 4.27.3 23.1.0 18.6 18.3 2.9.0 - 1.60.0 + 1.65.1 32.0.1-jre 2.2.220 1.3 diff --git a/grpc/core/src/main/java/module-info.java b/grpc/core/src/main/java/module-info.java index f2866601099..930d44df09a 100644 --- a/grpc/core/src/main/java/module-info.java +++ b/grpc/core/src/main/java/module-info.java @@ -28,7 +28,6 @@ requires transitive io.grpc.stub; requires transitive com.google.protobuf; requires transitive io.grpc.protobuf; - requires transitive io.grpc.protobuf.lite; exports io.helidon.grpc.core; } diff --git a/microprofile/grpc/server/src/main/java/module-info.java b/microprofile/grpc/server/src/main/java/module-info.java index 71e2659d08f..c01fcb3b9d5 100644 --- a/microprofile/grpc/server/src/main/java/module-info.java +++ b/microprofile/grpc/server/src/main/java/module-info.java @@ -39,7 +39,6 @@ requires io.helidon.webserver.grpc; requires io.grpc; - requires io.grpc.protobuf.lite; requires com.google.protobuf; requires microprofile.health.api; diff --git a/webserver/grpc/src/main/java/io/helidon/webserver/grpc/ProtoMarshaller.java b/webserver/grpc/src/main/java/io/helidon/webserver/grpc/ProtoMarshaller.java index a3733e82db6..8a4d316522f 100644 --- a/webserver/grpc/src/main/java/io/helidon/webserver/grpc/ProtoMarshaller.java +++ b/webserver/grpc/src/main/java/io/helidon/webserver/grpc/ProtoMarshaller.java @@ -19,9 +19,9 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import com.google.protobuf.MessageLite; +import com.google.protobuf.Message; import io.grpc.MethodDescriptor; -import io.grpc.protobuf.lite.ProtoLiteUtils; +import io.grpc.protobuf.ProtoUtils; final class ProtoMarshaller { private static final Map, MethodDescriptor.Marshaller> CACHE = new ConcurrentHashMap<>(); @@ -38,9 +38,9 @@ static MethodDescriptor.Marshaller get(Class clazz) { // i may create it twice, but that should not really matter try { java.lang.reflect.Method getDefaultInstance = clazz.getDeclaredMethod("getDefaultInstance"); - MessageLite instance = (MessageLite) getDefaultInstance.invoke(clazz); + Message instance = (Message) getDefaultInstance.invoke(clazz); - result = (MethodDescriptor.Marshaller) ProtoLiteUtils.marshaller(instance); + result = (MethodDescriptor.Marshaller) ProtoUtils.marshaller(instance); MethodDescriptor.Marshaller current = (MethodDescriptor.Marshaller) CACHE.putIfAbsent(clazz, result); return current == null ? result : current; } catch (ReflectiveOperationException e) {