HHH-18151 Fix lazy loading with generics and inheritance
This commit is contained in:
parent
e0217c1d2d
commit
d53f21a4b4
|
@ -350,7 +350,7 @@ final class BiDirectionalAssociationHandler implements Implementation {
|
|||
Opcodes.INVOKEVIRTUAL,
|
||||
entity.getInternalName(),
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + field.getName(),
|
||||
Type.getMethodDescriptor( Type.getType( field.getDescriptor() ) ),
|
||||
Type.getMethodDescriptor( Type.getType( field.asDefined().getDescriptor() ) ),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
|
|||
builder = builder
|
||||
.defineMethod(
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + enhancedField.getName(),
|
||||
enhancedField.getType().asErasure(),
|
||||
enhancedField.asDefined().getType().asErasure(),
|
||||
Visibility.PUBLIC
|
||||
)
|
||||
.intercept( fieldReader( enhancedField ) );
|
||||
|
@ -373,10 +373,10 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
|
|||
Opcodes.INVOKESPECIAL,
|
||||
managedCtClass.getSuperClass().asErasure().getInternalName(),
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + persistentField.getName(),
|
||||
Type.getMethodDescriptor( Type.getType( persistentField.getType().asErasure().getDescriptor() ) ),
|
||||
Type.getMethodDescriptor( Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ) ),
|
||||
false
|
||||
);
|
||||
methodVisitor.visitInsn( Type.getType( persistentField.getType().asErasure().getDescriptor() ).getOpcode( Opcodes.IRETURN ) );
|
||||
methodVisitor.visitInsn( Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ).getOpcode( Opcodes.IRETURN ) );
|
||||
return new Size( persistentField.getType().getStackSize().getSize(), instrumentedMethod.getStackSize() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue