Skip to content

Commit

Permalink
Refactor bad smells:
Browse files Browse the repository at this point in the history
- SizeReplaceableByIsEmpty
Checking if something is empty should be done by Object#isEmpty instead of Object.size==0
  • Loading branch information
MartinWitt authored and chrisliebaer committed Jan 10, 2023
1 parent 767e74b commit 002e790
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public List<String> split(String message, int limit) {
if (remain.peekFirst().length() + sb.length() + 1 > limit) { // adding one for space

// force split string if stringbuffer is empty, this happens if next word is too big even when on a single line
if (sb.length() == 0) {
if (sb.isEmpty()) {
String s = remain.removeFirst();
sb.append(s, 0, limit + 1);

Expand Down

0 comments on commit 002e790

Please sign in to comment.