Created
November 30, 2020 12:34
-
-
Save dnwe/3c979dd0d4c4a5497a206ca7021ac7a2 to your computer and use it in GitHub Desktop.
Java semgrep for String#replaceAll("...", "...")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- id: java.lang.string.replaceall-is-slow | |
message: | | |
Look out for invocations of regexp mehods like String#replaceAll("...", "...") on hot code paths. | |
Compiling into a reusable Pattern instance is almost always the preferable option. | |
severity: WARNING | |
patterns: | |
- pattern-either: | |
- pattern: |- | |
$STRING.replaceAll("...", "...") | |
languages: | |
- java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment