mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
This patch fixes the notes from the code review, it inclues: - renaming method to methodNameReference for variables that contain the name of a method that is being called, i.e. either `println` or `print` or `format` - using a different overloaded createProblemDescriptor method that does not accept a `TextRange` - using `getParent` in quick fixes to get the `PsiMethodExpressionCall` - proper handling arguments with parenthesis Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: ea1e335372bf7b1ce3e6c87a3816baa0ab54e11e
45 lines
1.2 KiB
Java
45 lines
1.2 KiB
Java
// "Fix all 'Redundant call to 'String.format()'' problems in file" "true"
|
|
import java.io.PrintStream;
|
|
import java.util.Locale;
|
|
|
|
import static java.lang.String.format;
|
|
|
|
class Main {
|
|
static {
|
|
String s1 = "test";
|
|
String s1n = format("test%n");
|
|
String s1n1 = format(("test%n"));
|
|
String s2 = "test";
|
|
String s21 = "test";
|
|
String s2n = format(Locale.US, "test%n");
|
|
String s2n1 = format(Locale.US, ((("test%n"))));
|
|
String s3 = "test";
|
|
String s31 = "test";
|
|
String s3l = "test";
|
|
String s3l1 = "test";
|
|
String s3n1 = String.format(Locale.US, ("test%n"));
|
|
|
|
System.out.println(/* one */ /* two */ /* three */ "hello" /* four */);
|
|
System.out.println(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
}
|
|
|
|
Main() {
|
|
String s1 = "test";
|
|
String s1n = format("test%n");
|
|
String s2 = "test";
|
|
String s2n = format(Locale.US, "test%n");
|
|
String s3 = "test";
|
|
String s3l = "test";
|
|
String s3n = String.format(Locale.US, "test%n");
|
|
}
|
|
void f() {
|
|
String s1 = "test";
|
|
String s1n = format("test%n");
|
|
String s2 = "test";
|
|
String s2n = format(Locale.US, "test%n");
|
|
String s3 = "test";
|
|
String s3l = "test";
|
|
String s3n = String.format(Locale.US, "test%n");
|
|
}
|
|
}
|