fix: fix and close #I9V10O

This commit is contained in:
林钟一六 2024-06-04 22:15:20 +08:00
parent d111744080
commit 6c1764f1e6

View File

@ -285,17 +285,6 @@ public class ClassUtil {
}
Method[] declaredMethods = clazz.getDeclaredMethods();
if (clazz.isInterface()) {
for (Method method : declaredMethods) {
// 接口类只需要获取 default 方法
if (method.isDefault() && (predicate == null || predicate.test(method))) {
methods.add(method);
if (firstOnly) {
break;
}
}
}
} else {
for (Method method : declaredMethods) {
if (predicate == null || predicate.test(method)) {
methods.add(method);
@ -304,7 +293,6 @@ public class ClassUtil {
}
}
}
}
if (firstOnly && !methods.isEmpty()) {