[Bugfix] Correctly create copiedNodes map when keep_node_ids
is false
#55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 1c097ca introduced a bug when running the StoryCopy util with
keep_node_ids
set tofalse
.In the
copyNodes(...)
method theMutableLongLongMap copiedNodes
is now initialized with anull
value whenstableNodeIds
isfalse
, but it should be the other way around (when using stable node IDs, i.e.keep_node_ids
istrue
, there's no need to keep track of copied node IDs, but when NOT using stable node IDs, the map should be initialized to keep track of the mapping between old and new IDs).Because the node IDs are not tracked correctly, the correct node IDs cannot be determined when creating the relationships later, resulting in the wrong relationships being created (in case the 'old' node IDs happen to coincidentally match with some new node), or no relationship being created at all (if the old node ID no longer maps to a node in the new graph).
This fix corrects this behaviour. I've also re-added the
initialCapacity
value of10_000_000
, which was there originally before the above mentioned commit.