You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/11/15 18:26:51 UTC

[GitHub] leventov commented on a change in pull request #6607: Prohibit String.replace() and String.replaceAll(), fix and prohibit some toString()-related redundancies

leventov commented on a change in pull request #6607: Prohibit String.replace() and String.replaceAll(), fix and prohibit some toString()-related redundancies
URL: https://github.com/apache/incubator-druid/pull/6607#discussion_r233957806
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/java/util/common/StringUtils.java
 ##########
 @@ -173,16 +163,81 @@ public static String urlEncode(String s)
     }
   }
 
-  private static String removeChar(String s, char c, int firstOccurranceIndex)
+  /**
+   * Removes all occurrences of the given char from the given string. This method is an optimal version of
+   * {@link String#replace(CharSequence, CharSequence) s.replace("c", "")}.
 
 Review comment:
   It's an empty string. `s.replace(":", "")` is literally the pattern that should be replaced with `removeChar(s, ':')` in the Druid code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org