Upgrade to Protobuf 3.9 (plus consistent XMLUnit declarations)

This commit is contained in:
Juergen Hoeller
2019-07-20 19:06:54 +02:00
parent cdeb1fef5f
commit 45136aabd4
5 changed files with 8 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -231,6 +231,7 @@ public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter<M
(this.protobufFormatSupport != null && this.protobufFormatSupport.supportsWriteOnly(mediaType)));
}
@SuppressWarnings("deprecation")
@Override
protected void writeInternal(Message message, HttpOutputMessage outputMessage)
throws IOException, HttpMessageNotWritableException {
@@ -253,7 +254,7 @@ public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter<M
}
else if (TEXT_PLAIN.isCompatibleWith(contentType)) {
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputMessage.getBody(), charset);
TextFormat.print(message, outputStreamWriter);
TextFormat.print(message, outputStreamWriter); // deprecated on Protobuf 3.9
outputStreamWriter.flush();
outputMessage.getBody().flush();
}