mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8338409: Use record to simplify code
Reviewed-by: redestad, liach
This commit is contained in:
parent
d86e99c3ca
commit
74066bcca8
1 changed files with 1 additions and 9 deletions
|
@ -3021,15 +3021,7 @@ public final class Formatter implements Closeable, Flushable {
|
|||
String toString();
|
||||
}
|
||||
|
||||
private static class FixedString implements FormatString {
|
||||
private final String s;
|
||||
private final int start;
|
||||
private final int end;
|
||||
FixedString(String s, int start, int end) {
|
||||
this.s = s;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
private record FixedString(String s, int start, int end) implements FormatString {
|
||||
public int index() { return -2; }
|
||||
public void print(Formatter fmt, Object arg, Locale l)
|
||||
throws IOException { fmt.a.append(s, start, end); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue