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 {
|
InputStream entityStream) throws IOException, WebApplicationException {
|
||||||
try {
|
try {
|
||||||
Method newBuilder = type.getMethod("newBuilder");
|
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();
|
return builder.mergeFrom(entityStream).build();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new WebApplicationException(e);
|
throw new WebApplicationException(e);
|
||||||
|
|
Loading…
Reference in New Issue