Register custom before default codecs

Closes gh-22612
This commit is contained in:
Rossen Stoyanchev
2019-03-20 20:52:57 -04:00
parent e9819b7535
commit 4938831575
2 changed files with 13 additions and 13 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.
@@ -72,11 +72,11 @@ class BaseCodecConfigurer implements CodecConfigurer {
public List<HttpMessageReader<?>> getReaders() {
List<HttpMessageReader<?>> result = new ArrayList<>();
result.addAll(this.defaultCodecs.getTypedReaders());
result.addAll(this.customCodecs.getTypedReaders());
result.addAll(this.defaultCodecs.getTypedReaders());
result.addAll(this.defaultCodecs.getObjectReaders());
result.addAll(this.customCodecs.getObjectReaders());
result.addAll(this.defaultCodecs.getObjectReaders());
result.addAll(this.defaultCodecs.getCatchAllReaders());
return result;
@@ -96,11 +96,11 @@ class BaseCodecConfigurer implements CodecConfigurer {
protected List<HttpMessageWriter<?>> getWritersInternal(boolean forMultipart) {
List<HttpMessageWriter<?>> result = new ArrayList<>();
result.addAll(this.defaultCodecs.getTypedWriters(forMultipart));
result.addAll(this.customCodecs.getTypedWriters());
result.addAll(this.defaultCodecs.getTypedWriters(forMultipart));
result.addAll(this.defaultCodecs.getObjectWriters(forMultipart));
result.addAll(this.customCodecs.getObjectWriters());
result.addAll(this.defaultCodecs.getObjectWriters(forMultipart));
result.addAll(this.defaultCodecs.getCatchAllWriters());
return result;