try {
workspace.prepareOperation(rule, null);
if (oldTree == null || newTree == null)
return;
workspace.beginOperation(true);
ResourceDelta delta = ResourceDeltaFactory.computeDelta(workspace, oldTree, newTree, Path.ROOT, -1);
forgetTrees(); // free trees to prevent memory leak
workspace.getNotificationManager().broadcastChanges(listener, IResourceChangeEvent.POST_BUILD, delta);
} finally {
workspace.endOperation(rule, false, null);
}