Program: 95472
Project: 95472
Buggy source:
/** 
 * Deletes all tracked changes of a project
 * @param monitor the monitor
 * @param project the project
 * @return the map from changed nodes to whether they were locked (for which tracked changes could not be deleted)
 * @throws ProjectDeletedException 
 * @throws PMException
 */
public static Map<INodePO,Boolean> cleanupTrackedChanges(IProgressMonitor monitor,final IProjectPO project) throws PMException, ProjectDeletedException {
  CollectNodesWithTrackedChangesOperation treeNodeOp=new CollectNodesWithTrackedChangesOperation(project);
  TreeTraverser treeTraverser=new TreeTraverser(project,treeNodeOp,true,true);
  treeTraverser.traverse();
  List<INodePO> listOfNodesWithTrackedChanges=treeNodeOp.getListOfNodesWithTrackedChanges();
  Map<INodePO,Boolean> nodeToWasLockedMap=new HashMap<>(listOfNodesWithTrackedChanges.size());
  monitor.beginTask(Messages.DeleteTrackedChangesActionDialog,listOfNodesWithTrackedChanges.size());
  final Persistor persistor=Persistor.instance();
  final EntityManager session=persistor.openSession();
  EntityTransaction tx=null;
  tx=persistor.getTransaction(session);
  for (  INodePO node : listOfNodesWithTrackedChanges) {
    try {
      persistor.lockPO(session,node);
      node.deleteTrackedChanges();
      session.merge(node);
      nodeToWasLockedMap.put(node,new Boolean(false));
    }
 catch (    PMException|PersistenceException e) {
      nodeToWasLockedMap.put(node,new Boolean(true));
    }
    monitor.worked(1);
  }
  persistor.commitTransaction(session,tx);
  persistor.dropSession(session);
  monitor.done();
  return nodeToWasLockedMap;
}

Fixed version (ground truth):
/** 
 * Deletes all tracked changes of a project
 * @param monitor the monitor
 * @param project the project
 * @return the map from changed nodes to whether they were locked (for which tracked changes could not be deleted)
 * @throws ProjectDeletedException 
 * @throws PMException
 */
public static Map<INodePO,Boolean> cleanupTrackedChanges(IProgressMonitor monitor,final IProjectPO project) throws PMException, ProjectDeletedException {
  CollectNodesWithTrackedChangesOperation treeNodeOp=new CollectNodesWithTrackedChangesOperation(project);
  TreeTraverser treeTraverser=new TreeTraverser(project,treeNodeOp,true,true);
  treeTraverser.traverse();
  List<INodePO> listOfNodesWithTrackedChanges=treeNodeOp.getListOfNodesWithTrackedChanges();
  Map<INodePO,Boolean> nodeToWasLockedMap=new HashMap<>(listOfNodesWithTrackedChanges.size());
  monitor.beginTask(Messages.DeleteTrackedChangesActionDialog,listOfNodesWithTrackedChanges.size());
  final Persistor persistor=Persistor.instance();
  final EntityManager session=persistor.openSession();
  EntityTransaction tx=null;
  tx=persistor.getTransaction(session);
  for (  INodePO node : listOfNodesWithTrackedChanges) {
    try {
      persistor.lockPO(session,node);
      node.deleteTrackedChanges();
      session.merge(node);
      nodeToWasLockedMap.put(node,new Boolean(false));
    }
 catch (    PMException|PersistenceException e) {
      nodeToWasLockedMap.put(node,new Boolean(true));
    }
    monitor.worked(1);
  }
  persistor.commitTransaction(session,tx);
  persistor.dropSession(session);
  EntityManager master=GeneralStorage.getInstance().getMasterSession();
  for (  INodePO key : nodeToWasLockedMap.keySet()) {
    if (!nodeToWasLockedMap.get(key)) {
      INodePO refr=master.find(key.getClass(),key.getId());
      if (refr != null) {
        master.refresh(refr);
      }
    }
  }
  monitor.done();
  return nodeToWasLockedMap;
}