[jdk8u-dev] RFR: 8058322: Zero name_index item of MethodParameters attribute cause MalformedParameterException.
Chen Liang
liach at openjdk.org
Tue Oct 8 17:16:37 UTC 2024
An out-of-spec behavior of core reflection causes it to fail when it encounters class files that conform to JVMS for release 8. In [JVMS § 4.7.24](https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.24) parameters are allowed to have `null` (CP reference 0) names, but core reflection didn't accept it.
This problem was relatively obscure, but it has been exacerbated when javac for release 21 and later starts generating such parameters in `MethodParameters` attribute. Since this is a problem with Java 8, I propose to backport this related fix onto 8 instead of changing latest releases.
This pull request contains a backport of commit [cba5bd26](https://github.com/openjdk/jdk/commit/cba5bd26387dc2ecb31ac8d6bea21bcc01da0cd5) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Eric McCorkle on 11 Nov 2014 and was reviewed by Coleen Phillimore and David Holmes.
A backport request is included in the latest comment in the original JBS issue.
An original pull request openjdk/jdk8u#63 was made against the wrong repository.
-------------
Commit messages:
- Backport cba5bd26387dc2ecb31ac8d6bea21bcc01da0cd5
Changes: https://git.openjdk.org/jdk8u-dev/pull/592/files
Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=592&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8058322
Stats: 8 lines in 1 file changed: 2 ins; 3 del; 3 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/592.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/592/head:pull/592
PR: https://git.openjdk.org/jdk8u-dev/pull/592
More information about the jdk8u-dev
mailing list