if (prop.getType() == PropertyType.REFERENCE) {
InternalValue[] vals = prop.getValues();
for (int i = 0; vals != null && i < vals.length; i++) {
addVirtualReference(
references, prop.getPropertyId(),
new NodeReferencesId(vals[i].getNodeId()));
}
}
}
}
for (Iterator iter = changes.modifiedStates(); iter.hasNext();) {
ItemState state = (ItemState) iter.next();
if (!state.isNode()) {
PropertyState newProp = (PropertyState) state;
PropertyState oldProp =
(PropertyState) getItemState(state.getId());
if (oldProp.getType() == PropertyType.REFERENCE) {
InternalValue[] vals = oldProp.getValues();
for (int i = 0; vals != null && i < vals.length; i++) {
removeVirtualReference(
references, oldProp.getPropertyId(),
new NodeReferencesId(vals[i].getNodeId()));
}
}
if (newProp.getType() == PropertyType.REFERENCE) {
InternalValue[] vals = newProp.getValues();
for (int i = 0; vals != null && i < vals.length; i++) {
addVirtualReference(
references, newProp.getPropertyId(),
new NodeReferencesId(vals[i].getNodeId()));
}
}
}
}
for (Iterator iter = changes.deletedStates(); iter.hasNext();) {
ItemState state = (ItemState) iter.next();
if (!state.isNode()) {
PropertyState prop = (PropertyState) state;
if (prop.getType() == PropertyType.REFERENCE) {
InternalValue[] vals = prop.getValues();
for (int i = 0; vals != null && i < vals.length; i++) {
removeVirtualReference(
references, prop.getPropertyId(),
new NodeReferencesId(vals[i].getNodeId()));
}
}
}
}