mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix bug
This commit is contained in:
parent
d9f6de720a
commit
3a259cdb58
@ -116,8 +116,11 @@ public class BeanUtil {
|
|||||||
if (ClassUtil.isNormalClass(clazz)) {
|
if (ClassUtil.isNormalClass(clazz)) {
|
||||||
for (final Method method : clazz.getMethods()) {
|
for (final Method method : clazz.getMethods()) {
|
||||||
if (method.getParameterCount() == 0) {
|
if (method.getParameterCount() == 0) {
|
||||||
if (method.getName().startsWith("get") || method.getName().startsWith("is")) {
|
final String name = method.getName();
|
||||||
return true;
|
if (name.startsWith("get") || name.startsWith("is")) {
|
||||||
|
if(false == "getClass".equals(name)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -892,4 +892,11 @@ public class BeanUtilTest {
|
|||||||
}, copyOptions);
|
}, copyOptions);
|
||||||
Assert.assertEquals("123", pojo.getName());
|
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…
x
Reference in New Issue
Block a user