You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/06/06 13:24:19 UTC
(commons-csv) 02/03: No need to nest elses
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-csv.git
commit 8c75343539f42812acca7e21b9b4d55180d1b8c7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 6 09:24:03 2025 -0400
No need to nest elses
---
src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java b/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
index 8c0a034a..75748d81 100644
--- a/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
+++ b/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
@@ -140,11 +140,11 @@ final class ExtendedBufferedReader extends UnsynchronizedBufferedReader {
if (Character.isHighSurrogate(cChar)) {
// Move on to the next char (low surrogate)
return 0;
- } else if (Character.isSurrogatePair(lChar, cChar)) {
+ }
+ if (Character.isSurrogatePair(lChar, cChar)) {
return encoder.encode(CharBuffer.wrap(new char[] { lChar, cChar })).limit();
- } else {
- throw new CharacterCodingException();
}
+ throw new CharacterCodingException();
}
/**