Browse Source

Polishing.

Address compiler warnings.

See #3309
pull/3314/head
Mark Paluch 6 months ago
parent
commit
bb244edcc3
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 7
      src/main/java/org/springframework/data/convert/PropertyValueConverterFactories.java
  2. 3
      src/main/java/org/springframework/data/util/TypeScanner.java

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

@ -116,7 +116,6 @@ final class PropertyValueConverterFactories { @@ -116,7 +116,6 @@ final class PropertyValueConverterFactories {
}
@Override
@SuppressWarnings("unchecked")
public <DV, SV, C extends ValueConversionContext<?>> @Nullable PropertyValueConverter<DV, SV, C> getConverter(
Class<? extends PropertyValueConverter<DV, SV, C>> converterType) {
@ -125,8 +124,7 @@ final class PropertyValueConverterFactories { @@ -125,8 +124,7 @@ final class PropertyValueConverterFactories {
PropertyValueConverter<DV, SV, C> converter = beanFactory.getBeanProvider(converterType).getIfAvailable();
if (converter == null && beanFactory instanceof AutowireCapableBeanFactory) {
return (PropertyValueConverter<DV, SV, C>) ((AutowireCapableBeanFactory) beanFactory).createBean(converterType,
AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
return ((AutowireCapableBeanFactory) beanFactory).createBean(converterType);
}
return converter;
@ -227,8 +225,7 @@ final class PropertyValueConverterFactories { @@ -227,8 +225,7 @@ final class PropertyValueConverterFactories {
@Contract("_, null -> null;_, !null -> !null")
<S, T, C extends ValueConversionContext<?>> @Nullable PropertyValueConverter<S, T, C> cache(
PersistentProperty<?> property,
@Nullable PropertyValueConverter<S, T, C> converter) {
PersistentProperty<?> property, @Nullable PropertyValueConverter<S, T, C> converter) {
perPropertyCache.putIfAbsent(property, Optional.ofNullable(converter));

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

@ -98,6 +98,7 @@ public interface TypeScanner { @@ -98,6 +98,7 @@ public interface TypeScanner {
* @return new instance of {@link TypeScanner}.
* @see #forTypesAnnotatedWith(Collection)
*/
@SuppressWarnings("unchecked")
default TypeScanner forTypesAnnotatedWith(Class<? extends Annotation>... annotations) {
return forTypesAnnotatedWith(Arrays.asList(annotations));
}
@ -114,7 +115,7 @@ public interface TypeScanner { @@ -114,7 +115,7 @@ public interface TypeScanner {
* Define what happens in the case of a {@link ClassNotFoundException}.
*
* @param action must not be {@literal null}.
* @return
* @return new instance of {@link TypeScanner}.
*/
TypeScanner onClassNotFound(Consumer<ClassNotFoundException> action);

Loading…
Cancel
Save