Program: 137531
Project: 137531
Buggy source:
protected void evalSchemaIndicLow(final CatalogIndicator catalogIndic,final SchemaIndicator schemaIndic,final Catalog tdCatalog,final Schema tdSchema,ReturnCode ok) throws SQLException {
  boolean hasSchema=tdSchema != null;
  boolean hasCatalog=false;
  String schemaName=hasSchema ? tdSchema.getName() : null;
  String catName=null;
  if (tdCatalog == null) {
    if (tdSchema.eContainer() instanceof Catalog) {
      hasCatalog=true;
      catName=((Catalog)tdSchema.eContainer()).getName();
    }
  }
 else {
    hasCatalog=true;
    catName=hasCatalog ? tdCatalog.getName() : null;
  }
  schemaIndic.setAnalyzedElement(hasSchema ? tdSchema : tdCatalog);
  int tableCount=0;
  final String[] tablePatterns=tablePattern != null && tablePattern.contains(String.valueOf(FILTER_SEP)) ? StringUtils.split(this.tablePattern,FILTER_SEP) : new String[]{this.tablePattern};
  for (  String pat : tablePatterns) {
    String trimPat=pat != null && !PluginConstant.EMPTY_STRING.equals(pat) ? pat.trim() : null;
    try {
      Package pacage=tdSchema == null ? tdCatalog : tdSchema;
      List<? extends NamedColumnSet> tables=DqRepositoryViewService.getTables(getDataManager(),pacage,trimPat,true);
      for (      NamedColumnSet t : tables) {
        if (this.getMonitor() != null) {
          StringBuilder taskName=new StringBuilder();
          if (catName != null) {
            taskName.append(Messages.getString("String_Node_Str",catName)).append("String_Node_Str");
          }
          if (schemaName != null) {
            taskName.append(Messages.getString("String_Node_Str",schemaName)).append("String_Node_Str");
          }
          taskName.append(Messages.getString("String_Node_Str",t.getName()));
          this.getMonitor().setTaskName(Messages.getString("String_Node_Str",taskName.toString()));
        }
        tableCount++;
        evalAllCounts(catName,schemaName,t,schemaIndic,true,ok);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  schemaIndic.setTableCount(tableCount);
  int viewCount=0;
  final String[] viewPatterns=viewPattern != null && viewPattern.contains(String.valueOf(FILTER_SEP)) ? StringUtils.split(this.viewPattern,FILTER_SEP) : new String[]{this.viewPattern};
  for (  String pat : viewPatterns) {
    String trimPat=pat != null && !PluginConstant.EMPTY_STRING.equals(pat) ? pat.trim() : null;
    try {
      Package pacage=tdSchema == null ? tdCatalog : tdSchema;
      List<? extends NamedColumnSet> views=DqRepositoryViewService.getViews(getDataManager(),pacage,trimPat,true);
      for (      NamedColumnSet t : views) {
        viewCount++;
        evalAllCounts(catName,schemaName,t,schemaIndic,false,ok);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  schemaIndic.setViewCount(viewCount);
  if (hasCatalog && hasSchema && catalogIndic != null) {
    this.addToConnectionIndicator(catalogIndic);
    catalogIndic.addSchemaIndicator(schemaIndic);
    catalogIndic.setTableCount(catalogIndic.getTableCount() + tableCount);
    catalogIndic.setTableRowCount(catalogIndic.getTableRowCount() + schemaIndic.getTableRowCount());
    catalogIndic.setViewRowCount(catalogIndic.getViewRowCount() + schemaIndic.getViewRowCount());
    catalogIndic.setViewCount(catalogIndic.getViewCount() + schemaIndic.getViewCount());
    catalogIndic.setKeyCount(catalogIndic.getKeyCount() + schemaIndic.getKeyCount());
    catalogIndic.setIndexCount(catalogIndic.getIndexCount() + schemaIndic.getIndexCount());
  }
 else   if (!hasCatalog) {
    this.addToConnectionIndicator(schemaIndic);
  }
 else   if (!hasSchema) {
    if (SchemaPackage.eINSTANCE.getCatalogIndicator().equals(schemaIndic.eClass())) {
      this.addToConnectionIndicator(schemaIndic);
    }
 else {
      log.error(Messages.getString("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
protected void evalSchemaIndicLow(final CatalogIndicator catalogIndic,final SchemaIndicator schemaIndic,final Catalog tdCatalog,final Schema tdSchema,ReturnCode ok) throws SQLException {
  boolean hasSchema=tdSchema != null;
  boolean hasCatalog=false;
  String schemaName=hasSchema ? tdSchema.getName() : null;
  String catName=null;
  if (tdCatalog == null) {
    if (tdSchema.eContainer() instanceof Catalog) {
      hasCatalog=true;
      catName=((Catalog)tdSchema.eContainer()).getName();
    }
  }
 else {
    hasCatalog=true;
    catName=hasCatalog ? tdCatalog.getName() : null;
  }
  schemaIndic.setAnalyzedElement(hasSchema ? tdSchema : tdCatalog);
  int tableCount=0;
  final String[] tablePatterns=tablePattern != null && tablePattern.contains(String.valueOf(FILTER_SEP)) ? StringUtils.split(this.tablePattern,FILTER_SEP) : new String[]{this.tablePattern};
  for (  String pat : tablePatterns) {
    String trimPat=pat != null && !PluginConstant.EMPTY_STRING.equals(pat) ? pat.trim() : null;
    try {
      Package pacage=tdSchema == null ? tdCatalog : tdSchema;
      checkConnectionBeforeGetTableView();
      List<? extends NamedColumnSet> tables=DqRepositoryViewService.getTables(getConnection(),getDataManager(),pacage,trimPat,true);
      for (      NamedColumnSet t : tables) {
        if (this.getMonitor() != null) {
          StringBuilder taskName=new StringBuilder();
          if (catName != null) {
            taskName.append(Messages.getString("String_Node_Str",catName)).append("String_Node_Str");
          }
          if (schemaName != null) {
            taskName.append(Messages.getString("String_Node_Str",schemaName)).append("String_Node_Str");
          }
          taskName.append(Messages.getString("String_Node_Str",t.getName()));
          this.getMonitor().setTaskName(Messages.getString("String_Node_Str",taskName.toString()));
        }
        tableCount++;
        evalAllCounts(catName,schemaName,t,schemaIndic,true,ok);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  schemaIndic.setTableCount(tableCount);
  int viewCount=0;
  final String[] viewPatterns=viewPattern != null && viewPattern.contains(String.valueOf(FILTER_SEP)) ? StringUtils.split(this.viewPattern,FILTER_SEP) : new String[]{this.viewPattern};
  for (  String pat : viewPatterns) {
    String trimPat=pat != null && !PluginConstant.EMPTY_STRING.equals(pat) ? pat.trim() : null;
    try {
      Package pacage=tdSchema == null ? tdCatalog : tdSchema;
      checkConnectionBeforeGetTableView();
      List<? extends NamedColumnSet> views=DqRepositoryViewService.getViews(getConnection(),getDataManager(),pacage,trimPat,true);
      for (      NamedColumnSet t : views) {
        viewCount++;
        evalAllCounts(catName,schemaName,t,schemaIndic,false,ok);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  schemaIndic.setViewCount(viewCount);
  if (hasCatalog && hasSchema && catalogIndic != null) {
    this.addToConnectionIndicator(catalogIndic);
    catalogIndic.addSchemaIndicator(schemaIndic);
    catalogIndic.setTableCount(catalogIndic.getTableCount() + tableCount);
    catalogIndic.setTableRowCount(catalogIndic.getTableRowCount() + schemaIndic.getTableRowCount());
    catalogIndic.setViewRowCount(catalogIndic.getViewRowCount() + schemaIndic.getViewRowCount());
    catalogIndic.setViewCount(catalogIndic.getViewCount() + schemaIndic.getViewCount());
    catalogIndic.setKeyCount(catalogIndic.getKeyCount() + schemaIndic.getKeyCount());
    catalogIndic.setIndexCount(catalogIndic.getIndexCount() + schemaIndic.getIndexCount());
  }
 else   if (!hasCatalog) {
    this.addToConnectionIndicator(schemaIndic);
  }
 else   if (!hasSchema) {
    if (SchemaPackage.eINSTANCE.getCatalogIndicator().equals(schemaIndic.eClass())) {
      this.addToConnectionIndicator(schemaIndic);
    }
 else {
      log.error(Messages.getString("String_Node_Str"));
    }
  }
}