-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8300869: Make use of the Double.toString(double) algorithm in java.util.Formatter #12259
Conversation
👋 Welcome back rgiulietti! A progress list of the required criteria for merging this PR into |
@rgiulietti The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
The specification in This fixes the discrepancy between specification and implementation in Class |
…il.Formatter Added tests for known differences between current and new behavior.
Added tests for known differences. Most of the modified files are generated automatically by a script that, somewhat questionably, renews the copyright year in some of the files for no apparent reason. |
@@ -1,5 +1,5 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks line the non-float/double test classes are unchanged, they could be dropped from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only changes I made myself in the test files are in Basic-X.java.template (including the copyright year). The other files were generated by a script, which happens to also change the copyright year for otherwise unmodified files.
If you agree, I'll happily remove the trivial copyright year changes and only retain those files containing more substantial modifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me, I figured it was the script that changed the copyright and otherwise generated the same as before. tnx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise untouched files are now reverted back with previous copyright year
…il.Formatter Reverted back copyright year of otherwise untouched files.
I've spoken to @rgiulietti about this PR; since there behavioral changes of possible interest, I'm requesting a CSR to cover those changes. |
/csr needed |
@@ -931,6 +931,16 @@ public class Basic$Type$ extends Basic { | |||
test("%3.0e", "1e+07", 10000000.00); | |||
test("%3.0e", "1e+08", 100000000.00); | |||
|
|||
//--------------------------------------------------------------------- | |||
// %e - adoption of Double.toString(double) algorithm (8300869) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we generally don't use the bug ids in comments like this, usually at most relying on a bug listed in the test "@bug" line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug id was added there because I'm not sure there's a way to add the @bug line to Basic-X.java.template`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see; it might suffice in this case to rely on the bug information in the SCM history, but I don't have a strong opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this specific *.java.template
case, I think that the bug id in the comment somehow replaces the lack of the @bug line.
But I have no problems in removing it if there are stronger opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @bug
tag is in BasicTestLauncher
which is where 8300869 should likely go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bplb for pointing to the right place.
Done
@jddarcy this pull request will not be integrated until the CSR request JDK-8301387 for issue JDK-8300869 has been approved. |
The CSR has been added. It covers both a behavioral change due to the implementation change in this PR, and a specification change to align it with the implementation (current and proposed), resolving a long standing mismatch in the |
|
||
package jdk.internal.math; | ||
|
||
public final class FormattedFPDecimal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding a short explanation of what this class is used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
@rgiulietti This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 203 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Anyone from i18n wants to review before integration? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed through the changes, and see no problem wrt the i18n area.
/integrate |
Going to push as commit f696785.
Your commit was automatically rebased without conflicts. |
@rgiulietti Pushed as commit f696785. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Align
double
andfloat
decimal conversions injava.util.Formatter
with the algorithm used inDouble.toString(double)
.Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12259/head:pull/12259
$ git checkout pull/12259
Update a local copy of the PR:
$ git checkout pull/12259
$ git pull https://git.openjdk.org/jdk pull/12259/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12259
View PR using the GUI difftool:
$ git pr show -t 12259
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12259.diff