mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix epe
This commit is contained in:
parent
8fe4eebe43
commit
34f0655a59
@ -379,7 +379,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());
|
||||
}
|
||||
|
||||
|
@ -111,4 +111,13 @@ public class StrJoinerTest {
|
||||
final StrJoiner merge = joiner1.merge(joiner2);
|
||||
Assertions.assertEquals("[123,456,789]", merge.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void issue3444Test() {
|
||||
final StrJoiner strJoinerEmpty = StrJoiner.of(",");
|
||||
Assertions.assertEquals(0, strJoinerEmpty.length());
|
||||
|
||||
final StrJoiner strJoinerWithContent = StrJoiner.of(",").append("haha");
|
||||
Assertions.assertEquals(4, strJoinerWithContent.length());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user