JDK-8317612: ChoiceFormat and MessageFormat constructors call non-final public method#16064
JDK-8317612: ChoiceFormat and MessageFormat constructors call non-final public method#16064justin-curtis-lu wants to merge 7 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jlu! A progress list of the required criteria for merging this PR into |
|
@justin-curtis-lu 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
|
|
I assume this issue was filed (directly or indirectly) in response to the javac lint warning added in JDK 21 under JDK-8015831. I recommend considering how to address the underlying issue of the constructors calling overridable methods. For example, can a private method be defined that is called from the constructor and the public method? In any case, I think one goal of bug should be to remove the warning condition, preferably by removing the condition, but, if not, by adding a |
|
Drive-by comment: typo "the the" in ChoiceFormat.toPattern(): line 322 |
|
@justin-curtis-lu this pull request can not be integrated into git checkout JDK-8317612
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
| * @see #previousDouble | ||
| */ | ||
| public static final double nextDouble (double d) { | ||
| public static double nextDouble (double d) { |
There was a problem hiding this comment.
Is removing final OK here? Wouldn't this allow defining the static method in the subclass?
There was a problem hiding this comment.
Right, we don't want those methods to now have the ability to be hidden. Got carried away with the IDE suggested tips. Reverted here and in the other occurrence, thanks for correcting.
| * @see #nextDouble | ||
| */ | ||
| public static final double previousDouble (double d) { | ||
| public static double previousDouble (double d) { |
|
@justin-curtis-lu 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 315 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 |
LanceAndersen
left a comment
There was a problem hiding this comment.
Looks reasonable. I assume you validated the links work in the generated docs as a sanity check
|
/integrate |
|
Going to push as commit ee57e73.
Your commit was automatically rebased without conflicts. |
|
@justin-curtis-lu Pushed as commit ee57e73. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this PR which updates ChoiceFormat and MessageFormat to no longer call overridable methods in their constructors.
The overridable methods called in the constructors are: ChoiceFormat::applyPattern, ChoiceFormat::setChoices, and MessageFormat::applyPattern. The code should be updated so that both the methods and constructors call a separate private method. Some other drive-by cleanup changes were included in the change as well.
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16064/head:pull/16064$ git checkout pull/16064Update a local copy of the PR:
$ git checkout pull/16064$ git pull https://git.openjdk.org/jdk.git pull/16064/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16064View PR using the GUI difftool:
$ git pr show -t 16064Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16064.diff
Webrev
Link to Webrev Comment