mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复BooleanUtil.andOfWrap针对null错误问题
This commit is contained in:
@@ -380,7 +380,7 @@ public class BooleanUtil {
|
||||
}
|
||||
|
||||
for (final Boolean b : array) {
|
||||
if(isFalse(b)){
|
||||
if(!isTrue(b)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -72,4 +72,12 @@ public class BooleanUtilTest {
|
||||
Assert.assertEquals("on", BooleanUtil.toStringOnOff(true));
|
||||
Assert.assertEquals("off", BooleanUtil.toStringOnOff(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issue3587Test() {
|
||||
Boolean boolean1 = true;
|
||||
Boolean boolean2 = null;
|
||||
Boolean result = BooleanUtil.andOfWrap(boolean1, boolean2);
|
||||
Assert.assertFalse(result);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user