commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kinow <...@git.apache.org>
Subject [GitHub] commons-text pull request #63: small-code-quality-improvements
Date Fri, 22 Sep 2017 02:36:02 GMT
Github user kinow commented on a diff in the pull request:

    https://github.com/apache/commons-text/pull/63#discussion_r140401739
  
    --- Diff: src/main/java/org/apache/commons/text/WordUtils.java ---
    @@ -614,13 +615,11 @@ public static String swapCase(final String str) {
             for (int index = 0; index < strLen;) {
                 final int oldCodepoint = str.codePointAt(index);
                 final int newCodePoint;
    -            if (Character.isUpperCase(oldCodepoint)) {
    +            if (Character.isUpperCase(oldCodepoint) || Character.isTitleCase(oldCodepoint)
) {
                     newCodePoint = Character.toLowerCase(oldCodepoint);
                     whitespace = false;
    -            } else if (Character.isTitleCase(oldCodepoint)) {
    -                newCodePoint = Character.toLowerCase(oldCodepoint);
    -                whitespace = false;
    -            } else if (Character.isLowerCase(oldCodepoint)) {
    +            }
    +            else if (Character.isLowerCase(oldCodepoint)) {
    --- End diff --
    
    Any reason for breaking the line here? Not sure if it's just GitHub UI getting confused,
or if the bracket is not in the same line as the else if statement...


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message