JDK-8343437 : ClassDesc.of incorrectly permitting empty names
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-01
  • Updated: 2024-11-11
  • Resolved: 2024-11-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b23Fixed
Related Reports
Relates :  
Description
After JDK-8338544, the old descriptor string validation is removed. The new validation doesn't test against empty strings, so the call `ClassDesc.of("")` and `ClassDesc.ofInternalName("")` now erroneously returns instead of throwing an IllegalArgumentException.

The class name validation has significant overlap with package names: valid package names, except the empty string for the unnamed package, are always valid class names. Valid class names are always valid package names. We can unify their validation.
Comments
Changeset: 1f7d524f Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2024-11-04 13:24:09 +0000 URL: https://git.openjdk.org/jdk/commit/1f7d524fd3ecd932deb44b6fafdaa36c6bba4cb4
04-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21830 Date: 2024-11-01 13:58:01 +0000
01-11-2024