Program: 137942
Project: 137942
Buggy source:
/** 
 * rename the RepositoryNode's folder name (the RepositoryNode must be a folder).
 * @param folderNode
 * @param label
 * @throws PersistenceException
 * @deprecated use ProxyRepositoryFactory.getInstance().renameFolder() instead
 */
public void renameFolderRepNode(IRepositoryNode folderNode,String label) throws PersistenceException {
  if (folderNode == null || label == null || "String_Node_Str".equals(label)) {
    return;
  }
  IRepositoryViewObject object=folderNode.getObject();
  if (object == null || !(object instanceof Folder)) {
    return;
  }
 else {
    if (WorkbenchUtils.equalsOS(label,((Folder)object).getLabel())) {
      return;
    }
  }
  String path=null;
  IRepositoryNode parentNode=folderNode.getParent();
  ERepositoryObjectType objectType=folderNode.getContentType();
  try {
    path=WorkbenchUtils.getPath(folderNode).makeRelativeTo(new Path(ERepositoryObjectType.getFolderName(objectType))).removeLastSegments(1).toString();
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
  path=path == null ? "String_Node_Str" : path;
  path=path.startsWith(String.valueOf(IPath.SEPARATOR)) ? path : IPath.SEPARATOR + path;
  ProxyRepositoryFactory.getInstance().updateLockStatus();
  if (ProxyRepositoryManager.getInstance().hasLockedItems(folderNode)) {
    MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    return;
  }
  Folder targetFoler=ProxyRepositoryFactory.getInstance().createFolder(folderNode.getContentType(),new Path(path),label);
  RepositoryNode targetNode=new RepositoryNode(targetFoler,folderNode.getParent(),ENodeType.SIMPLE_FOLDER);
  targetNode.setParent(folderNode.getParent());
  CorePlugin.getDefault().refreshDQView(parentNode);
  IPath sourcePath=WorkbenchUtils.getPath((RepositoryNode)folderNode);
  List<IRepositoryNode> children=folderNode.getChildren();
  if (children != null) {
    IRepositoryNode[] array=children.toArray(new IRepositoryNode[children.size()]);
    for (    IRepositoryNode inode : array) {
      if (inode != null) {
        if (inode instanceof ConnectionRepNode) {
          moveConnectionRepNode(inode,targetNode);
        }
 else         if (inode instanceof AnalysisRepNode) {
          moveAnalysisRepNode(inode,targetNode);
        }
 else         if (inode instanceof ReportRepNode) {
          moveReportRepNode(inode,targetNode);
        }
 else         if (inode instanceof SysIndicatorDefinitionRepNode) {
          moveUDIRepNode(inode,targetNode);
        }
 else         if (inode instanceof PatternRepNode) {
          movePatternRepNode(inode,targetNode);
        }
 else         if (inode instanceof SourceFileRepNode) {
          moveSourceFileRepNode(inode,targetNode);
        }
 else {
          IRepositoryViewObject viewObj=inode.getObject();
          if (viewObj != null) {
            if (viewObj instanceof Folder) {
              moveFolderRepNode(inode,targetNode);
            }
 else {
              moveCommonRepNode(inode,targetNode);
            }
          }
        }
      }
    }
  }
  try {
    IFolder folder=ResourceManager.getRootProject().getProject().getFolder(sourcePath);
    if (folder != null && folder.exists()) {
      folder.delete(true,null);
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  CorePlugin.getDefault().refreshDQView(parentNode);
}

Fixed version (ground truth):
/** 
 * rename the RepositoryNode's folder name (the RepositoryNode must be a folder).
 * @param folderNode
 * @param label
 * @throws PersistenceException
 * @deprecated use ProxyRepositoryFactory.getInstance().renameFolder() instead
 */
@Deprecated public void renameFolderRepNode(IRepositoryNode folderNode,String label) throws PersistenceException {
  if (folderNode == null || label == null || "String_Node_Str".equals(label)) {
    return;
  }
  IRepositoryViewObject object=folderNode.getObject();
  if (object == null || !(object instanceof Folder)) {
    return;
  }
 else {
    if (WorkbenchUtils.equalsOS(label,((Folder)object).getLabel())) {
      return;
    }
  }
  String path=null;
  IRepositoryNode parentNode=folderNode.getParent();
  ERepositoryObjectType objectType=folderNode.getContentType();
  try {
    path=WorkbenchUtils.getPath(folderNode).makeRelativeTo(new Path(ERepositoryObjectType.getFolderName(objectType))).removeLastSegments(1).toString();
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
  path=path == null ? "String_Node_Str" : path;
  path=path.startsWith(String.valueOf(IPath.SEPARATOR)) ? path : IPath.SEPARATOR + path;
  ProxyRepositoryFactory.getInstance().updateLockStatus();
  if (ProxyRepositoryManager.getInstance().hasLockedItems(folderNode)) {
    MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    return;
  }
  Folder targetFoler=ProxyRepositoryFactory.getInstance().createFolder(folderNode.getContentType(),new Path(path),label);
  RepositoryNode targetNode=new RepositoryNode(targetFoler,folderNode.getParent(),ENodeType.SIMPLE_FOLDER);
  targetNode.setParent(folderNode.getParent());
  CorePlugin.getDefault().refreshDQView(parentNode);
  IPath sourcePath=WorkbenchUtils.getPath(folderNode);
  List<IRepositoryNode> children=folderNode.getChildren();
  if (children != null) {
    IRepositoryNode[] array=children.toArray(new IRepositoryNode[children.size()]);
    for (    IRepositoryNode inode : array) {
      if (inode != null) {
        if (inode instanceof ConnectionRepNode) {
          moveConnectionRepNode(inode,targetNode);
        }
 else         if (inode instanceof AnalysisRepNode) {
          moveAnalysisRepNode(inode,targetNode);
        }
 else         if (inode instanceof ReportRepNode) {
          moveReportRepNode(inode,targetNode);
        }
 else         if (inode instanceof SysIndicatorDefinitionRepNode) {
          moveUDIRepNode(inode,targetNode);
        }
 else         if (inode instanceof PatternRepNode) {
          movePatternRepNode(inode,targetNode);
        }
 else         if (inode instanceof SourceFileRepNode) {
          moveSourceFileRepNode(inode,targetNode);
        }
 else {
          IRepositoryViewObject viewObj=inode.getObject();
          if (viewObj != null) {
            if (viewObj instanceof Folder) {
              moveFolderRepNode(inode,targetNode);
            }
 else {
              moveCommonRepNode(inode,targetNode);
            }
          }
        }
      }
    }
  }
  try {
    IFolder folder=ResourceManager.getRootProject().getProject().getFolder(sourcePath);
    if (folder != null && folder.exists()) {
      folder.delete(true,null);
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  CorePlugin.getDefault().refreshDQView(parentNode);
}