Revert substring(x).indexOf(y) -> indexOf(y, x) (IDEA-219640, case#3); was incorrect replacement

GitOrigin-RevId: f62ccdd76bd6353fe1bce95fe17ab4b3ca507dce
This commit is contained in:
Tagir Valeev
2019-11-25 16:26:57 +07:00
committed by intellij-monorepo-bot
parent 30fbc0441a
commit 98792cbf73
3 changed files with 4 additions and 45 deletions

View File

@@ -1,12 +0,0 @@
// "Fix all 'Redundant String operation' problems in file" "true"
class X {
void test(String s) {
/*1*/
/*2*/
int pos = s/*3*/.indexOf("foo", 10);
int posBounded = s.substring(10, 20).indexOf("foo");
int posChar = s.indexOf('f', 10);
int posIdx = s.substring(10).indexOf('f', 2);
int posFromZero = s.indexOf("xyzt") > 0;
}
}

View File

@@ -1,10 +0,0 @@
// "Fix all 'Redundant String operation' problems in file" "true"
class X {
void test(String s) {
int pos = s.substr<caret>ing(/*1*/10/*2*/)/*3*/.indexOf("foo");
int posBounded = s.substring(10, 20).indexOf("foo");
int posChar = s.substring(10).indexOf('f');
int posIdx = s.substring(10).indexOf('f', 2);
int posFromZero = s.substring(0).indexOf("xyzt") > 0;
}
}