2626import org .springframework .beans .factory .BeanFactory ;
2727import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
2828import org .springframework .beans .factory .config .AutowireCapableBeanFactory ;
29+ import org .springframework .data .convert .PropertyValueConverter .ValueConversionContext ;
2930import org .springframework .data .mapping .PersistentProperty ;
3031import org .springframework .lang .Nullable ;
3132import org .springframework .util .Assert ;
@@ -59,14 +60,14 @@ static class CompositePropertyValueConverterFactory implements PropertyValueConv
5960
6061 @ Nullable
6162 @ Override
62- public <A , B , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <A , B , C > getConverter (
63+ public <A , B , C extends ValueConversionContext <?> > PropertyValueConverter <A , B , C > getConverter (
6364 PersistentProperty <?> property ) {
6465 return delegates .stream ().map (it -> (PropertyValueConverter <A , B , C >) it .getConverter (property ))
6566 .filter (Objects ::nonNull ).findFirst ().orElse (null );
6667 }
6768
6869 @ Override
69- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
70+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
7071 Class <? extends PropertyValueConverter <S , T , C >> converterType ) {
7172 return delegates .stream ().filter (it -> it .getConverter (converterType ) != null ).findFirst ()
7273 .map (it -> it .getConverter (converterType )).orElse (null );
@@ -82,7 +83,7 @@ public <S, T, C extends PropertyValueConverter.ValueConversionContext> PropertyV
8283 static class SimplePropertyConverterFactory implements PropertyValueConverterFactory {
8384
8485 @ Override
85- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
86+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
8687 Class <? extends PropertyValueConverter <S , T , C >> converterType ) {
8788
8889 Assert .notNull (converterType , "ConverterType must not be null!" );
@@ -110,7 +111,7 @@ public BeanFactoryAwarePropertyValueConverterFactory(BeanFactory beanFactory) {
110111 }
111112
112113 @ Override
113- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
114+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
114115 Class <? extends PropertyValueConverter <S , T , C >> converterType ) {
115116
116117 Assert .state (beanFactory != null , "BeanFactory must not be null. Did you forget to set it!" );
@@ -145,14 +146,14 @@ public ConfiguredInstanceServingValueConverterFactory(PropertyValueConverterRegi
145146
146147 @ Nullable
147148 @ Override
148- public <A , B , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <A , B , C > getConverter (
149+ public <A , B , C extends ValueConversionContext <?> > PropertyValueConverter <A , B , C > getConverter (
149150 PersistentProperty <?> property ) {
150151 return (PropertyValueConverter <A , B , C >) conversionsRegistrar .getConverter (property .getOwner ().getType (),
151152 property .getName ());
152153 }
153154
154155 @ Override
155- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
156+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
156157 Class <? extends PropertyValueConverter <S , T , C >> converterType ) {
157158 return null ;
158159 }
@@ -170,55 +171,55 @@ static class CachingPropertyValueConverterFactory implements PropertyValueConver
170171 private final Cache cache = new Cache ();
171172
172173 public CachingPropertyValueConverterFactory (PropertyValueConverterFactory delegate ) {
173-
174+
174175 Assert .notNull (delegate , "Delegate must not be null!" );
175176 this .delegate = delegate ;
176177 }
177178
178179 @ Nullable
179180 @ Override
180- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
181+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
181182 PersistentProperty <?> property ) {
182183
183184 PropertyValueConverter converter = cache .get (property );
184- if ( converter != null ) {
185- return converter ;
186- }
187- return cache .cache (property , delegate .getConverter (property ));
185+
186+ return converter != null
187+ ? converter
188+ : cache .cache (property , delegate .getConverter (property ));
188189 }
189190
190191 @ Override
191- public <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > getConverter (
192+ public <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > getConverter (
192193 Class <? extends PropertyValueConverter <S , T , C >> converterType ) {
193194
194195 PropertyValueConverter converter = cache .get (converterType );
195- if ( converter != null ) {
196- return converter ;
197- }
198- return cache .cache (converterType , delegate .getConverter (converterType ));
196+
197+ return converter != null
198+ ? converter
199+ : cache .cache (converterType , delegate .getConverter (converterType ));
199200 }
200201
201202 static class Cache {
202203
203- Map <PersistentProperty <?>, PropertyValueConverter <?, ?, ? extends PropertyValueConverter . ValueConversionContext >> perPropertyCache = new HashMap <>();
204- Map <Class <?>, PropertyValueConverter <?, ?, ? extends PropertyValueConverter . ValueConversionContext >> typeCache = new HashMap <>();
204+ Map <PersistentProperty <?>, PropertyValueConverter <?, ?, ? extends ValueConversionContext <?> >> perPropertyCache = new HashMap <>();
205+ Map <Class <?>, PropertyValueConverter <?, ?, ? extends ValueConversionContext <?> >> typeCache = new HashMap <>();
205206
206- PropertyValueConverter <?, ?, ? extends PropertyValueConverter . ValueConversionContext > get (PersistentProperty <?> property ) {
207+ PropertyValueConverter <?, ?, ? extends ValueConversionContext <?> > get (PersistentProperty <?> property ) {
207208 return perPropertyCache .get (property );
208209 }
209210
210- PropertyValueConverter <?, ?, ? extends PropertyValueConverter . ValueConversionContext > get (Class <?> type ) {
211+ PropertyValueConverter <?, ?, ? extends ValueConversionContext <?> > get (Class <?> type ) {
211212 return typeCache .get (type );
212213 }
213214
214- <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > cache (PersistentProperty <?> property ,
215+ <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > cache (PersistentProperty <?> property ,
215216 PropertyValueConverter <S , T , C > converter ) {
216217 perPropertyCache .putIfAbsent (property , converter );
217218 cache (property .getValueConverterType (), converter );
218219 return converter ;
219220 }
220221
221- <S , T , C extends PropertyValueConverter . ValueConversionContext > PropertyValueConverter <S , T , C > cache (Class <?> type ,
222+ <S , T , C extends ValueConversionContext <?> > PropertyValueConverter <S , T , C > cache (Class <?> type ,
222223 PropertyValueConverter <S , T , C > converter ) {
223224 typeCache .putIfAbsent (type , converter );
224225 return converter ;
0 commit comments