[
https://issues.apache.org/jira/browse/CASSANDRA-8755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000379#comment-15000379
]
Alexander Shopov commented on CASSANDRA-8755:
---------------------------------------------
I tried installing IntelliJ IDEA but could not figure out how to get the
String.replace warning.
I mainly use NetBeans and perhaps I missed some IDEA configuration.
Still I have rebased and reworked the patch to include the classes you mention.
Since these reduce the number of temporary, throw away j.u.r.Pattern-s., I have
went through the code to find more instances of such usages. These are the
calls:
1. String.replace(CharSequence, CharSequence)
2. String.replaceAll(String, String)
3. String.replaceFirst(String, String)
4. String.matches
5. String.split
I have reworked the patch into a series of patches that I am sending as a
tarball.
1st initial patch + changes you wanted.
2nd patch is adding more changes to reduce the throwaway regexps
3rd patch substitutes usage of regexp with trimming. This can be incompatible,
so double check.
4th patch is cosmetic - since I am touching a lot of classes - remove the unused
imports. As we only remove and not change - git annotate will still show
proper history.
> Replace trivial uses of String.replace/replaceAll/split with StringUtils
> methods
> --------------------------------------------------------------------------------
>
> Key: CASSANDRA-8755
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8755
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Jaroslav Kamenik
> Priority: Trivial
> Labels: lhf
> Attachments: trunk-8755.patch, trunk-8755.txt
>
>
> There are places in the code where those regex based methods are used with
> plain, not regexp, strings, so StringUtils alternatives should be faster.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)