newReference = SReference.create(sourceReference.getRole(), newSourceNode, newTargetNode);
} else {//otherwise it points out of our node's subtree
if (oldTargetNode != null) {
newReference = SReference.create(sourceReference.getRole(), newSourceNode, oldTargetNode);
} else if (sourceReference.getResolveInfo() != null) {
<BUG>newReference = SReference.create(sourceReference.getRole(), newSourceNode, null, null, sourceReference.getResolveInfo());
</BUG>
} else {
continue;
}

newReference = SReference.create(sourceReference.getRole(), newSourceNode, newTargetNode);
} else {//otherwise it points out of our node's subtree
if (oldTargetNode != null) {
newReference = SReference.create(sourceReference.getRole(), newSourceNode, oldTargetNode);
} else if (sourceReference.getResolveInfo() != null) {
newReference = new StaticReference(sourceReference.getRole(), newSourceNode, null, null, sourceReference.getResolveInfo());
} else {
continue;
