File tree 1 file changed +8
-5
lines changed
src/main/java/org/springframework/data/neo4j/core/mapping
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -872,22 +872,25 @@ private boolean alreadyMappedInPreviousRecord(@Nullable Long internalId) {
872
872
}
873
873
}
874
874
875
+ /**
876
+ * This method has an intended side effect.
877
+ * It increases the process count of relationships (mapped by their ids)
878
+ * AND checks if it was already processed twice (INCOMING/OUTGOING).
879
+ */
875
880
private boolean hasProcessedRelationshipCompletely (Long relationshipId ) {
876
881
try {
877
882
write .lock ();
878
- read .lock ();
879
883
880
- int amount = processedRelationships .computeIfAbsent (relationshipId , s -> 0 );
881
- if (amount == 2 ) {
884
+ int processedAmount = processedRelationships .computeIfAbsent (relationshipId , s -> 0 );
885
+ if (processedAmount == 2 ) {
882
886
return true ;
883
887
}
884
888
885
- processedRelationships .put (relationshipId , amount + 1 );
889
+ processedRelationships .put (relationshipId , processedAmount + 1 );
886
890
return false ;
887
891
888
892
} finally {
889
893
write .unlock ();
890
- read .unlock ();
891
894
}
892
895
}
893
896
You can’t perform that action at this time.
0 commit comments