Program: 137684
Project: 137684
Buggy source:
@Override public boolean hasChildren(Object element){
  try {
    if (element instanceof IRepositoryNode) {
      IRepositoryNode node=(IRepositoryNode)element;
      IRepositoryViewObject viewObject=node.getObject();
      if (viewObject instanceof MetadataColumnRepositoryObject) {
        return false;
      }
 else       if (viewObject instanceof IMetadataXmlElementType) {
        MetadataXmlElementTypeRepositoryObject metadataXmlElementType=(MetadataXmlElementTypeRepositoryObject)viewObject;
        List<TdXmlElementType> xmlElements=org.talend.cwm.db.connection.ConnectionUtils.getXMLElementsWithOutSave(metadataXmlElementType.getTdXmlElementType());
        return xmlElements.size() > 0;
      }
 else       if (node instanceof ExchangeFolderRepNode) {
        return true;
      }
 else       if (node instanceof ExchangeCategoryRepNode) {
        return true;
      }
 else       if (node instanceof ExchangeComponentRepNode) {
        return false;
      }
 else       if (node instanceof SysIndicatorFolderRepNode) {
        return true;
      }
    }
    if (element instanceof IEcosCategory) {
      return true;
    }
    if (element instanceof DBTableFolderRepNode) {
      if (DQRepositoryNode.isOnFilterring()) {
        return true;
      }
      DBTableFolderRepNode dbTableFolder=(DBTableFolderRepNode)element;
      return dbTableFolder.hasChildren();
    }
    if (element instanceof DBTableRepNode) {
      return true;
    }
    if (element instanceof DBViewRepNode) {
      return true;
    }
    if (element instanceof DBCatalogRepNode) {
      return true;
    }
    if (element instanceof DBSchemaRepNode) {
      return true;
    }
    if (element instanceof DBViewFolderRepNode) {
      if (DQRepositoryNode.isOnFilterring()) {
        return true;
      }
      DBViewFolderRepNode dbViewFolder=(DBViewFolderRepNode)element;
      return dbViewFolder.hasChildren();
    }
  }
 catch (  RuntimeException e) {
    int indexOf=e.getMessage().indexOf("String_Node_Str");
    if (indexOf > 0 && PluginChecker.isOnlyTopLoaded()) {
      String errorMessage=e.getMessage().substring(indexOf);
      MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),DefaultMessagesImpl.getString("String_Node_Str"),errorMessage);
    }
 else {
      log.error(e);
    }
    return false;
  }
  return super.hasChildren(element);
}

Fixed version (ground truth):
@Override public boolean hasChildren(Object element){
  try {
    if (element instanceof IRepositoryNode) {
      IRepositoryNode node=(IRepositoryNode)element;
      IRepositoryViewObject viewObject=node.getObject();
      if (viewObject instanceof MetadataColumnRepositoryObject) {
        return false;
      }
 else       if (viewObject instanceof IMetadataXmlElementType) {
        MetadataXmlElementTypeRepositoryObject metadataXmlElementType=(MetadataXmlElementTypeRepositoryObject)viewObject;
        List<TdXmlElementType> xmlElements=org.talend.cwm.db.connection.ConnectionUtils.getXMLElementsWithOutSave(metadataXmlElementType.getTdXmlElementType());
        return xmlElements.size() > 0;
      }
 else       if (node instanceof ExchangeFolderRepNode) {
        return true;
      }
 else       if (node instanceof ExchangeCategoryRepNode) {
        return true;
      }
 else       if (node instanceof ExchangeComponentRepNode) {
        return false;
      }
 else       if (node instanceof SysIndicatorFolderRepNode) {
        return true;
      }
    }
    if (element instanceof IEcosCategory) {
      return true;
    }
    if (element instanceof DBTableFolderRepNode) {
      if (DQRepositoryNode.isOnFilterring()) {
        return true;
      }
      DBTableFolderRepNode dbTableFolder=(DBTableFolderRepNode)element;
      return dbTableFolder.hasChildren();
    }
    if (element instanceof DBTableRepNode) {
      return true;
    }
    if (element instanceof DBViewRepNode) {
      return true;
    }
    if (element instanceof DBCatalogRepNode) {
      return true;
    }
    if (element instanceof DBSchemaRepNode) {
      return true;
    }
    if (element instanceof DBViewFolderRepNode) {
      if (DQRepositoryNode.isOnFilterring()) {
        return true;
      }
      DBViewFolderRepNode dbViewFolder=(DBViewFolderRepNode)element;
      return dbViewFolder.hasChildren();
    }
  }
 catch (  MissingDriverException e) {
    if (PluginChecker.isOnlyTopLoaded()) {
      MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),DefaultMessagesImpl.getString("String_Node_Str"),e.getErrorMessage());
    }
 else {
      log.error(e,e);
    }
    return false;
  }
  return super.hasChildren(element);
}