Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jackpot] Rewrite "String::replaceAll with dot" inspection to apply to more cases and methods #3218

Merged
merged 1 commit into from Nov 24, 2021

Conversation

mbien
Copy link
Member

@mbien mbien commented Oct 6, 2021

The "String.replaceAll(".", )" probable-bug inspection was limited to the '.' character and the replaceAll method.

This PR rewrites it to apply to more single-char Strings consisting of a single regex control character and to more methods which expect regexes.

examples:

"f.o.o".replaceAll(".",  "")
=>
"f.o.o".replaceAll("\\.",  "")

"f$o$o".split("$")
=>
"f$o$o".split("\\$")

str.replaceFirst("(", "[")
=>
str.replaceFirst("\\(", "[")

@mbien
Copy link
Member Author

mbien commented Nov 22, 2021

@jlahoda would you like to take a look at this PR?

Copy link
Contributor

@jlahoda jlahoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@matthiasblaesing
Copy link
Contributor

Travis is happy - could you please squash this into a single commit?

@mbien
Copy link
Member Author

mbien commented Nov 24, 2021

Travis is happy - could you please squash this into a single commit?

sure, squashed

@matthiasblaesing
Copy link
Contributor

Thank you.

@matthiasblaesing matthiasblaesing merged commit 23437da into apache:master Nov 24, 2021
@junichi11 junichi11 added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label Nov 26, 2021
@mbien mbien added the hints label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hints Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants