mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
fix: 修复ClassUtil.doGetMethods中引用错误问题
This commit is contained in:
parent
9cca7e69cc
commit
8c34b5a2fd
@ -289,8 +289,8 @@ public class ClassUtil {
|
|||||||
|
|
||||||
private static void doGetMethods(Class<?> clazz, List<Method> methods, Predicate<Method> predicate, boolean firstOnly) {
|
private static void doGetMethods(Class<?> clazz, List<Method> methods, Predicate<Method> predicate, boolean firstOnly) {
|
||||||
applyAllClass(clazz, currentClass -> {
|
applyAllClass(clazz, currentClass -> {
|
||||||
Method[] declaredMethods = clazz.getDeclaredMethods();
|
Method[] declaredMethods = currentClass.getDeclaredMethods();
|
||||||
if (clazz.isInterface()) {
|
if (currentClass.isInterface()) {
|
||||||
for (Method method : declaredMethods) {
|
for (Method method : declaredMethods) {
|
||||||
// 接口类只需要获取 default 方法
|
// 接口类只需要获取 default 方法
|
||||||
if (method.isDefault() && (predicate == null || predicate.test(method))) {
|
if (method.isDefault() && (predicate == null || predicate.test(method))) {
|
||||||
@ -314,7 +314,7 @@ public class ClassUtil {
|
|||||||
if (firstOnly && !methods.isEmpty()) {
|
if (firstOnly && !methods.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Class<?>[] interfaces = clazz.getInterfaces();
|
Class<?>[] interfaces = currentClass.getInterfaces();
|
||||||
for (Class<?> anInterface : interfaces) {
|
for (Class<?> anInterface : interfaces) {
|
||||||
doGetMethods(anInterface, methods, predicate, firstOnly);
|
doGetMethods(anInterface, methods, predicate, firstOnly);
|
||||||
// 只获取第一个并且集合不为空就结束遍历
|
// 只获取第一个并且集合不为空就结束遍历
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user