RFR: 8372047: ClassTransform.transformingMethodBodies andThen composes incorrectly [v2]
Adam Sotona
asotona at openjdk.org
Wed Nov 19 07:45:11 UTC 2025
On Tue, 18 Nov 2025 16:39:32 GMT, Chen Liang <liach at openjdk.org> wrote:
>> ClassMethodTransform and ClassFieldTransform are computing the chaining condition incorrectly - the composed transform should run when any of the component wants to run instead of when all copmonents want to run, and the actual content tranforms can only compose if they apply to the same set of method or fields. So we should restrict this "optimization" to same filters.
>
> Chen Liang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>
> 8372047: ClassTransform.transformingMethodBodies andThen composes incorrectly
src/java.base/share/classes/jdk/internal/classfile/impl/TransformImpl.java line 123:
> 121: @Override
> 122: public ClassTransform andThen(ClassTransform next) {
> 123: if (next instanceof ClassMethodTransform(var nextTransform, var nextFilter) && filter == nextFilter)
I'm trying to figure out a case where filters of the chained transforms are identical.
Is it covered by some tests?
Unless there is a real benefit in a frequent use case I suggest to remove this optimization.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28377#discussion_r2540884396
More information about the core-libs-dev
mailing list