mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
ignore bridge
This commit is contained in:
parent
30515f0351
commit
99763a32b3
@ -24,6 +24,7 @@
|
||||
* 【core 】 DateUtil.toIntSecond标记为弃用(issue#I4JHPR@Gitee)
|
||||
* 【db 】 Db.executeBatch标记一个重载为弃用(issue#I4JIPH@Gitee)
|
||||
* 【core 】 增加CharSequenceUtil.subPreGbk重载(issue#I4JO2E@Gitee)
|
||||
* 【core 】 ReflectUtil.getMethod排除桥接方法(pr#1965@Github)
|
||||
*
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复FileResource构造fileName参数无效问题(issue#1942@Github)
|
||||
|
@ -2551,7 +2551,12 @@ public class CharSequenceUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 比较两个字符串是否相等。
|
||||
* 比较两个字符串是否相等,规则如下
|
||||
* <ul>
|
||||
* <li>str1和str2都为{@code null}</li>
|
||||
* <li>忽略大小写使用{@link String#equalsIgnoreCase(String)}判断相等</li>
|
||||
* <li>不忽略大小写使用{@link String#contentEquals(CharSequence)}判断相等</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param str1 要比较的字符串1
|
||||
* @param str2 要比较的字符串2
|
||||
|
@ -498,11 +498,9 @@ public class ReflectUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找指定方法 如果找不到对应的方法则返回{@code null}
|
||||
*
|
||||
* <p>
|
||||
* 此方法为精准获取方法名,即方法名和参数数量和类型必须一致,否则返回{@code null}。
|
||||
* </p>
|
||||
* 查找指定方法 如果找不到对应的方法则返回{@code null}<br>
|
||||
* 此方法为精准获取方法名,即方法名和参数数量和类型必须一致,否则返回{@code null}。<br>
|
||||
* 如果查找的方法有多个同参数类型重载,查找第一个找到的方法
|
||||
*
|
||||
* @param clazz 类,如果为{@code null}返回{@code null}
|
||||
* @param ignoreCase 是否忽略大小写
|
||||
@ -520,13 +518,14 @@ public class ReflectUtil {
|
||||
final Method[] methods = getMethods(clazz);
|
||||
if (ArrayUtil.isNotEmpty(methods)) {
|
||||
for (Method method : methods) {
|
||||
if (StrUtil.equals(methodName, method.getName(), ignoreCase)) {
|
||||
if (ClassUtil.isAllAssignableFrom(method.getParameterTypes(), paramTypes)) {
|
||||
if (StrUtil.equals(methodName, method.getName(), ignoreCase)
|
||||
&& ClassUtil.isAllAssignableFrom(method.getParameterTypes(), paramTypes)
|
||||
//排除桥接方法,pr#1965@Github
|
||||
&& false == method.isBridge()) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -586,7 +585,9 @@ public class ReflectUtil {
|
||||
final Method[] methods = getMethods(clazz);
|
||||
if (ArrayUtil.isNotEmpty(methods)) {
|
||||
for (Method method : methods) {
|
||||
if (StrUtil.equals(methodName, method.getName(), ignoreCase)) {
|
||||
if (StrUtil.equals(methodName, method.getName(), ignoreCase)
|
||||
// 排除桥接方法
|
||||
&& false == method.isBridge()) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user