ModeShape/modeshape — pull request #577 by rhauch (2012-10-19 04:32:31+00:00)
Title: MODE-1685 Deleting nodes now processes REFERENCE properties

When nodes were removed, their REFERENCE properties were not being processed to remove the opposite references (from the target of the REFERENCE to the referrer, used for referential integrity and returning the nodes that refer to a particular node. As a result, removing the only REFERENCE properties pointing to a particular node would incorrectly prevent the removal of the referenced node (even when there were no more nodes referring to it).

Added some logic to correctly process these REFERENCE properties when the nodes are being removed, ensuring the correctness of the referential integrity states.

Several unit tests were added to first replicate and then verify the correct behavior.