From 21b77a97e0eb705f56b932834e8da9d528dbc41c Mon Sep 17 00:00:00 2001 From: Michael Pfaff Date: Thu, 18 Apr 2024 14:04:53 -0400 Subject: [PATCH] Remove non-compliant overrides of ClassFileTransform.andThen --- .../classfile/impl/TransformImpl.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/TransformImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/TransformImpl.java index 1677d421be9cd..502357dfc8dba 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/TransformImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/TransformImpl.java @@ -119,15 +119,6 @@ public ResolvedTransform resolve(ClassBuilder builder) { builder.with(ce); }); } - - @Override - public ClassTransform andThen(ClassTransform next) { - if (next instanceof ClassMethodTransform cmt) - return new ClassMethodTransform(transform.andThen(cmt.transform), - mm -> filter.test(mm) && cmt.filter.test(mm)); - else - return UnresolvedClassTransform.super.andThen(next); - } } public record ClassFieldTransform(FieldTransform transform, @@ -142,15 +133,6 @@ public ResolvedTransform resolve(ClassBuilder builder) { builder.with(ce); }); } - - @Override - public ClassTransform andThen(ClassTransform next) { - if (next instanceof ClassFieldTransform cft) - return new ClassFieldTransform(transform.andThen(cft.transform), - mm -> filter.test(mm) && cft.filter.test(mm)); - else - return UnresolvedClassTransform.super.andThen(next); - } } // MethodTransform @@ -207,14 +189,6 @@ public ResolvedTransform resolve(MethodBuilder builder) { } }, NOTHING, NOTHING); } - - @Override - public MethodTransform andThen(MethodTransform next) { - return (next instanceof TransformImpl.MethodCodeTransform mct) - ? new TransformImpl.MethodCodeTransform(xform.andThen(mct.xform)) - : UnresolvedMethodTransform.super.andThen(next); - - } } // FieldTransform