File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
src/main/java/org/springframework/data Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,13 @@ public CustomConversions(ConverterConfiguration converterConfiguration) {
120120
121121 this .converterConfiguration = converterConfiguration ;
122122
123- List < Object > registeredConverters = collectPotentialConverterRegistrations (
123+ this . converters = collectPotentialConverterRegistrations (
124124 converterConfiguration .getStoreConversions (), converterConfiguration .getUserConverters ()).stream ()
125125 .filter (this ::isSupportedConverter ).filter (this ::shouldRegister )
126126 .map (ConverterRegistrationIntent ::getConverterRegistration ).map (this ::register ).distinct ()
127- .collect (Collectors .toList ());
127+ .sorted (Collections .reverseOrder ())
128+ .toList ();
128129
129- Collections .reverse (registeredConverters );
130-
131- this .converters = Collections .unmodifiableList (registeredConverters );
132130 this .simpleTypeHolder = new SimpleTypeHolder (customSimpleTypes ,
133131 converterConfiguration .getStoreConversions ().getStoreTypeHolder ());
134132 this .propertyValueConversions = converterConfiguration .getPropertyValueConversions ();
Original file line number Diff line number Diff line change @@ -183,13 +183,14 @@ EvaluationContextExtensionInformation getOrCreateInformation(Class<? extends Eva
183183 * @param extensions
184184 * @return
185185 */
186- private List <EvaluationContextExtensionAdapter > toAdapters (
186+ private List <EvaluationContextExtensionAdapter > toReversedAdapters (
187187 Collection <? extends EvaluationContextExtension > extensions ) {
188188
189- return extensions .stream ()//
190- .sorted (AnnotationAwareOrderComparator .INSTANCE )//
189+ return extensions .stream () //
190+ .sorted (AnnotationAwareOrderComparator .INSTANCE ) //
191191 .map (it -> new EvaluationContextExtensionAdapter (it , getOrCreateInformation (it ))) //
192- .collect (Collectors .toList ());
192+ .sorted (Collections .reverseOrder ()) //
193+ .toList ();
193194 }
194195
195196 /**
@@ -211,11 +212,9 @@ public ExtensionAwarePropertyAccessor(Collection<? extends EvaluationContextExte
211212
212213 Assert .notNull (extensions , "Extensions must not be null" );
213214
214- this .adapters = toAdapters (extensions );
215+ this .adapters = toReversedAdapters (extensions );
215216 this .adapterMap = adapters .stream ()//
216217 .collect (Collectors .toMap (EvaluationContextExtensionAdapter ::getExtensionId , it -> it ));
217-
218- Collections .reverse (this .adapters );
219218 }
220219
221220 @ Override
You can’t perform that action at this time.
0 commit comments