-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8318646: Integer#parseInt("") throws empty NumberFormatException message #16320
Conversation
👋 Welcome back rgiulietti! A progress list of the required criteria for merging this PR into |
@rgiulietti The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@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 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
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.
+1
@uschindler You may want to make the Lucene tests more robust by making them immune to exception messages contents. But thanks for trying out the EA releases on important libraries like Lucene ;-) It is important to have early feedback to gain more information before shipping the GA release. |
/integrate |
Going to push as commit 9bfa082.
Your commit was automatically rebased without conflicts. |
@rgiulietti Pushed as commit 9bfa082. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Thanks for this. Actually this was a bad example. This was just test code, so I will more or less only remove the message check. In that case it would be enough to check for the NumberFormatException. I will provide a fix for this. This is a very old test from a not so well-maintained module. Anyways it helped a bit to make the code more clean, because the NumberFormatException is now generated in the same way everywhere which makes it more consistent. I mainly openend the iusse to inform you about that incompatibility because the exception message looks the same since very early java versions. So suddenly chaging it might bring others into the same situation like we were. I agree the spec does not enforce a message, but a more helpful message is always better than the completely empty one. So I would say, this PR is just a cleanup so "enhancement" as said by Alan Bateman is a good categorization. Thanks for the quick fix. But I will fix the issue in Lucene, too! P.S.: At other code we do not rely on exception messages. In recent code of MemorySegment we have some ambiguity with IllegalStateException when the scope of a memory segment was closed. I refused to look into the exception message and instead of parsing mesage - when catching exception, it now checks the memorysegment's scope was closed and only then convert the exception to a Lucene "AlreadyClosedException". In all other cases it is rethrowing the original exception. With exception messages you would have to look for some text string in them which is fragile. See this example: apache/lucene#12707 |
Please review this simple fix to restore the original exception message that existed before 16050.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16320/head:pull/16320
$ git checkout pull/16320
Update a local copy of the PR:
$ git checkout pull/16320
$ git pull https://git.openjdk.org/jdk.git pull/16320/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16320
View PR using the GUI difftool:
$ git pr show -t 16320
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16320.diff
Webrev
Link to Webrev Comment