Skip to content

Commit bb244ed

Browse files
committed
Polishing.
Address compiler warnings. See #3309
1 parent 06a98db commit bb244ed

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static class BeanFactoryAwarePropertyValueConverterFactory implements PropertyVa
116116
}
117117

118118
@Override
119-
@SuppressWarnings("unchecked")
120119
public <DV, SV, C extends ValueConversionContext<?>> @Nullable PropertyValueConverter<DV, SV, C> getConverter(
121120
Class<? extends PropertyValueConverter<DV, SV, C>> converterType) {
122121

@@ -125,8 +124,7 @@ static class BeanFactoryAwarePropertyValueConverterFactory implements PropertyVa
125124
PropertyValueConverter<DV, SV, C> converter = beanFactory.getBeanProvider(converterType).getIfAvailable();
126125

127126
if (converter == null && beanFactory instanceof AutowireCapableBeanFactory) {
128-
return (PropertyValueConverter<DV, SV, C>) ((AutowireCapableBeanFactory) beanFactory).createBean(converterType,
129-
AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
127+
return ((AutowireCapableBeanFactory) beanFactory).createBean(converterType);
130128
}
131129

132130
return converter;
@@ -227,8 +225,7 @@ static class Cache {
227225

228226
@Contract("_, null -> null;_, !null -> !null")
229227
<S, T, C extends ValueConversionContext<?>> @Nullable PropertyValueConverter<S, T, C> cache(
230-
PersistentProperty<?> property,
231-
@Nullable PropertyValueConverter<S, T, C> converter) {
228+
PersistentProperty<?> property, @Nullable PropertyValueConverter<S, T, C> converter) {
232229

233230
perPropertyCache.putIfAbsent(property, Optional.ofNullable(converter));
234231

src/main/java/org/springframework/data/util/TypeScanner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ default TypeScanner scanPackages(String... packageNames) {
9898
* @return new instance of {@link TypeScanner}.
9999
* @see #forTypesAnnotatedWith(Collection)
100100
*/
101+
@SuppressWarnings("unchecked")
101102
default TypeScanner forTypesAnnotatedWith(Class<? extends Annotation>... annotations) {
102103
return forTypesAnnotatedWith(Arrays.asList(annotations));
103104
}
@@ -114,7 +115,7 @@ default TypeScanner forTypesAnnotatedWith(Class<? extends Annotation>... annotat
114115
* Define what happens in the case of a {@link ClassNotFoundException}.
115116
*
116117
* @param action must not be {@literal null}.
117-
* @return
118+
* @return new instance of {@link TypeScanner}.
118119
*/
119120
TypeScanner onClassNotFound(Consumer<ClassNotFoundException> action);
120121

0 commit comments

Comments
 (0)