Simplify condition in some methods
This commit is contained in:
committed by
Josh Cummings
parent
e76de931ce
commit
ab93541926
+4
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,12 +43,9 @@ final class ObjectToListStringConverter implements ConditionalGenericConverter {
|
||||
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
if (targetType.getElementTypeDescriptor() == null
|
||||
|| targetType.getElementTypeDescriptor().getType().equals(String.class) || sourceType == null
|
||||
|| ClassUtils.isAssignable(sourceType.getType(), targetType.getElementTypeDescriptor().getType())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
TypeDescriptor typeDescriptor = targetType.getElementTypeDescriptor();
|
||||
return typeDescriptor == null || typeDescriptor.getType().equals(String.class) || sourceType == null
|
||||
|| ClassUtils.isAssignable(sourceType.getType(), typeDescriptor.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-5
@@ -37,11 +37,8 @@ final class ObjectToMapStringObjectConverter implements ConditionalGenericConver
|
||||
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
if (targetType.getElementTypeDescriptor() == null
|
||||
|| targetType.getMapKeyTypeDescriptor().getType().equals(String.class)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return targetType.getElementTypeDescriptor() == null
|
||||
|| targetType.getMapKeyTypeDescriptor().getType().equals(String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user