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,
|
Opcodes.INVOKEVIRTUAL,
|
||||||
entity.getInternalName(),
|
entity.getInternalName(),
|
||||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + field.getName(),
|
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + field.getName(),
|
||||||
Type.getMethodDescriptor( Type.getType( field.getDescriptor() ) ),
|
Type.getMethodDescriptor( Type.getType( field.asDefined().getDescriptor() ) ),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
|
||||||
builder = builder
|
builder = builder
|
||||||
.defineMethod(
|
.defineMethod(
|
||||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + enhancedField.getName(),
|
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + enhancedField.getName(),
|
||||||
enhancedField.getType().asErasure(),
|
enhancedField.asDefined().getType().asErasure(),
|
||||||
Visibility.PUBLIC
|
Visibility.PUBLIC
|
||||||
)
|
)
|
||||||
.intercept( fieldReader( enhancedField ) );
|
.intercept( fieldReader( enhancedField ) );
|
||||||
|
@ -373,10 +373,10 @@ final class PersistentAttributeTransformer implements AsmVisitorWrapper.ForDecla
|
||||||
Opcodes.INVOKESPECIAL,
|
Opcodes.INVOKESPECIAL,
|
||||||
managedCtClass.getSuperClass().asErasure().getInternalName(),
|
managedCtClass.getSuperClass().asErasure().getInternalName(),
|
||||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + persistentField.getName(),
|
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
|
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() );
|
return new Size( persistentField.getType().getStackSize().getSize(), instrumentedMethod.getStackSize() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue