ModeShape/modeshape — pull request #612 by rhauch (2012-11-29 22:17:02+00:00)
Title: MODE-1720 Corrected how REFERENCE properties are set

When REFERENCE properties are set with Value objects created from node identifier strings, the values were not correctly being converted (internally) to NodeKey representations. The result was that the REFERENCE values were not usable. A new test case verifies this behavior.

The challenge was that the logic was using the ReferenceFactory (in the ValueFactories inside the Session's ExecutionContext) to perform the conversion. However, the conversion requires knowledge of the root NodeKey, of which the ReferenceFactory was not aware.

The fix was to give each Session a new ValueFactories object that wrapped the existing ValueFactories with specialized ReferenceFactory instances (for strong and weak references) that were aware of the session's root node NodeKey.