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
5ba04ced6a
commit
8c7106d7f3
@ -16,6 +16,7 @@
|
|||||||
* 【core 】 修复4位bytes转换float问题(issue#I4M0E4@Gitee)
|
* 【core 】 修复4位bytes转换float问题(issue#I4M0E4@Gitee)
|
||||||
* 【core 】 修复CharSequenceUtil.replace问题(issue#I4M16G@Gitee)
|
* 【core 】 修复CharSequenceUtil.replace问题(issue#I4M16G@Gitee)
|
||||||
* 【json 】 修复JSONObject 初始化大小值未被使用问题(issue#2016@Github)
|
* 【json 】 修复JSONObject 初始化大小值未被使用问题(issue#2016@Github)
|
||||||
|
* 【core 】 修复StrUtil.startWith都为null返回错误问题(issue#I4MV7Q@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.7.17 (2021-12-09)
|
# 5.7.17 (2021-12-09)
|
||||||
|
@ -706,7 +706,7 @@ public class CharSequenceUtil {
|
|||||||
*/
|
*/
|
||||||
public static boolean startWith(CharSequence str, CharSequence prefix, boolean ignoreCase, boolean ignoreEquals) {
|
public static boolean startWith(CharSequence str, CharSequence prefix, boolean ignoreCase, boolean ignoreEquals) {
|
||||||
if (null == str || null == prefix) {
|
if (null == str || null == prefix) {
|
||||||
if (false == ignoreEquals) {
|
if (ignoreEquals) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return null == str && null == prefix;
|
return null == str && null == prefix;
|
||||||
|
@ -86,4 +86,11 @@ public class CharSequenceUtilTest {
|
|||||||
v = CharSequenceUtil.subPreGbk(s, 40, true);
|
v = CharSequenceUtil.subPreGbk(s, 40, true);
|
||||||
Assert.assertEquals(41, v.getBytes(CharsetUtil.CHARSET_GBK).length);
|
Assert.assertEquals(41, v.getBytes(CharsetUtil.CHARSET_GBK).length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void startWithTest(){
|
||||||
|
// https://gitee.com/dromara/hutool/issues/I4MV7Q
|
||||||
|
Assert.assertFalse(CharSequenceUtil.startWith("123", "123", false, true));
|
||||||
|
Assert.assertFalse(CharSequenceUtil.startWith(null, null, false, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user