mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
This patch cleans up the code Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: f90c1f9af167102b3b57daf43c144973e9502a6f
82 lines
3.9 KiB
Java
82 lines
3.9 KiB
Java
// "Fix all 'Redundant call to 'String.format()'' problems in file" "true"
|
|
package java.lang;
|
|
|
|
import java.io.PrintStream;
|
|
|
|
class String {
|
|
String(Object original) {}
|
|
|
|
public native String formatted(Object... args);
|
|
}
|
|
|
|
class Main {
|
|
static {
|
|
System.out.println(/* one */ new String("""
|
|
%s, %s!
|
|
"""/* two */).<caret>formatted(/* three */"Hello"/* four */, /* six */ "World" /* seven */));
|
|
System.out.print(/* one */ ( /* two */ ( /* three */ new String("""
|
|
%s, %s!
|
|
"""/* four */) /* five */))
|
|
.formatted(/* six */"Hello"/* seven */, /* eight */ "World" /* nine */));
|
|
|
|
System.out.print(/* one */ new String("""
|
|
%s, %s!
|
|
"""/* two */).formatted(/* six */"Hello"/* seven */, /* eight */ "World" /* nine */));
|
|
|
|
System.out.println(( /* one */ new String("""
|
|
%s,
|
|
""" /* two */) + /* three */
|
|
new String("""
|
|
%s!
|
|
""")/* four */).formatted(/* five */"Hello"/* six */, /* seven */ "World" /* eight */));
|
|
|
|
System.out.print(( /* one */ new String("""
|
|
%s,
|
|
""" /* two */) +
|
|
new String(/* three */
|
|
"""
|
|
%s!
|
|
""")/* four */).formatted(/* five */"Hello"/* six */, /* seven */ "World" /* eight */));
|
|
}
|
|
|
|
void out(PrintStream printer) {
|
|
printer.println(/* one */ new String("""
|
|
%s, %s!
|
|
"""/* two */).formatted(/* three */"Hello"/* four */, /* six */ "World" /* seven */));
|
|
printer.print(/* one */ ( /* two */ ( /* three */ new String("""
|
|
%s, %s!
|
|
"""/* four */) /* five */))
|
|
.formatted(/* six */"Hello"/* seven */, /* eight */ "World" /* nine */));
|
|
|
|
printer.print(/* one */ new String("""
|
|
%s, %s!
|
|
"""/* two */).formatted(/* six */"Hello"/* seven */, /* eight */ "World" /* nine */));
|
|
|
|
printer.println(( /* one */ new String("""
|
|
%s,
|
|
""" /* two */) + /* three */
|
|
new String("""
|
|
%s!
|
|
""")/* four */).formatted(/* five */"Hello"/* six */, /* seven */ "World" /* eight */));
|
|
|
|
printer.print(( /* one */ new String("""
|
|
%s,
|
|
""" /* two */) +
|
|
new String(/* three */
|
|
"""
|
|
%s!
|
|
""")/* four */).formatted(/* five */"Hello"/* six */, /* seven */ "World" /* eight */));
|
|
}
|
|
|
|
void caller() {
|
|
println(( /* one */ new String("""
|
|
%s,
|
|
""" /* two */ + /* three */
|
|
"""
|
|
%s!
|
|
"""/* four */)).formatted(/* five */"Hello"/* six */, /* seven */ "World" /* eight */));
|
|
}
|
|
|
|
static void println(String value) {}
|
|
}
|