commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HiuKwok <...@git.apache.org>
Subject [GitHub] commons-lang pull request #340: [LANG-1406] StringIndexOutOfBoundsException ...
Date Mon, 13 Aug 2018 11:24:12 GMT
Github user HiuKwok commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/340#discussion_r209574053
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
    @@ -5596,8 +5596,8 @@ private static String replace(final String text, String searchString,
final Stri
              }
              String searchText = text;
              if (ignoreCase) {
    -             searchText = text.toLowerCase();
    -             searchString = searchString.toLowerCase();
    +             searchText = text.toUpperCase();
    +             searchString = searchString.toUpperCase();
    --- End diff --
    
    Hi @kinow, yes you are right after I did try to come up with a draft java main to generate
all || most unicode in string and compare it's length between original, toLowerCase() and
to UpperCase().
    
    ![image](https://user-images.githubusercontent.com/37996731/44028895-032488d4-9f2e-11e8-839b-c1259a182b8e.png)
      
    It's seem like no matter which one we pick (toLowerCase || toUpperCase), it would still
tend to come up with a incorrect length.
    
    Just a quick question what you mean by remove the ```length( )``` mean? Would you mind
to specify more on that? 
    
    Thanks, 


---

Mime
View raw message