mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-inspections] RedundantStringOperation: suggest using 'String#contentEquals' to compare strings with StringBuilder
IDEA-273162 GitOrigin-RevId: 89c0c2d697cec22b8d5c661f2063e35ccab9e9aa
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f88fdf391c
commit
f0efafd51c
@@ -0,0 +1,6 @@
|
||||
// "Use 'contentEquals()' and remove redundant 'toString()' call" "true-preview"
|
||||
class Main {
|
||||
boolean foo(String s, StringBuffer sb) {
|
||||
return ((s)).contentEquals(((((sb)))));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Use 'contentEquals()' and remove redundant 'toString()' call" "true-preview"
|
||||
class Main {
|
||||
boolean foo(String s, StringBuilder sb) {
|
||||
return s.contentEquals(sb);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Use 'contentEquals()' and remove redundant 'toString()' call" "true-preview"
|
||||
class Main {
|
||||
boolean foo(String s, StringBuffer sb) {
|
||||
return ((s)).equals(((((sb)).toString<caret>())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Use 'contentEquals()' and remove redundant 'toString()' call" "true-preview"
|
||||
class Main {
|
||||
boolean foo(String s, StringBuilder sb) {
|
||||
return s.equals(sb.toString<caret>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user