Program: 137359
Project: 137359
Buggy source:
/** 
 * move RepositoryNodes to the target RepositoryNode.
 * @param repositoryNodes
 * @param targetNode
 * @throws PersistenceException
 */
private void moveRepositoryNodes(IRepositoryNode[] repositoryNodes,IRepositoryNode targetNode) throws PersistenceException {
  if (repositoryNodes != null) {
    for (    IRepositoryNode sourceNode : repositoryNodes) {
      if (targetNode == sourceNode.getParent()) {
        continue;
      }
      if (sourceNode.getType() == ENodeType.REPOSITORY_ELEMENT) {
        if (sourceNode instanceof AnalysisRepNode || sourceNode instanceof ConnectionRepNode) {
          moveAnaConNode(sourceNode,targetNode);
        }
 else         if (sourceNode instanceof ReportRepNode) {
          moveReportRepNode(sourceNode,targetNode);
        }
 else {
          IPath makeRelativeTo=getMakeRelativeTo(sourceNode);
          IPath removeLastSegments=makeRelativeTo.removeLastSegments(1);
          if (sourceNode instanceof SysIndicatorDefinitionRepNode) {
            if (!((SysIndicatorDefinitionRepNode)sourceNode).isSystemIndicator()) {
              moveOthersNode(sourceNode,targetNode,removeLastSegments);
            }
          }
 else           if (sourceNode instanceof PatternRepNode) {
            moveOthersNode(sourceNode,targetNode,removeLastSegments);
          }
 else           if (sourceNode instanceof JrxmlTempleteRepNode) {
            moveJrxmlFileRepNode(sourceNode,targetNode,makeRelativeTo);
          }
 else           if (sourceNode instanceof SourceFileRepNode || sourceNode instanceof RuleRepNode) {
            moveOthersNode(sourceNode,targetNode,makeRelativeTo);
          }
 else {
            moveOthersNode(sourceNode,targetNode,removeLastSegments);
          }
        }
      }
 else       if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
        moveFolderRepNode(sourceNode,targetNode);
      }
      CorePlugin.getDefault().refreshDQView(targetNode.getParent());
      CorePlugin.getDefault().refreshDQView(sourceNode.getParent());
    }
  }
}

Fixed version (ground truth):
/** 
 * move RepositoryNodes to the target RepositoryNode.
 * @param repositoryNodes
 * @param targetNode
 * @throws PersistenceException
 */
private void moveRepositoryNodes(IRepositoryNode[] repositoryNodes,IRepositoryNode targetNode) throws PersistenceException {
  if (repositoryNodes != null) {
    for (    IRepositoryNode sourceNode : repositoryNodes) {
      if (sourceNode.getType() == ENodeType.REPOSITORY_ELEMENT) {
        if (sourceNode instanceof AnalysisRepNode || sourceNode instanceof ConnectionRepNode) {
          moveAnaConNode(sourceNode,targetNode);
        }
 else         if (sourceNode instanceof ReportRepNode) {
          moveReportRepNode(sourceNode,targetNode);
        }
 else {
          IPath makeRelativeTo=getMakeRelativeTo(sourceNode);
          IPath removeLastSegments=makeRelativeTo.removeLastSegments(1);
          if (sourceNode instanceof SysIndicatorDefinitionRepNode) {
            if (!((SysIndicatorDefinitionRepNode)sourceNode).isSystemIndicator()) {
              moveOthersNode(sourceNode,targetNode,removeLastSegments);
            }
          }
 else           if (sourceNode instanceof PatternRepNode) {
            moveOthersNode(sourceNode,targetNode,removeLastSegments);
          }
 else           if (sourceNode instanceof JrxmlTempleteRepNode) {
            moveJrxmlFileRepNode(sourceNode,targetNode,makeRelativeTo);
          }
 else           if (sourceNode instanceof SourceFileRepNode || sourceNode instanceof RuleRepNode) {
            moveOthersNode(sourceNode,targetNode,makeRelativeTo);
          }
 else {
            moveOthersNode(sourceNode,targetNode,removeLastSegments);
          }
        }
      }
 else       if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
        moveFolderRepNode(sourceNode,targetNode);
      }
      CorePlugin.getDefault().refreshDQView(targetNode.getParent());
      CorePlugin.getDefault().refreshDQView(sourceNode.getParent());
    }
  }
}