mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 01:50:56 +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
46 lines
1.9 KiB
Java
46 lines
1.9 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 {
|
|
System.out.print(/* one */ "hello" /* two */);
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
System.out.print((format(/* one */ Locale.CANADA /* two */, /* three */ "hello%n" /* four */)));
|
|
}
|
|
|
|
Main() {
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
}
|
|
void f() {
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ ("hello") /* two */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
System.out.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
}
|
|
void out(PrintStream printer) {
|
|
printer.print(/* one */ ("hello") /* two */);
|
|
printer.print(/* one */ ("hello") /* two */);
|
|
printer.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
printer.print(/* one */ /* two */ /* three */ ("hello") /* four */);
|
|
}
|
|
void caller() {
|
|
printf(String.format(/* one */ ("hello") /* two */));
|
|
printf(((String.format(/* one */ ("hello") /* two */))));
|
|
printf(String.format(/* one */ Locale.CANADA /* two */, /* three */ ("hello") /* four */));
|
|
printf((String.format(/* one */ Locale.CANADA /* two */, /* three */ ("hello") /* four */)));
|
|
}
|
|
|
|
static void printf(String value) {}
|
|
}
|