mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
[codeInsight] IDEA-113640 Provide intention to combine System.out.println(String.format(...)) into System.out.printf
This patch adds processing of Java 14's text blocks to RedundantStringFormatCallInspection and fixes the problems from the code review Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: 126cfc001e7b201b62060333de7f71480403fb93
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c8bc41207e
commit
8db5967f7b
@@ -0,0 +1,52 @@
|
||||
// "Fix all 'Redundant call to 'String.format()'' problems in file" "true"
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
class Main {
|
||||
static {
|
||||
System.out.<caret>printf(/* one */"""
|
||||
Hello
|
||||
""" /* two */);
|
||||
System.out.printf(/* three */"""
|
||||
Hello%n
|
||||
""" /* four */);
|
||||
}
|
||||
|
||||
Main() {
|
||||
System.out.printf(/* one */"""
|
||||
Hello
|
||||
""" /* two */);
|
||||
System.out.printf(/* three */"""
|
||||
Hello%n
|
||||
""" /* four */);
|
||||
}
|
||||
|
||||
void f() {
|
||||
System.out.printf(/* one */"""
|
||||
Hello
|
||||
""" /* two */);
|
||||
System.out.printf(/* three */"""
|
||||
Hello%n
|
||||
""" /* four */);
|
||||
}
|
||||
|
||||
void out(PrintStream printer) {
|
||||
printer.printf(/* one */"""
|
||||
Hello
|
||||
""" /* two */);
|
||||
printer.printf(/* three */"""
|
||||
Hello%n
|
||||
""" /* four */);
|
||||
}
|
||||
|
||||
void caller() {
|
||||
printf(/* one */"""
|
||||
Hello
|
||||
""" /* two */);
|
||||
printf(/* three */"""
|
||||
Hello%n
|
||||
""" /* four */);
|
||||
}
|
||||
|
||||
static void printf(String value) {}
|
||||
}
|
||||
Reference in New Issue
Block a user