change name

This commit is contained in:
Looly
2021-01-31 21:38:54 +08:00
parent d69b95f066
commit 5465293603
2 changed files with 15 additions and 1 deletions

View File

@@ -301,8 +301,21 @@ public class TypeUtil {
* @param types 泛型数组
* @return 是否含有泛型变量
* @since 4.5.7
* @deprecated 拼写错误,请使用{@link #hasTypeVariable(Type...)}
*/
@Deprecated
public static boolean hasTypeVeriable(Type... types) {
return hasTypeVariable(types);
}
/**
* 指定泛型数组中是否含有泛型变量
*
* @param types 泛型数组
* @return 是否含有泛型变量
* @since 4.5.7
*/
public static boolean hasTypeVariable(Type... types) {
for (Type type : types) {
if (type instanceof TypeVariable) {
return true;
@@ -379,7 +392,7 @@ public class TypeUtil {
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
// 泛型对象中含有未被转换的泛型变量
if (TypeUtil.hasTypeVeriable(actualTypeArguments)) {
if (TypeUtil.hasTypeVariable(actualTypeArguments)) {
actualTypeArguments = getActualTypes(type, parameterizedType.getActualTypeArguments());
if (ArrayUtil.isNotEmpty(actualTypeArguments)) {
// 替换泛型变量为实际类型例如List<T>变为List<String>