mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复BooleanUtil.andOfWrap针对null错误问题
This commit is contained in:
parent
6689c08ecf
commit
7999baec85
@ -397,7 +397,7 @@ public class BooleanUtil {
|
||||
}
|
||||
|
||||
for (final Boolean b : array) {
|
||||
if(isFalse(b)){
|
||||
if(!isTrue(b)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -107,4 +107,12 @@ public class BooleanUtilTest {
|
||||
Assertions.assertNull(BooleanUtil.toBooleanObject(null));
|
||||
Assertions.assertNull(BooleanUtil.toBooleanObject("不识别"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issue3587Test() {
|
||||
final Boolean boolean1 = true;
|
||||
final Boolean boolean2 = null;
|
||||
final Boolean result = BooleanUtil.andOfWrap(boolean1, boolean2);
|
||||
Assertions.assertFalse(result);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user