mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Java: Add initial version of string replaceAll with no regex query
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Test.java:4:14:4:36 | replaceAll(...) | Call to 'replaceAll' uses an argument comprised of plain string characters only. |
|
||||
@@ -0,0 +1 @@
|
||||
Performance/StringReplaceAllWithNonRegex.ql
|
||||
@@ -0,0 +1,7 @@
|
||||
public class Test {
|
||||
void f() {
|
||||
String s1 = "test";
|
||||
s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT
|
||||
s1 = s1.replaceAll(".*", "x"); // COMPLIANT
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user