RFR: 8321248: ClassFile API ClassModel::verify is inconsistent with the rest of the API [v2]

Jan Lahoda jlahoda at openjdk.org
Wed Dec 6 14:51:41 UTC 2023


On Wed, 6 Dec 2023 10:40:51 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> 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.
>> 
>> This 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);
>> 
>> 
>> Impact of the API change is minimal as the API has not been released yet.
>> 
>> Please review.
>> 
>> Thanks,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   reverted modified test

I guess the tests could be made much more tight. E.g. by not only checking passes/fails verification, but also checking the exact errors reported (for tests that just check that verify "failed", without checking the exact errors, it may happen the verification fails for a wrong reason). And the tests could probably be made much broader.

But I don't think that needs to happen here.

-------------

Marked as reviewed by jlahoda (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16947#pullrequestreview-1767775716


More information about the core-libs-dev mailing list