Skip to content

Commit

Permalink
Upgrades gRPC dependencies to latest versions. Drops dependency on pr…
Browse files Browse the repository at this point in the history
…otobuf lite in favor of the full version which we already depended on.

Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
  • Loading branch information
spericas committed Aug 6, 2024
1 parent 044e5a4 commit e5facf0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
<version.lib.google-api-client>1.34.1</version.lib.google-api-client>
<version.lib.google-oauth-client>1.33.3</version.lib.google-oauth-client>
<version.lib.google-error-prone>2.3.3</version.lib.google-error-prone>
<version.lib.google-protobuf>3.21.7</version.lib.google-protobuf>
<version.lib.google-protobuf>4.27.3</version.lib.google-protobuf>
<version.lib.graalvm>23.1.0</version.lib.graalvm>
<version.lib.graphql-java>18.6</version.lib.graphql-java>
<version.lib.graphql-java.extended.scalars>18.3</version.lib.graphql-java.extended.scalars>
<version.lib.gson>2.9.0</version.lib.gson>
<version.lib.grpc>1.60.0</version.lib.grpc>
<version.lib.grpc>1.65.1</version.lib.grpc>
<version.lib.guava>32.0.1-jre</version.lib.guava>
<version.lib.h2>2.2.220</version.lib.h2>
<version.lib.hamcrest>1.3</version.lib.hamcrest>
Expand Down
1 change: 0 additions & 1 deletion grpc/core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 0 additions & 1 deletion microprofile/grpc/server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Class<?>, MethodDescriptor.Marshaller<?>> CACHE = new ConcurrentHashMap<>();
Expand All @@ -38,9 +38,9 @@ static <T> MethodDescriptor.Marshaller<T> get(Class<T> 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<T>) ProtoLiteUtils.marshaller(instance);
result = (MethodDescriptor.Marshaller<T>) ProtoUtils.marshaller(instance);
MethodDescriptor.Marshaller<T> current = (MethodDescriptor.Marshaller<T>) CACHE.putIfAbsent(clazz, result);
return current == null ? result : current;
} catch (ReflectiveOperationException e) {
Expand Down

0 comments on commit e5facf0

Please sign in to comment.