修复TypeUtil.getClass无法识别GenericArrayType问题(pr#4138@Github)

This commit is contained in:
Looly
2025-11-23 23:27:45 +08:00
parent 1a7d522dff
commit 4d04d5daf9
2 changed files with 3 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
* 【core 】 修复`VersionUtil.matchEl`如果输入的版本范围表达式右边界为空时会抛出数组越界访问错误的问题pr#4130@Github * 【core 】 修复`VersionUtil.matchEl`如果输入的版本范围表达式右边界为空时会抛出数组越界访问错误的问题pr#4130@Github
* 【core 】 修复`Validator.isBetween`在高精度Number类型下存在精度丢失问题pr#4136@Github * 【core 】 修复`Validator.isBetween`在高精度Number类型下存在精度丢失问题pr#4136@Github
* 【core 】 修复`FileNameUtil.extName`在特殊后缀判断逻辑过于宽松导致误判问题pr#4142@Github * 【core 】 修复`FileNameUtil.extName`在特殊后缀判断逻辑过于宽松导致误判问题pr#4142@Github
* 【core 】 修复`TypeUtil.getClass`无法识别`GenericArrayType`问题pr#4138@Github
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
# 5.8.41(2025-10-12) # 5.8.41(2025-10-12)

View File

@@ -40,7 +40,7 @@ public class TypeUtilTest {
public void getClasses() { public void getClasses() {
Method method = ReflectUtil.getMethod(Parent.class, "getLevel"); Method method = ReflectUtil.getMethod(Parent.class, "getLevel");
Type returnType = TypeUtil.getReturnType(method); Type returnType = TypeUtil.getReturnType(method);
Class clazz = TypeUtil.getClass(returnType); Class<?> clazz = TypeUtil.getClass(returnType);
assertEquals(Level1.class, clazz); assertEquals(Level1.class, clazz);
method = ReflectUtil.getMethod(Level1.class, "getId"); method = ReflectUtil.getMethod(Level1.class, "getId");
@@ -67,7 +67,7 @@ public class TypeUtilTest {
} }
/** /**
* 测试getClass方法对参数化类型数组List<String>[]的处理 * 测试getClass方法对参数化类型数组{@code List<String>[]}的处理
* 验证数组组件类型能正确解析为原始类型 * 验证数组组件类型能正确解析为原始类型
*/ */
@Test @Test