ItemState citem = changesLog.getItemState(collisionID);
if (citem != null)
{
TransactionChangesLog result = new TransactionChangesLog();
result.setSystemId(changesLog.getSystemId());
ChangesLogIterator cli = changesLog.getLogIterator();
while (cli.hasNextLog())
{
ArrayList<ItemState> normalized = new ArrayList<ItemState>();
PlainChangesLog next = cli.nextLog();
for (ItemState change : next.getAllStates())
{
if (state == change.getState())
{
ItemData item = change.getData();
// targeted state
if (citem.isNode())
{
// Node... by ID and desc path
if (!item.getIdentifier().equals(collisionID)
&& !item.getQPath().isDescendantOf(citem.getData().getQPath()))
normalized.add(change);
}
else if (!item.getIdentifier().equals(collisionID))
{
// Property... by ID
normalized.add(change);
}
}
else
// another state
normalized.add(change);
}
PlainChangesLog plog = new PlainChangesLogImpl(normalized, next.getSessionId(), next.getEventType());
result.addLog(plog);
}
return result;
}