RFR: 8328111: Convert Runtime tests to use the ClassFile API instead of ASM [v9]
Leonid Mesnik
lmesnik at openjdk.org
Thu Mar 14 17:59:40 UTC 2024
On Thu, 14 Mar 2024 15:40:53 GMT, Oussama Louati <duke at openjdk.org> wrote:
>> The main goal pull request migrate the existing tests to utilize the new ClassFile API instead of the ASM library. The use of ASM has served us well in the past, but maintaining it has its costs and limitations.
>>
>> ### **Cost of Maintaining ASM Library:**
>>
>> - _Risk of Changes:_ The ASM library is an external dependency, and updates or changes in its APIs can introduce unforeseen issues or require significant code modifications in our tests.
>> - _Lack of Reviewers:_ As the ASM library evolves, finding reviewers familiar with its intricacies becomes challenging, leading to delays in reviewing and merging changes.
>>
>> ### **Reasons for Migration:**
>>
>> - _Stability and Consistency:_ Utilizing the ClassFile API ensures stability and compatibility with the Java platform, reducing the risk of compatibility issues due to external library changes.
>> - _Sustainability:_ The ClassFile API is a standard part of Java, making it easier to find reviewers and maintain code consistency across test suites.
>> - _Future Compatibility:_ As Java evolves, relying on native Java APIs like the ClassFile API ensures future compatibility and reduces technical debt.
>>
>> ### **Concerns Addressed:**
>>
>> - Risk of Changes: By migrating to a standard Java API, we mitigate the risks associated with external library changes and ensure smoother maintenance and updates in the future.
>> - Backporting and Compatibility: The use of native Java APIs allows for easier backporting of test fixes and ensures compatibility across Java versions, including preview releases.
>
> Oussama Louati has updated the pull request incrementally with two additional commits since the last revision:
>
> - removing unnecessary whitespaces
> - convert BadMethodHandles to use classFile API
Changes requested by lmesnik (Reviewer).
test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java line 62:
> 60: ClassDesc.of("BadInterfaceMethodref"), "staticM", "()V");
> 61:
> 62: bytes = ClassFile.of().build(ClassDesc.of("BadInterfaceMethodref"),
can't it be merged with line 54?
test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java line 103:
> 101: byte[] bytes;
> 102:
> 103: bytes = ClassFile.of().build(ClassDesc.of("IBad"),
Also, just merger with line 181 or return this result.
test/hotspot/jtreg/runtime/finalStatic/FinalStatic.java line 72:
> 70:
> 71: private byte[] loadClassData(String name) throws Exception {
> 72: byte[] bytes = null;
= null is not needed.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18271#pullrequestreview-1937378474
PR Review Comment: https://git.openjdk.org/jdk/pull/18271#discussion_r1525280721
PR Review Comment: https://git.openjdk.org/jdk/pull/18271#discussion_r1525282956
PR Review Comment: https://git.openjdk.org/jdk/pull/18271#discussion_r1525287113
More information about the hotspot-runtime-dev
mailing list