mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
fix bug
This commit is contained in:
parent
d9f6de720a
commit
3a259cdb58
@ -116,8 +116,11 @@ public class BeanUtil {
|
||||
if (ClassUtil.isNormalClass(clazz)) {
|
||||
for (final Method method : clazz.getMethods()) {
|
||||
if (method.getParameterCount() == 0) {
|
||||
if (method.getName().startsWith("get") || method.getName().startsWith("is")) {
|
||||
return true;
|
||||
final String name = method.getName();
|
||||
if (name.startsWith("get") || name.startsWith("is")) {
|
||||
if(false == "getClass".equals(name)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -892,4 +892,11 @@ public class BeanUtilTest {
|
||||
}, copyOptions);
|
||||
Assert.assertEquals("123", pojo.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasGetterTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I6M7Z7
|
||||
final boolean b = BeanUtil.hasGetter(Object.class);
|
||||
Assert.assertFalse(b);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user