HHH-16459 Fix inline dirty checking with generics and inheritance

This commit is contained in:
Marco Belladelli 2023-04-12 16:24:49 +02:00 committed by Andrea Boriero
parent 634d590e72
commit a69dec8ecf
1 changed files with 3 additions and 3 deletions

View File

@ -270,7 +270,7 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
TypeDescription.VOID, TypeDescription.VOID,
Visibility.PUBLIC Visibility.PUBLIC
) )
.withParameters( enhancedField.getType().asErasure() ) .withParameters( enhancedField.asDefined().getType().asErasure() )
.intercept( fieldWriter( enhancedField ) ); .intercept( fieldWriter( enhancedField ) );
} }
@ -396,12 +396,12 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
MethodDescription instrumentedMethod MethodDescription instrumentedMethod
) { ) {
methodVisitor.visitVarInsn( Opcodes.ALOAD, 0 ); methodVisitor.visitVarInsn( Opcodes.ALOAD, 0 );
methodVisitor.visitVarInsn( Type.getType( persistentField.getType().asErasure().getDescriptor() ).getOpcode( Opcodes.ILOAD ), 1 ); methodVisitor.visitVarInsn( Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ).getOpcode( Opcodes.ILOAD ), 1 );
methodVisitor.visitMethodInsn( methodVisitor.visitMethodInsn(
Opcodes.INVOKESPECIAL, Opcodes.INVOKESPECIAL,
managedCtClass.getSuperClass().asErasure().getInternalName(), managedCtClass.getSuperClass().asErasure().getInternalName(),
EnhancerConstants.PERSISTENT_FIELD_WRITER_PREFIX + persistentField.getName(), EnhancerConstants.PERSISTENT_FIELD_WRITER_PREFIX + persistentField.getName(),
Type.getMethodDescriptor( Type.getType( void.class ), Type.getType( persistentField.getType().asErasure().getDescriptor() ) ), Type.getMethodDescriptor( Type.getType( void.class ), Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ) ),
false false
); );
methodVisitor.visitInsn( Opcodes.RETURN ); methodVisitor.visitInsn( Opcodes.RETURN );