Polishing

This commit is contained in:
Juergen Hoeller
2019-12-01 00:20:00 +01:00
parent 2267080ff4
commit 567c7695dd
3 changed files with 7 additions and 9 deletions

View File

@@ -48,15 +48,15 @@ import static org.springframework.util.MimeTypeUtils.TEXT_PLAIN;
* <p>This converter supports by default {@code "application/x-protobuf"} with the official * <p>This converter supports by default {@code "application/x-protobuf"} with the official
* {@code "com.google.protobuf:protobuf-java"} library. * {@code "com.google.protobuf:protobuf-java"} library.
* *
* <p>{@code "application/json"} can be supported with the official {@code "com.google.protobuf:protobuf-java-util"} 3.x * <p>{@code "application/json"} can be supported with the official
* with 3.3 or higher recommended * {@code "com.google.protobuf:protobuf-java-util"} 3.x, with 3.3 or higher recommended.
* *
* @author Parviz Rozikov * @author Parviz Rozikov
* @author Rossen Stoyanchev
* @since 5.2.2 * @since 5.2.2
*/ */
public class ProtobufMessageConverter extends AbstractMessageConverter { public class ProtobufMessageConverter extends AbstractMessageConverter {
/** /**
* The default charset used by the converter. * The default charset used by the converter.
*/ */
@@ -187,7 +187,7 @@ public class ProtobufMessageConverter extends AbstractMessageConverter {
} }
} }
catch (IOException ex) { catch (IOException ex) {
throw new MessageConversionException("Could not write proto message" + ex.getMessage(), ex); throw new MessageConversionException("Failed to print Protobuf message: " + ex.getMessage(), ex);
} }
return payload; return payload;

View File

@@ -408,9 +408,8 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
* {@linkplain #setCharset(Charset) charset} if it does not have one. * {@linkplain #setCharset(Charset) charset} if it does not have one.
* If {@code contentType} is {@code null}, * If {@code contentType} is {@code null},
* {@code application/x-www-form-urlencoded; charset=UTF-8} is returned. * {@code application/x-www-form-urlencoded; charset=UTF-8} is returned.
*
* <p>Subclasses can override this method to change this behavior. * <p>Subclasses can override this method to change this behavior.
* @param contentType the preferred content type, can be {@code null} * @param contentType the preferred content type (can be {@code null})
* @return the content type to be used * @return the content type to be used
* @since 5.2.2 * @since 5.2.2
*/ */

View File

@@ -29,6 +29,7 @@ import org.springframework.http.codec.HttpMessageWriter;
* Default implementation of {@link ExchangeStrategies.Builder}. * Default implementation of {@link ExchangeStrategies.Builder}.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Brian Clozel
* @since 5.0 * @since 5.0
*/ */
final class DefaultExchangeStrategiesBuilder implements ExchangeStrategies.Builder { final class DefaultExchangeStrategiesBuilder implements ExchangeStrategies.Builder {
@@ -79,7 +80,6 @@ final class DefaultExchangeStrategiesBuilder implements ExchangeStrategies.Build
private final List<HttpMessageWriter<?>> writers; private final List<HttpMessageWriter<?>> writers;
public DefaultExchangeStrategies(ClientCodecConfigurer codecConfigurer) { public DefaultExchangeStrategies(ClientCodecConfigurer codecConfigurer) {
this.codecConfigurer = codecConfigurer; this.codecConfigurer = codecConfigurer;
this.readers = unmodifiableCopy(this.codecConfigurer.getReaders()); this.readers = unmodifiableCopy(this.codecConfigurer.getReaders());
@@ -90,9 +90,8 @@ final class DefaultExchangeStrategiesBuilder implements ExchangeStrategies.Build
return Collections.unmodifiableList(new ArrayList<>(list)); return Collections.unmodifiableList(new ArrayList<>(list));
} }
@Override
@Deprecated @Deprecated
@Override
public Builder mutate() { public Builder mutate() {
return new DefaultExchangeStrategiesBuilder(this); return new DefaultExchangeStrategiesBuilder(this);
} }