mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
修复StrJoin当append内容后调用length()会出现空指针问题
This commit is contained in:
parent
99303ef7e0
commit
ab1b2c5e48
@ -2,10 +2,11 @@
|
||||
# 🚀Changelog
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.25(2023-12-24)
|
||||
# 5.8.25(2023-12-26)
|
||||
|
||||
### 🐣新特性
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复StrJoin当append内容后调用length()会出现空指针问题(issue#3444@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.24(2023-12-23)
|
||||
@ -23,7 +24,7 @@
|
||||
* 【http 】 HTMLFilter保留p标签(issue#3433@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复LocalDateTime#parseDate未判断空问题问题(issue#I8FN7F@Gitee)
|
||||
* 【core 】 修复LocalDateTime#parseDate未判断空问题(issue#I8FN7F@Gitee)
|
||||
* 【http 】 修复RootAction send404 抛异常问题(pr#1107@Gitee)
|
||||
* 【extra 】 修复Archiver 最后一个 Entry 为空文件夹时未关闭 Entry问题(pr#1123@Gitee)
|
||||
* 【core 】 修复ImgUtil.convert png转jpg在jdk9+中失败问题(issue#I8L8UA@Gitee)
|
||||
@ -33,7 +34,7 @@
|
||||
* 【http 】 修复graalvm编译后,未读取Content-Length可能导致的读取时间过长问题(issue#I6Q30X@Gitee)
|
||||
* 【core 】 修复JavaSourceCompiler.addSource目录处理错误问题(issue#3425@Github)
|
||||
* 【core 】 修复时间戳转Bean时异常问题(issue#I8NMP7@Gitee)
|
||||
* 【core 】 修复PostgreSQL使用upsert字段大小写问题问题(issue#I8PB4X@Gitee)
|
||||
* 【core 】 修复PostgreSQL使用upsert字段大小写问题(issue#I8PB4X@Gitee)
|
||||
* 【extra 】 修复TinyPinyinEngine可能的空指针问题(issue#3437@Github)
|
||||
* 【core 】 修复graalvm原生打包使用http工具被转为file协议问题(issue#I8PY3Y@Gitee)
|
||||
* 【poi 】 修复cloneSheet参数错误导致非XSSFWorkbook错误命名问题(issue#I8QIBB@Gitee)
|
||||
|
4
bin/sync.sh
Normal file
4
bin/sync.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
git checkout v5-dev
|
||||
git pull osc v5-dev
|
@ -357,7 +357,7 @@ public class StrJoiner implements Appendable, Serializable {
|
||||
* @since 5.7.22
|
||||
*/
|
||||
public int length() {
|
||||
return (this.appendable != null ? this.appendable.toString().length() + suffix.length() :
|
||||
return (this.appendable != null ? this.appendable.toString().length() + StrUtil.length(suffix) :
|
||||
null == this.emptyResult ? -1 : emptyResult.length());
|
||||
}
|
||||
|
||||
|
@ -99,4 +99,13 @@ public class StrJoinerTest {
|
||||
final StrJoiner merge = joiner1.merge(joiner2);
|
||||
Assert.assertEquals("[123,456,789]", merge.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issue3444Test() {
|
||||
final StrJoiner strJoinerEmpty = StrJoiner.of(",");
|
||||
Assert.assertEquals(0, strJoinerEmpty.length());
|
||||
|
||||
final StrJoiner strJoinerWithContent = StrJoiner.of(",").append("haha");
|
||||
Assert.assertEquals(4, strJoinerWithContent.length());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user