mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复StrBuildercharAt越界判断错误(pr#4094@Github)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
* 【db 】 修复`SqlUtil.removeOuterOrderBy`处理没有order by的语句导致异常问题(pr#4089@Github)
|
||||
* 【extra 】 修复`Sftp.upload`目标路径为null时空指针问题(issue#ID14WX@Gitee)
|
||||
* 【ai 】 修复`AIConfigBuilder`中方法名拼写错误(pr#1382@Gitee)
|
||||
* 【core 】 修复`StrBuilder`charAt越界判断错误(pr#4094@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.40(2025-08-26)
|
||||
|
||||
@@ -135,9 +135,9 @@ public class StrBuilderTest {
|
||||
@Test
|
||||
void charAtTest() {
|
||||
final StrBuilder helloWorld = StrBuilder.create("Hello World");
|
||||
Assertions.assertEquals(helloWorld.charAt(-1),'d');
|
||||
Assertions.assertEquals(helloWorld.charAt(0),'H');
|
||||
Assertions.assertEquals(helloWorld.charAt(10),'d');
|
||||
Assertions.assertEquals('d', helloWorld.charAt(-1));
|
||||
Assertions.assertEquals('H', helloWorld.charAt(0));
|
||||
Assertions.assertEquals('d', helloWorld.charAt(10));
|
||||
Assertions.assertThrows(StringIndexOutOfBoundsException.class, () -> helloWorld.charAt(11));;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user