drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill pull request #512: Drill 4573 fix issue with unicode chars
Date Tue, 07 Jun 2016 00:48:30 GMT
Github user jinfengni commented on a diff in the pull request:

    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctions.java
    @@ -268,7 +284,13 @@ public void eval() {
         public void setup() {
    -      matcher = java.util.regex.Pattern.compile(org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(pattern.start,
 pattern.end,  pattern.buffer)).matcher("");
    +      CharSequenceWrapper patternWrapper = new CharSequenceWrapper(pattern.start, pattern.end,
    +      char[] chars = new char[patternWrapper.length()];
    +      for(int i=0; i<patternWrapper.length(); i++){
    +          chars[i] = patternWrapper.charAt(i);
    +      }
    +      String patternChars = new String(chars);
    --- End diff --
    I can not see why we want to use CharSequenceWrapper here. You created String object,
same as prior method. Any benefit of using CharSequenceWrapper? 

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message