diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/ConstraintEnforcingEntityOperations.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/ConstraintEnforcingEntityOperations.java index 85e6d24aaa9a0..1b33b6eab444b 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/ConstraintEnforcingEntityOperations.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/ConstraintEnforcingEntityOperations.java @@ -104,7 +104,7 @@ public ConstraintEnforcingEntityOperations( this.entityReadOperations = entityReadOperations; this.schemaWriteOperations = schemaWriteOperations; this.schemaReadOperations = schemaReadOperations; - nodeSchemaMatcher = new NodeSchemaMatcher( entityReadOperations ); + nodeSchemaMatcher = new NodeSchemaMatcher<>( entityReadOperations ); } @Override @@ -141,10 +141,10 @@ public Property nodeSetProperty( KernelStatement state, long nodeId, DefinedProp { NodeItem node = cursor.get(); Iterator constraints = getConstraintsForProperty( state, property.propertyKeyId() ); - Iterator uniqueness = + Iterator uniquenessConstraints = new CastingIterator<>( constraints, UniquenessConstraintDescriptor.class ); - nodeSchemaMatcher.onMatchingSchema( state, uniqueness, node, property.propertyKeyId(), + nodeSchemaMatcher.onMatchingSchema( state, uniquenessConstraints, node, property.propertyKeyId(), constraint -> { validateNoExistingNodeWithExactValues( state, constraint, getAllPropertyValues( state, constraint.schema(), node, property ),