Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve parsing of numeric default values
Previously, all integral numbers were parsed as integers. This caused two problems: 1. Compilation would fail if the default value for a long wasn't a valid integer. 2. The default value for a byte or short could be out of range, resulting in the generation of invalid metadata and an error that could have been caught at compile time not being caught until runtime. This commit updates the parsing of all numeric values to use the parse method of the target primitive type. For example, Short.parseShort(String) is now used to parse a short. Fixes gh-30020
- Loading branch information
1 parent
355f80a
commit a265f15
Showing
2 changed files
with
33 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters