ClassFile API ClassModel::verify is inconsistent with the rest of the API

Adam Sotona adam.sotona at oracle.com
Mon Dec 4 11:41:28 UTC 2023


Hi,
As a fix of JDK-8321248<https://bugs.openjdk.org/browse/JDK-8321248> I would like to propose following “last minute” ClassFile API minor change:

PR: https://github.com/openjdk/jdk/pull/16947

ClassFile API ClassModel::verify accepts ClassHierarchyResolver as an optional argument and does not respect ClassFile.ClassHierarchyResolverOption of the actual context.
Parsing, building and transforming take options from the actual ClassFile context and verification should follow the same API pattern.

The proposed patch removes ClassModel::verify methods and introduces new top level methods:
         List<VerifyError> ClassFile::verify(ClassModel model);
         List<VerifyError> ClassFile::verify(byte[] bytes);
         List<VerifyError> ClassFile::verify(Path path);

This bug technically requires a CSR, which is temporary not possible to create.

 Please let me know your comments here or in the PR review.

Thanks,
Adam


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20231204/2fa7c569/attachment-0001.htm>


More information about the classfile-api-dev mailing list