From afed4fb51003957aeda4abe17f5483f5fd36b06e Mon Sep 17 00:00:00 2001 From: Hai Brenner Date: Tue, 2 Aug 2016 14:13:10 +0300 Subject: [PATCH] Fix: reading protobuf BoolValues through network used to fail due to problematic dynamic casting --- .../src/main/java/meerkat/rest/ProtobufMessageBodyReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restful-api-common/src/main/java/meerkat/rest/ProtobufMessageBodyReader.java b/restful-api-common/src/main/java/meerkat/rest/ProtobufMessageBodyReader.java index d09e213..ebf80a0 100644 --- a/restful-api-common/src/main/java/meerkat/rest/ProtobufMessageBodyReader.java +++ b/restful-api-common/src/main/java/meerkat/rest/ProtobufMessageBodyReader.java @@ -32,7 +32,7 @@ public class ProtobufMessageBodyReader implements MessageBodyReader { InputStream entityStream) throws IOException, WebApplicationException { try { Method newBuilder = type.getMethod("newBuilder"); - GeneratedMessage.Builder builder = (GeneratedMessage.Builder) newBuilder.invoke(type); + Message.Builder builder = (Message.Builder) newBuilder.invoke(type); return builder.mergeFrom(entityStream).build(); } catch (Exception e) { throw new WebApplicationException(e);