Program: 125841
Project: 125841
Buggy source:
/** 
 * ftang Comment method "isForbbidNode".
 * @param node
 * @return
 */
private boolean isForbidNode(RepositoryNode node){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  IRepositoryViewObject nodeObject=node.getObject();
  if (nodeObject == null || nodeObject.getProperty() == null || nodeObject.getProperty().getItem() == null) {
    return false;
  }
  boolean locked=false;
  if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
    if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
      locked=true;
    }
  }
  boolean isTestCaseLocked=isTestCasesLocked(node);
  if ((locked || isTestCaseLocked || RepositoryManager.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
    final String title=Messages.getString("String_Node_Str");
    String nodeName=ERepositoryObjectType.getDeleteFolderName(nodeObject.getRepositoryObjectType());
    String message="String_Node_Str";
    if (locked) {
      message=Messages.getString("String_Node_Str",nodeName);
    }
 else     if (isTestCaseLocked) {
      message=Messages.getString("String_Node_Str",nodeName);
    }
    final String lockMessage=message;
    Display.getDefault().syncExec(new Runnable(){
      @Override public void run(){
        MessageDialog dialog=new MessageDialog(new Shell(),title,null,lockMessage,MessageDialog.ERROR,new String[]{IDialogConstants.OK_LABEL},0);
        dialog.open();
      }
    }
);
    return true;
  }
  if (node.getContentType() == ERepositoryObjectType.JOB_DOC) {
    return true;
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC) {
    return true;
  }
  if (node.getContentType() == ERepositoryObjectType.JOBLET_DOC) {
    return true;
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC) {
    return true;
  }
  if (node.getContentType() == ERepositoryObjectType.GENERATED) {
    return true;
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_CDC) {
    return true;
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_TABLE) {
    final IRepositoryViewObject object=nodeObject;
    if (object != null && object instanceof MetadataTableRepositoryObject) {
      final MetadataTable table=((MetadataTableRepositoryObject)object).getTable();
      if (table != null && table instanceof SubscriberTable) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * ftang Comment method "isForbbidNode".
 * @param node
 * @return
 */
private boolean isForbidNode(RepositoryNode node){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  IRepositoryViewObject nodeObject=node.getObject();
  if (nodeObject == null || nodeObject.getProperty() == null || nodeObject.getProperty().getItem() == null) {
    return false;
  }
  boolean locked=false;
  if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
    if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
      locked=true;
    }
  }
  boolean isTestCaseLocked=isTestCasesLocked(node);
  if ((locked || isTestCaseLocked || RepositoryManager.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
    final String title=Messages.getString("String_Node_Str");
    String nodeName=ERepositoryObjectType.getDeleteFolderName(nodeObject.getRepositoryObjectType());
    String message="String_Node_Str";
    if (locked) {
      message=Messages.getString("String_Node_Str",nodeName);
    }
 else     if (isTestCaseLocked) {
      message=Messages.getString("String_Node_Str",nodeName);
    }
    final String lockMessage=message;
    Display.getDefault().syncExec(new Runnable(){
      @Override public void run(){
        MessageDialog dialog=new MessageDialog(new Shell(),title,null,lockMessage,MessageDialog.ERROR,new String[]{IDialogConstants.OK_LABEL},0);
        dialog.open();
      }
    }
);
    return true;
  }
  ERepositoryObjectType contentType=node.getContentType();
  if (ERepositoryObjectType.JOB_DOC != null && contentType != null) {
    if (contentType.equals(ERepositoryObjectType.JOB_DOC)) {
      return true;
    }
  }
  if (ERepositoryObjectType.JOB_DOC != null && node.getProperties(EProperties.CONTENT_TYPE) != null) {
    if (node.getProperties(EProperties.CONTENT_TYPE).equals(ERepositoryObjectType.JOB_DOC)) {
      return true;
    }
  }
  if (ERepositoryObjectType.JOBLET_DOC != null && contentType != null) {
    if (contentType.equals(ERepositoryObjectType.JOBLET_DOC)) {
      return true;
    }
  }
  if (ERepositoryObjectType.JOBLET_DOC != null && node.getProperties(EProperties.CONTENT_TYPE) != null) {
    if (node.getProperties(EProperties.CONTENT_TYPE).equals(ERepositoryObjectType.JOBLET_DOC)) {
      return true;
    }
  }
  if (ERepositoryObjectType.GENERATED != null && contentType != null) {
    if (contentType.equals(ERepositoryObjectType.GENERATED)) {
      return true;
    }
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_CDC) {
    return true;
  }
  if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_TABLE) {
    final IRepositoryViewObject object=nodeObject;
    if (object != null && object instanceof MetadataTableRepositoryObject) {
      final MetadataTable table=((MetadataTableRepositoryObject)object).getTable();
      if (table != null && table instanceof SubscriberTable) {
        return true;
      }
    }
  }
  return false;
}