-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
25
-
None
-
In Review
In the class file format, many values are u1 and u2, which are consistently represented in the Class-File API as int. However, such representation omitted that the actual values have a more narrow range, and performs no value restriction when users create API models via factories.
Since for these values, almost all usages of unrepresentable values indicate a user error, I propose to eagerly check for them and throw IllegalArgumentException. For some common aliases, such as using -1 for "all bits set" class file minor version, we can have exceptions.
Note that some values are illegal but representable - this proposal does not intend to restrict those values.
Since for these values, almost all usages of unrepresentable values indicate a user error, I propose to eagerly check for them and throw IllegalArgumentException. For some common aliases, such as using -1 for "all bits set" class file minor version, we can have exceptions.
Note that some values are illegal but representable - this proposal does not intend to restrict those values.
- csr for
-
JDK-8361637 Missing sub-int value validation in the Class-File API
-
- Draft
-
- duplicates
-
JDK-8361182 Validation missing for LineNumber::of() and throws undocumented AIOOB Execption.
-
- Closed
-
- relates to
-
JDK-8361635 Missing List length validation in the Class-File API
-
- New
-
- links to
-
Review(master) openjdk/jdk/26201