Skip to content

Commit

Permalink
HHH-17916 Check type is resolved before building generic property
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel committed Apr 19, 2024
1 parent 21583a2 commit 781888e
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,10 @@ static void prepareActualProperty(
null,
context.getBootstrapContext().getReflectionManager()
);
final Value originalValue = prop.getValue();
if ( originalValue instanceof SimpleValue ) {
if ( declaredProperty.isTypeResolved() ) {
// Avoid copying when the property doesn't depend on a type variable
if ( inferredData.getTypeName().equals( getTypeName( prop ) ) ) {
propertyConsumer.accept( prop );
return;
}
propertyConsumer.accept( prop );
return;
}
// If the property depends on a type variable, we have to copy it and the Value
final Property actualProperty = prop.copy();
Expand All @@ -348,6 +345,7 @@ static void prepareActualProperty(
// collection.setOwner( null );
collection.setRole( type.getName() + "." + prop.getName() );
// To copy the element and key values, we need to defer setting the type name until the CollectionBinder ran
final Value originalValue = prop.getValue();
context.getMetadataCollector().addSecondPass(
new SecondPass() {
@Override
Expand Down

0 comments on commit 781888e

Please sign in to comment.