diff --git a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ExtensionRegistryInitializer.java b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ExtensionRegistryInitializer.java index decb36208d..95b5d430b2 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ExtensionRegistryInitializer.java +++ b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ExtensionRegistryInitializer.java @@ -25,10 +25,13 @@ import com.google.protobuf.ExtensionRegistry; *

This interface provides a facility to populate the {@code ExtensionRegistry}. * * @author Alex Antonov + * @author Sebastien Deleuze * @since 4.1 * @see * com.google.protobuf.ExtensionRegistry + * @deprecated as of Spring Framework 5.1, use {@link ExtensionRegistry} based contructors instead */ +@Deprecated public interface ExtensionRegistryInitializer { /** diff --git a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufHttpMessageConverter.java index 585b0edfde..75ece8284d 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufHttpMessageConverter.java @@ -77,6 +77,7 @@ import static org.springframework.http.MediaType.TEXT_PLAIN; * @author Alex Antonov * @author Brian Clozel * @author Juergen Hoeller + * @author Sebastien Deleuze * @since 4.1 * @see FormatFactory * @see JsonFormat @@ -107,7 +108,7 @@ public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter, Method> methodCache = new ConcurrentReferenceHashMap<>(); - private final ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); + final ExtensionRegistry extensionRegistry; @Nullable private final ProtobufFormatSupport protobufFormatSupport; @@ -117,20 +118,34 @@ public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter