[java-inspection] RedundantStringOperationInspection: fix test

GitOrigin-RevId: 7e3d6b028b954284046502313e425b8cedf0b37e
This commit is contained in:
Andrey.Cherkasov
2021-09-15 11:16:50 +03:00
committed by intellij-monorepo-bot
parent 42bdd316a7
commit a71e14445a
2 changed files with 8 additions and 5 deletions

View File

@@ -1,18 +1,21 @@
// "Use 'isBlank()' and remove redundant 'strip()' call" "true"
// "Fix all 'Redundant String operation' problems in file" "true"
class X {
boolean testStrip(String s) {
return s.isBlank();
}
boolean testStripLeading(String s) {
return s.stripLeading().isEmpty();
return s.isBlank();
}
boolean testStripTrailing(String s) {
return s.stripTrailing().isEmpty();
return s.isBlank();
}
boolean testStripWithComments(String s) {
return s./*1*/strip/*2*/(/*3*/)/*4*/./*5*/isEmpty/*6*/(/*7*/)/*8*/;
/*1*/
/*2*/
/*3*/
return s/*4*/./*5*/isBlank/*6*/(/*7*/)/*8*/;
}
}

View File

@@ -1,4 +1,4 @@
// "Use 'isBlank()' and remove redundant 'strip()' call" "true"
// "Fix all 'Redundant String operation' problems in file" "true"
class X {
boolean testStrip(String s) {
return s.st<caret>rip().isEmpty();