Program: 137847
Project: 137847
Buggy source:
/** 
 * DOC scorreia Comment method "queryOnTable".
 * @param catalog
 * @param schema
 * @param schemaIndic
 * @param tablesSet
 * @param tableCube
 * @param ok
 * @throws SQLException
 */
protected void evalAllCounts(String catalog,String schema,NamedColumnSet t,SchemaIndicator schemaIndic,boolean isTable,ReturnCode ok) throws SQLException {
  EObject eContainer=schemaIndic.getAnalyzedElement().eContainer();
  String quCatalog=null;
  if (eContainer instanceof Catalog) {
    quCatalog=dbms().quote(((Catalog)eContainer).getName());
  }
  String quSchema=schema == null ? null : dbms().quote(schema);
  final String table=t.getName();
  String quTable=dbms().quote(table);
  if (isTable) {
    long rowCount=getRowCounts(quCatalog,quSchema,quTable);
    schemaIndic.setTableRowCount(schemaIndic.getTableRowCount() + rowCount);
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    boolean isPkIndexSupported=dbmsLanguage.isPkIndexSupported();
    int pkCount=0;
    int idxCount=0;
    if (!isPkIndexSupported) {
      pkCount=getPKCount(catalog,schema,table);
      schemaIndic.setKeyCount(schemaIndic.getKeyCount() + pkCount);
      idxCount=getIndexCount(catalog,schema,table);
      schemaIndic.setIndexCount(schemaIndic.getIndexCount() + idxCount);
    }
    createTableIndicator(t,schemaIndic,rowCount,pkCount,idxCount);
  }
 else {
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    long rowCount=getRowCounts(quCatalog,schema,quTable);
    schemaIndic.setViewRowCount(schemaIndic.getViewRowCount() + rowCount);
    createViewIndicator(t,schemaIndic,rowCount);
  }
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "queryOnTable".
 * @param catalog
 * @param schema
 * @param schemaIndic
 * @param tablesSet
 * @param tableCube
 * @param ok
 * @throws SQLException
 */
protected void evalAllCounts(String catalog,String schema,NamedColumnSet t,SchemaIndicator schemaIndic,boolean isTable,ReturnCode ok) throws SQLException {
  EObject eContainer=schemaIndic.getAnalyzedElement().eContainer();
  String quCatalog=null;
  if (eContainer instanceof Catalog) {
    quCatalog=dbms().quote(((Catalog)eContainer).getName());
  }
  String quSchema=schema == null ? null : dbms().quote(schema);
  final String table=t.getName();
  String quTable=dbms().quote(table);
  if (isTable) {
    long rowCount=getRowCounts(quCatalog,quSchema,quTable);
    schemaIndic.setTableRowCount(schemaIndic.getTableRowCount() + rowCount);
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    boolean isPkIndexSupported=dbmsLanguage.isPkIndexSupported();
    int pkCount=0;
    int idxCount=0;
    if (isPkIndexSupported) {
      pkCount=getPKCount(catalog,schema,table);
      schemaIndic.setKeyCount(schemaIndic.getKeyCount() + pkCount);
      idxCount=getIndexCount(catalog,schema,table);
      schemaIndic.setIndexCount(schemaIndic.getIndexCount() + idxCount);
    }
    createTableIndicator(t,schemaIndic,rowCount,pkCount,idxCount);
  }
 else {
    if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
      schema=ColumnSetHelper.getTableOwner(t);
    }
    long rowCount=getRowCounts(quCatalog,schema,quTable);
    schemaIndic.setViewRowCount(schemaIndic.getViewRowCount() + rowCount);
    createViewIndicator(t,schemaIndic,rowCount);
  }
}