mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
RedundantStringOperation: refactored to CallMapper; indexOf/startsWith/lastIndexOf scenarios
Fixes IDEA-191536 More redundant string operations with indexOf lastIndexOf startsWith
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.indexOf("bar");
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.lastIndexOf("bar");
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.lastIndexOf("bar");
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
boolean test(String foo) {
|
||||
return foo.startsWith("bar");
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.indexOf("bar", <caret>0);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.lastIndexOf("bar", <caret>foo.length());
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
int test(String foo) {
|
||||
return foo.lastIndexOf("bar", <caret>((foo.length())-1));
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove argument" "true"
|
||||
class Foo {
|
||||
boolean test(String foo) {
|
||||
return foo.startsWith("bar", (<caret>0));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user