diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java index 1cb4542d67..7fcb1503a7 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java @@ -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 ); } diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/PersistentAttributeTransformer.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/PersistentAttributeTransformer.java index 1b27b87ee3..5457474a38 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/PersistentAttributeTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/PersistentAttributeTransformer.java @@ -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() ); } }