Clean up warnings in spring-core
This commit is contained in:
@@ -182,7 +182,7 @@ public class MethodParameter {
|
||||
*/
|
||||
@Nullable
|
||||
public Constructor<?> getConstructor() {
|
||||
return (this.executable instanceof Constructor ? (Constructor) this.executable : null);
|
||||
return (this.executable instanceof Constructor ? (Constructor<?>) this.executable : null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -586,7 +586,7 @@ public class MethodParameter {
|
||||
parameterNames = discoverer.getParameterNames((Method) this.executable);
|
||||
}
|
||||
else if (this.executable instanceof Constructor) {
|
||||
parameterNames = discoverer.getParameterNames((Constructor) this.executable);
|
||||
parameterNames = discoverer.getParameterNames((Constructor<?>) this.executable);
|
||||
}
|
||||
if (parameterNames != null) {
|
||||
this.parameterName = parameterNames[this.parameterIndex];
|
||||
|
||||
@@ -251,7 +251,6 @@ public class TypeDescriptor implements Serializable {
|
||||
* @param annotationType the annotation type
|
||||
* @return the annotation, or {@code null} if no such annotation exists on this type descriptor
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
|
||||
if (this.annotatedElement.isEmpty()) {
|
||||
|
||||
@@ -76,7 +76,7 @@ final class ObjectToOptionalConverter implements ConditionalGenericConverter {
|
||||
else if (targetType.getResolvableType().hasGenerics()) {
|
||||
Object target = this.conversionService.convert(source, sourceType, new GenericTypeDescriptor(targetType));
|
||||
if (target == null || (target.getClass().isArray() && Array.getLength(target) == 0) ||
|
||||
(target instanceof Collection && ((Collection) target).isEmpty())) {
|
||||
(target instanceof Collection && ((Collection<?>) target).isEmpty())) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(target);
|
||||
|
||||
Reference in New Issue
Block a user