commons-lang icon indicating copy to clipboard operation
commons-lang copied to clipboard

StringUtils.abbreviate handles empty abbrevMarker

Open jordanjenkins opened this issue 5 years ago • 1 comments

StringUtils.abbreviate would not abbreviate properly when an empty String was passed to abbrevMarker or abbrevMarker is null Expected behaviour: abbreviate("much too long text", "", 13).equals("much too long") Actual behaviour: abbreviate("much too long text", "", 13).equals("much too long text")

Behaves the same when abbrevMarker is null.

Added if statements to handle empty and null abbrevMarker Passed all tests

jordanjenkins avatar Nov 02 '19 18:11 jordanjenkins

Coverage Status

Coverage increased (+0.001%) to 95.377% when pulling 050682bcc76077c49338125c7a0357d3ab61f9d9 on jordanjenkins:StringUtilsAbbreviateFix into 8445d3a9911ec67f07b76c0c44cc4c8ac0c16178 on apache:master.

coveralls avatar Nov 02 '19 18:11 coveralls