diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java index 4b6a5e28d0..02276925ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java @@ -55,7 +55,6 @@ import java.util.Set; import java.util.function.BiFunction; import static java.util.Collections.unmodifiableMap; -import static java.util.Objects.nonNull; import static org.hibernate.metamodel.internal.InjectionHelper.injectField; /** @@ -274,9 +273,9 @@ public class MetadataContext { attribute = factoryFunction.apply( entityType, genericProperty ); if ( !property.isGeneric() ) { final PersistentAttribute concreteAttribute = factoryFunction.apply( entityType, property ); - if (nonNull(concreteAttribute)) { + if ( concreteAttribute != null ) { @SuppressWarnings("unchecked") final AttributeContainer attributeContainer = (AttributeContainer) entityType; - attributeContainer.getInFlightAccess().addConcreteGenericAttribute(concreteAttribute); + attributeContainer.getInFlightAccess().addConcreteGenericAttribute( concreteAttribute ); } } }