mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复BooleanUtil.andOfWrap针对null错误问题
This commit is contained in:
parent
fe01021c72
commit
9e1beae3eb
@ -42,6 +42,7 @@
|
|||||||
* 【core 】 修复NumberWordFormatter.format小数问题(issue#3579@Github)
|
* 【core 】 修复NumberWordFormatter.format小数问题(issue#3579@Github)
|
||||||
* 【db 】 修复JndiDSFactory空指针问题
|
* 【db 】 修复JndiDSFactory空指针问题
|
||||||
* 【core 】 修复BiMap.put错误的返回值(pr#1218@Gitee)
|
* 【core 】 修复BiMap.put错误的返回值(pr#1218@Gitee)
|
||||||
|
* 【core 】 修复BooleanUtil.andOfWrap针对null错误问题(issue#3587@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.8.27(2024-03-29)
|
# 5.8.27(2024-03-29)
|
||||||
|
@ -380,7 +380,7 @@ public class BooleanUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (final Boolean b : array) {
|
for (final Boolean b : array) {
|
||||||
if(isFalse(b)){
|
if(!isTrue(b)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,4 +72,12 @@ public class BooleanUtilTest {
|
|||||||
Assert.assertEquals("on", BooleanUtil.toStringOnOff(true));
|
Assert.assertEquals("on", BooleanUtil.toStringOnOff(true));
|
||||||
Assert.assertEquals("off", BooleanUtil.toStringOnOff(false));
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.hutool.json;
|
package cn.hutool.json;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Console;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user