mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
Adds an inspection with a quickfix that suggests replacing `String#replaceAll` that doesn't pass regular expressions with `String#replace`. #IDEA-288385 Fixed (cherry picked from commit e4bf212ae5693754c5a3dd51d9f5c578a5490e39) IJ-MR-186138 GitOrigin-RevId: 8e2ad43e460b08f02529093e3f0d61a31e7d4efd
8 lines
625 B
Java
8 lines
625 B
Java
public class SimplePositive {
|
|
void m(String s) {
|
|
s = s.<warning descr="Call to 'replaceAll()' with a non-regex pattern can be replaced with 'replace()'"><caret>replaceAll</warning>("abc", "x");
|
|
s = s.<warning descr="Call to 'replaceAll()' with a non-regex pattern can be replaced with 'replace()'">replaceAll</warning>("-", "/");
|
|
s = s.<warning descr="Call to 'replaceAll()' with a non-regex pattern can be replaced with 'replace()'">replaceAll</warning>(" ", "_");
|
|
s = s.<warning descr="Call to 'replaceAll()' with a non-regex pattern can be replaced with 'replace()'">replaceAll</warning>("]", "a");
|
|
}
|
|
} |