mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-inspection] RedundantStringOperation: String.strip.isEmpty() can be replaced with String.isBlank()
GitOrigin-RevId: 04b4a572ac5b1674aaf87d7145cc82a5c98772dc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ef5aae11cc
commit
8964b50053
@@ -0,0 +1,18 @@
|
||||
// "Use 'isBlank()' and remove redundant 'strip()' call" "true"
|
||||
class X {
|
||||
boolean testStrip(String s) {
|
||||
return s.isBlank();
|
||||
}
|
||||
|
||||
boolean testStripLeading(String s) {
|
||||
return s.stripLeading().isEmpty();
|
||||
}
|
||||
|
||||
boolean testStripTrailing(String s) {
|
||||
return s.stripTrailing().isEmpty();
|
||||
}
|
||||
|
||||
boolean testStripWithComments(String s) {
|
||||
return s./*1*/strip/*2*/(/*3*/)/*4*/./*5*/isEmpty/*6*/(/*7*/)/*8*/;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Use 'isBlank()' and remove redundant 'strip()' call" "true"
|
||||
class X {
|
||||
boolean testStrip(String s) {
|
||||
return s.st<caret>rip().isEmpty();
|
||||
}
|
||||
|
||||
boolean testStripLeading(String s) {
|
||||
return s.stripLeading().isEmpty();
|
||||
}
|
||||
|
||||
boolean testStripTrailing(String s) {
|
||||
return s.stripTrailing().isEmpty();
|
||||
}
|
||||
|
||||
boolean testStripWithComments(String s) {
|
||||
return s./*1*/strip/*2*/(/*3*/)/*4*/./*5*/isEmpty/*6*/(/*7*/)/*8*/;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user