This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit dd4e7bdc7cdac31905018fc5cbd11566d19be225 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Apr 3 10:57:59 2022 -0400 Refactor commons code. --- src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 3 +-- src/main/java/org/apache/commons/lang3/text/StrTokenizer.java | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java index 5ed70db..6a617ac 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java +++ b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java @@ -892,15 +892,14 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build buffer[size++] = 't'; buffer[size++] = 'r'; buffer[size++] = 'u'; - buffer[size++] = 'e'; } else { ensureCapacity(size + 5); buffer[size++] = 'f'; buffer[size++] = 'a'; buffer[size++] = 'l'; buffer[size++] = 's'; - buffer[size++] = 'e'; } + buffer[size++] = 'e'; return this; } diff --git a/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java b/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java index c81732d..b4d8d72 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java +++ b/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java @@ -759,10 +759,6 @@ public class StrTokenizer implements ListIterator<String>, Cloneable { continue; } - // copy regular character from inside quotes - workArea.append(srcChars[pos++]); - trimStart = workArea.size(); - } else { // Not in quoting mode @@ -797,11 +793,10 @@ public class StrTokenizer implements ListIterator<String>, Cloneable { pos += trimmedLen; continue; } - - // copy regular character from outside quotes - workArea.append(srcChars[pos++]); - trimStart = workArea.size(); } + // copy regular character from inside quotes + workArea.append(srcChars[pos++]); + trimStart = workArea.size(); } // return condition when end of string found