mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8321545: Override toString() for Format subclasses
Reviewed-by: naoto, rriggs
This commit is contained in:
parent
edfee7f348
commit
96607df7f0
12 changed files with 419 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -2996,6 +2996,17 @@ public class DecimalFormat extends NumberFormat {
|
|||
// just enough fields for a reasonable distribution
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return a string identifying this {@code DecimalFormat}, for debugging}
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return
|
||||
"""
|
||||
DecimalFormat [locale: "%s", pattern: "%s"]
|
||||
""".formatted(symbols.getLocale().getDisplayName(), toPattern());
|
||||
}
|
||||
|
||||
/**
|
||||
* Synthesizes a pattern string that represents the current state
|
||||
* of this Format object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue