We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4995137 + 79453cc commit 8b68d95Copy full SHA for 8b68d95
java/ql/src/Performance/StringReplaceAllWithNonRegex.md
@@ -18,6 +18,7 @@ public class Test {
18
String s1 = "test";
19
s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT
20
s1 = s1.replaceAll(".*", "x"); // COMPLIANT
21
+ s1 = s1.replace("t", "x"); // COMPLIANT
22
}
23
24
java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java
@@ -3,5 +3,6 @@ void f() {
3
4
s1 = s1.replaceAll("t", "x"); // $ Alert // NON_COMPLIANT
5
6
7
8
0 commit comments