IG: better messages and fixed highlighting for "Redundant 'String' operation" inspection

GitOrigin-RevId: f328b47c3c64b6f078f89fa04f0353ec34d57f24
This commit is contained in:
Bas Leijdekkers
2022-08-29 17:45:32 +02:00
committed by intellij-monorepo-bot
parent e7c55493a1
commit 3d5589bde2
12 changed files with 67 additions and 77 deletions

View File

@@ -23,6 +23,6 @@ class Main {
String s4 = new String((out4.toByteArray()));
String s5 = new String(foo().toByteArray());
String s6 = new String((foo().toByteArray()<caret>));
String s6 = new String<caret>((foo().toByteArray()));
}
}

View File

@@ -27,6 +27,6 @@ class Main {
String s4 = new String((out4.toByteArray()), (charset));
String s5 = new String(foo().toByteArray(), charset);
String s6 = new String((foo().toByteArray()), (charset<caret>));
String s6 = new <caret>String((foo().toByteArray()), (charset));
}
}

View File

@@ -26,6 +26,6 @@ class Main {
String s4 = new String((out4.toByteArray()), (csn));
String s5 = new String(foo().toByteArray(), csn);
String s6 = new String((foo().toByteArray()), (csn<caret>));
String s6 = new <caret>String((foo().toByteArray()), (csn));
}
}

View File

@@ -2,7 +2,7 @@
class Test {
String foo1(char c) {
return new String(new char[] { c })<caret>;
return new <caret>String(new char[] { c });
}
String foo2(Character character) {

View File

@@ -1,7 +1,7 @@
// "Fix all 'Redundant 'String' operation' problems in file" "true"
class Foo {
void test(String s) {
String s1 = s.substring(s.leng<caret>th());
String s1 = s.substring<caret>(s.length());
String s2 = s.substring(s1.length());
}
}

View File

@@ -2,7 +2,7 @@
class Test {
String foo1(char c) {
return String.valueOf(new char[]<caret> { c });
return String.valueOf(new <caret>char[] { c });
}
String foo2(Character character) {