Skip to content

Commit 781888e

Browse files
committed
HHH-17916 Check type is resolved before building generic property
1 parent 21583a2 commit 781888e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,10 @@ static void prepareActualProperty(
326326
null,
327327
context.getBootstrapContext().getReflectionManager()
328328
);
329-
final Value originalValue = prop.getValue();
330-
if ( originalValue instanceof SimpleValue ) {
329+
if ( declaredProperty.isTypeResolved() ) {
331330
// Avoid copying when the property doesn't depend on a type variable
332-
if ( inferredData.getTypeName().equals( getTypeName( prop ) ) ) {
333-
propertyConsumer.accept( prop );
334-
return;
335-
}
331+
propertyConsumer.accept( prop );
332+
return;
336333
}
337334
// If the property depends on a type variable, we have to copy it and the Value
338335
final Property actualProperty = prop.copy();
@@ -348,6 +345,7 @@ static void prepareActualProperty(
348345
// collection.setOwner( null );
349346
collection.setRole( type.getName() + "." + prop.getName() );
350347
// To copy the element and key values, we need to defer setting the type name until the CollectionBinder ran
348+
final Value originalValue = prop.getValue();
351349
context.getMetadataCollector().addSecondPass(
352350
new SecondPass() {
353351
@Override

0 commit comments

Comments
 (0)