修复StrBuildercharAt越界判断错误(pr#4094@Github)

This commit is contained in:
Looly
2025-10-10 17:34:10 +08:00
parent 57c58d76f1
commit fafec9d351
2 changed files with 4 additions and 3 deletions

View File

@@ -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)

View File

@@ -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));;
}
}