Program: 137846
Project: 137846
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) {
        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());
  }
 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;
      List<? extends NamedColumnSet> tables=DqRepositoryViewService.getTables(getDataManager(),pacage,trimPat,true);
      for (      NamedColumnSet t : tables) {
        this.getMonitor().setTaskName(Messages.getString("String_Node_Str") + "String_Node_Str" + catName+ "String_Node_Str"+ t.getName());
        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());
  }
 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"));
    }
  }
}