Program: 138596
Project: 138596
Buggy source:
/** 
 * Create TableFolderNodeRepositoryNode.
 * @param node parent RepositoryNode
 * @param metadataObject parent CatalogViewObject or SchemaViewObject
 */
private void createRepositoryNodeTableFolderNode(List<IRepositoryNode> node,IRepositoryViewObject metadataObject){
  List<TdTable> tables=new ArrayList<TdTable>();
  if (metadataObject instanceof MetadataCatalogRepositoryObject) {
    viewObject=((MetadataCatalogRepositoryObject)metadataObject).getViewObject();
    catalog=((MetadataCatalogRepositoryObject)metadataObject).getCatalog();
    item=(ConnectionItem)viewObject.getProperty().getItem();
    connection=item.getConnection();
  }
 else   if (metadataObject instanceof MetadataSchemaRepositoryObject) {
    viewObject=((MetadataSchemaRepositoryObject)metadataObject).getViewObject();
    schema=((MetadataSchemaRepositoryObject)metadataObject).getSchema();
    item=(ConnectionItem)viewObject.getProperty().getItem();
    connection=item.getConnection();
  }
  EList<ModelElement> ownedElement=null;
  if (catalog != null) {
    ownedElement=catalog.getOwnedElement();
  }
  if (ownedElement != null && ownedElement.size() <= 0) {
    try {
      if (catalog != null) {
        tables=DqRepositoryViewService.getTables(connection,catalog,null,true);
      }
 else       if (schema != null) {
        tables=DqRepositoryViewService.getTables(connection,schema,null,true);
      }
      for (      ModelElement element : ownedElement) {
        if (element instanceof TdTable) {
          TdTable table=(TdTable)element;
          tables.add(table);
        }
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
 else {
    if (tables.size() <= 0) {
      try {
        if (catalog != null) {
          tables=DqRepositoryViewService.getTables(connection,catalog,null,true);
        }
 else         if (schema != null) {
          tables=DqRepositoryViewService.getTables(connection,schema,null,true);
        }
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
  createTableRepositoryNode(tables,node);
}

Fixed version (ground truth):
/** 
 * Create TableFolderNodeRepositoryNode.
 * @param node parent RepositoryNode
 * @param metadataObject parent CatalogViewObject or SchemaViewObject
 */
private void createRepositoryNodeTableFolderNode(List<IRepositoryNode> node,IRepositoryViewObject metadataObject){
  List<TdTable> tables=new ArrayList<TdTable>();
  try {
    if (metadataObject instanceof MetadataCatalogRepositoryObject) {
      viewObject=((MetadataCatalogRepositoryObject)metadataObject).getViewObject();
      catalog=((MetadataCatalogRepositoryObject)metadataObject).getCatalog();
      tables=PackageHelper.getTables(catalog);
      if (tables.isEmpty()) {
        tables=DqRepositoryViewService.getTables(connection,catalog,null,true);
      }
    }
 else {
      viewObject=((MetadataSchemaRepositoryObject)metadataObject).getViewObject();
      schema=((MetadataSchemaRepositoryObject)metadataObject).getSchema();
      tables=PackageHelper.getTables(schema);
      if (tables.isEmpty()) {
        tables=DqRepositoryViewService.getTables(connection,schema,null,true);
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  createTableRepositoryNode(tables,node);
}