Fix: reading protobuf BoolValues through network used to fail due to problematic dynamic casting
parent
aea84d0f54
commit
afed4fb510
|
@ -32,7 +32,7 @@ public class ProtobufMessageBodyReader implements MessageBodyReader<Message> {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue