Skip to content

8313205: Modernize java.text.Format with StringBuilder#20337

Closed
justin-curtis-lu wants to merge 4 commits intoopenjdk:masterfrom
justin-curtis-lu:JDK-8313205-Format-publicStrBldr-overloads
Closed

8313205: Modernize java.text.Format with StringBuilder#20337
justin-curtis-lu wants to merge 4 commits intoopenjdk:masterfrom
justin-curtis-lu:JDK-8313205-Format-publicStrBldr-overloads

Conversation

@justin-curtis-lu
Copy link
Member

@justin-curtis-lu justin-curtis-lu commented Jul 25, 2024

Please review this PR which adds public StringBuilder overloads to the formatting methods of java.text.Format and implementing subclasses.

While Format, NumberFormat, and DateFormat are abstract, these new methods are not added as abstract to prevent compatibility concerns. Instead they are added as non-abstract methods, with a default implementation that throws UOE and a recommendation that subclasses override and provide their own implementations. These new methods use the same specification as the StringBuffer ones, with exception of MessageFormat.format(format(Object[] arguments, StringBuilder result, FieldPosition pos) which omits the table, and instead links to it.

The JDK implementing Format classes, (such as DecimalFormat) leverage the StringBuf proxy methods.

A corresponding CSR has been drafted: https://bugs.openjdk.org/browse/JDK-8337141, which goes into detail on motivation/history. (Holding off on uploading the specification to CSR until wording finalized).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8337141 to be approved

Issues

  • JDK-8313205: Modernize java.text.Format with StringBuilder (Enhancement - P4)
  • JDK-8337141: Modernize java.text.Format with StringBuilder (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20337/head:pull/20337
$ git checkout pull/20337

Update a local copy of the PR:
$ git checkout pull/20337
$ git pull https://git.openjdk.org/jdk.git pull/20337/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20337

View PR using the GUI difftool:
$ git pr show -t 20337

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20337.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 25, 2024

👋 Welcome back jlu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 25, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8313205: Modernize java.text.Format with StringBuilder 8313205: Modernize java.text.Format with StringBuilder Jul 25, 2024
@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Jul 25, 2024
@openjdk
Copy link

openjdk bot commented Jul 25, 2024

@justin-curtis-lu The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org labels Jul 25, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 25, 2024

Webrevs

@liach
Copy link
Member

liach commented Jul 25, 2024

You should add @since tags on all these new API additions.

@justin-curtis-lu
Copy link
Member Author

You should add @since tags on all these new API additions.

Thanks for the reminder. Updated.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 23, 2024

@justin-curtis-lu This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2024

@justin-curtis-lu This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org csr Pull request needs approved CSR before integration i18n i18n-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants