7070import net .bytebuddy .utility .nullability .UnknownNull ;
7171import net .bytebuddy .utility .privilege .GetSystemPropertyAction ;
7272import net .bytebuddy .utility .visitor .ContextClassVisitor ;
73+ import net .bytebuddy .utility .visitor .ExceptionTableSensitiveMethodVisitor ;
7374import net .bytebuddy .utility .visitor .MetadataAwareClassVisitor ;
7475import org .objectweb .asm .AnnotationVisitor ;
7576import org .objectweb .asm .ClassReader ;
@@ -4465,7 +4466,7 @@ public void complete(ClassVisitor classVisitor, Implementation.Context.Extractab
44654466 /**
44664467 * An initialization handler that appends code to a previously visited type initializer.
44674468 */
4468- abstract class Appending extends MethodVisitor implements InitializationHandler , TypeInitializer .Drain {
4469+ abstract class Appending extends ExceptionTableSensitiveMethodVisitor implements InitializationHandler , TypeInitializer .Drain {
44694470
44704471 /**
44714472 * The instrumented type.
@@ -4600,6 +4601,10 @@ private static WithoutDrain withoutDrain(MethodVisitor methodVisitor,
46004601 public void visitCode () {
46014602 record .applyAttributes (mv , annotationValueFilterFactory );
46024603 super .visitCode ();
4604+ }
4605+
4606+ @ Override
4607+ protected void onAfterExceptionTable () {
46034608 onStart ();
46044609 }
46054610
@@ -4609,8 +4614,8 @@ public void visitCode() {
46094614 protected abstract void onStart ();
46104615
46114616 @ Override
4612- public void visitFrame (int type , int localVariableLength , @ MaybeNull Object [] localVariable , int stackSize , @ MaybeNull Object [] stack ) {
4613- super .visitFrame (type , localVariableLength , localVariable , stackSize , stack );
4617+ protected void onVisitFrame (int type , int localVariableLength , @ MaybeNull Object [] localVariable , int stackSize , @ MaybeNull Object [] stack ) {
4618+ super .onVisitFrame (type , localVariableLength , localVariable , stackSize , stack );
46144619 frameWriter .onFrame (type , localVariableLength );
46154620 }
46164621
@@ -4869,11 +4874,11 @@ protected WithActiveRecord(MethodVisitor methodVisitor,
48694874 }
48704875
48714876 @ Override
4872- public void visitInsn (int opcode ) {
4877+ protected void onVisitInsn (int opcode ) {
48734878 if (opcode == Opcodes .RETURN ) {
48744879 mv .visitJumpInsn (Opcodes .GOTO , label );
48754880 } else {
4876- super .visitInsn (opcode );
4881+ super .onVisitInsn (opcode );
48774882 }
48784883 }
48794884
@@ -5013,11 +5018,11 @@ protected WithActiveRecord(MethodVisitor methodVisitor,
50135018 }
50145019
50155020 @ Override
5016- public void visitInsn (int opcode ) {
5021+ protected void onVisitInsn (int opcode ) {
50175022 if (opcode == Opcodes .RETURN ) {
50185023 mv .visitJumpInsn (Opcodes .GOTO , label );
50195024 } else {
5020- super .visitInsn (opcode );
5025+ super .onVisitInsn (opcode );
50215026 }
50225027 }
50235028
0 commit comments