mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix modifier bug
This commit is contained in:
parent
abdedf6822
commit
8e8518c8d1
@ -12,12 +12,14 @@
|
||||
* 【http 】 UserAgentUtil增加miniProgram判断(issue#1475@Github)
|
||||
* 【db 】 增加Ignite数据库驱动识别
|
||||
* 【core 】 DateUtil.parse支持带毫秒的UTC时间
|
||||
* 【core 】 IdcardUtil.Idcard增加toString(pr#1487@Github)
|
||||
|
||||
### Bug修复
|
||||
* 【core 】 修复IoUtil.readBytes的FileInputStream中isClose参数失效问题(issue#I3B7UD@Gitee)
|
||||
* 【core 】 修复DataUnit中KB不大写的问题
|
||||
* 【json 】 修复JSONUtil.getByPath类型错误问题(issue#I3BSDF@Gitee)
|
||||
* 【core 】 修复BeanUtil.toBean提供null未返回null的问题(issue#I3BQPV@Gitee)
|
||||
* 【core 】 修复ModifierUtil#modifiersToInt中逻辑判断问题(issue#1486@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -719,5 +719,15 @@ public class IdcardUtil {
|
||||
public Integer getGender() {
|
||||
return this.gender;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Idcard{" +
|
||||
"provinceCode='" + provinceCode + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", birthDate=" + birthDate +
|
||||
", gender=" + gender +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ public class ModifierUtil {
|
||||
private static int modifiersToInt(ModifierType... modifierTypes) {
|
||||
int modifier = modifierTypes[0].getValue();
|
||||
for(int i = 1; i < modifierTypes.length; i++) {
|
||||
modifier &= modifierTypes[i].getValue();
|
||||
modifier |= modifierTypes[i].getValue();
|
||||
}
|
||||
return modifier;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class ModifierUtilTest {
|
||||
|
||||
@Test
|
||||
public void hasModifierTest() throws NoSuchMethodException {
|
||||
Method method = ModifierUtilTest.class.getDeclaredMethod("ddd");
|
||||
Assert.assertTrue(ModifierUtil.hasModifier(method, ModifierUtil.ModifierType.PRIVATE));
|
||||
Assert.assertTrue(ModifierUtil.hasModifier(method,
|
||||
ModifierUtil.ModifierType.PRIVATE,
|
||||
ModifierUtil.ModifierType.STATIC)
|
||||
);
|
||||
}
|
||||
private static void ddd() {
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user