Fix: reading protobuf BoolValues through network used to fail due to problematic dynamic casting

mixer
Hai Brenner 2016-08-02 14:13:10 +03:00
parent aea84d0f54
commit afed4fb510
1 changed files with 1 additions and 1 deletions

View File

@ -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);