nus-yam/ex-repair huggingface dataset:
Program: 136472
Project: 136472
Buggy source:
/** 
 * this method is used to create a DBCatalogRepNode. And Sybase is a specal case because we don't create schema level when the version of stdio is lower than 5.0.0.So we will create DBSybaseCatalogRepNode to deal with this special case
 * @param viewObject
 * @param parent parent of repositoryNode
 * @param type
 * @return
 */
public static RepositoryNode createDBCatalogRepNode(IRepositoryViewObject viewObject,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  Item databaseItem=viewObject.getProperty().getItem();
  DatabaseConnection dbConnection=(DatabaseConnection)((DatabaseConnectionItem)databaseItem).getConnection();
  SupportDBUrlType dbTypeByKey=SupportDBUrlType.getDBTypeByKey(dbConnection.getDatabaseType());
switch (dbTypeByKey) {
case SYBASEDEFAULTURL:
    return new DBSybaseCatalogRepNode(viewObject,parent,type,inWhichProject);
default :
  return new DBCatalogRepNode(viewObject,parent,type,inWhichProject);
}
}

Fixed version (ground truth):
/** 
 * this method is used to create a DBCatalogRepNode. And Sybase is a specal case because we don't create schema level when the version of stdio is lower than 5.0.0.So we will create DBSybaseCatalogRepNode to deal with this special case
 * @param viewObject
 * @param parent parent of repositoryNode
 * @param type
 * @return
 */
public static RepositoryNode createDBCatalogRepNode(IRepositoryViewObject viewObject,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  Item databaseItem=viewObject.getProperty().getItem();
  DatabaseConnection dbConnection=(DatabaseConnection)((DatabaseConnectionItem)databaseItem).getConnection();
  SupportDBUrlType dbTypeByKey=SupportDBUrlType.getDBTypeByKey(dbConnection.getDatabaseType());
switch (dbTypeByKey == null ? SupportDBUrlType.MYSQLDEFAULTURL : dbTypeByKey) {
case SYBASEDEFAULTURL:
    return new DBSybaseCatalogRepNode(viewObject,parent,type,inWhichProject);
default :
  return new DBCatalogRepNode(viewObject,parent,type,inWhichProject);
}
}
Program: 136474
Project: 136474
Buggy source:
/** 
 * Judge whether there are JUDI or not
 * @param modelElementIndicator
 * @return
 */
private boolean searchJUDI(ModelElementIndicator modelElementIndicator,boolean isExist){
  isExistMappingExpr=true;
  for (  IndicatorUnit indicatorUnit : modelElementIndicator.getIndicatorUnits()) {
    if (IndicatorEnum.UserDefinedIndicatorEnum == indicatorUnit.getType() && !UDIHelper.isJavaUDI(indicatorUnit.getIndicator()) ^ isExist) {
      ExecutionLanguage executionLanguage=((AnalysisEditor)this.getEditor()).getUIExecuteEngin();
      DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(this.getCurrentModelElement(),executionLanguage);
      if (dbmsLanguage.getExpression(indicatorUnit.getIndicator()) == null) {
        isExistMappingExpr=false;
        return isExist;
      }
      return !isExist;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Judge whether there are JUDI or not
 * @param modelElementIndicator
 * @return
 */
private boolean searchJUDI(ModelElementIndicator modelElementIndicator,boolean isExist){
  isExistSqlExpr=false;
  for (  IndicatorUnit indicatorUnit : modelElementIndicator.getIndicatorUnits()) {
    if (IndicatorEnum.UserDefinedIndicatorEnum == indicatorUnit.getType()) {
      if (!isExistSqlExpr && indicatorUnit.getIndicator().getIndicatorDefinition().getSqlGenericExpression().isEmpty()) {
        isExistSqlExpr=true;
      }
      if (isExist && UDIHelper.isJavaUDI(indicatorUnit.getIndicator())) {
        return true;
      }
 else       if (!isExist && UDIHelper.isJavaUDI(indicatorUnit.getIndicator())) {
        return false;
      }
    }
  }
  return !isExist;
}
Program: 136475
Project: 136475
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  execLang=execCombo1.getText();
  ExecutionLanguage currentLanguage=ExecutionLanguage.get(execLang);
  if (ExecutionLanguage.SQL.equals(currentLanguage) && includeJavaEngineIndicator()) {
    String dialogMessage="String_Node_Str";
    if (isExistMappingExpr) {
      dialogMessage=DefaultMessagesImpl.getString("String_Node_Str");
    }
 else {
      ExecutionLanguage executionLanguage=((AnalysisEditor)ColumnAnalysisDetailsPage.this.getEditor()).getUIExecuteEngin();
      DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(ColumnAnalysisDetailsPage.this.getCurrentModelElement(),executionLanguage);
      dialogMessage=DefaultMessagesImpl.getString("String_Node_Str",dbmsLanguage.getDbmsName());
      ;
    }
    MessageUI.openWarning(dialogMessage);
    changeExecuteLanguageToJava(false);
    execLang=execCombo1.getText();
    return;
  }
 else   if (ExecutionLanguage.JAVA.equals(currentLanguage) && checkSqlEngineIndicatorExist()) {
    if (isRunWithSampleData) {
      MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else {
      MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    }
    changeExecuteLanguageToSql(true);
    execLang=execCombo1.getText();
    return;
  }
  refreshEnginSection(javaEnginSection,currentLanguage);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  execLang=execCombo1.getText();
  ExecutionLanguage currentLanguage=ExecutionLanguage.get(execLang);
  if (ExecutionLanguage.SQL.equals(currentLanguage) && includeJavaEngineIndicator()) {
    String dialogMessage=getNonJavaIndicatorMessage();
    MessageUI.openWarning(dialogMessage);
    changeExecuteLanguageToJava(false);
    execLang=execCombo1.getText();
    return;
  }
 else   if (ExecutionLanguage.JAVA.equals(currentLanguage) && checkSqlEngineIndicatorExist()) {
    if (isRunWithSampleData) {
      MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else {
      MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
    }
    changeExecuteLanguageToSql(true);
    execLang=execCombo1.getText();
    return;
  }
  refreshEnginSection(javaEnginSection,currentLanguage);
}
Program: 136476
Project: 136476
Buggy source:
private void addListenerToExecuteEngine(final CCombo execCombo1,final Composite javaEnginSection){
  execCombo1.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      execLang=execCombo1.getText();
      ExecutionLanguage currentLanguage=ExecutionLanguage.get(execLang);
      if (ExecutionLanguage.SQL.equals(currentLanguage) && includeJavaEngineIndicator()) {
        String dialogMessage="String_Node_Str";
        if (isExistMappingExpr) {
          dialogMessage=DefaultMessagesImpl.getString("String_Node_Str");
        }
 else {
          ExecutionLanguage executionLanguage=((AnalysisEditor)ColumnAnalysisDetailsPage.this.getEditor()).getUIExecuteEngin();
          DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(ColumnAnalysisDetailsPage.this.getCurrentModelElement(),executionLanguage);
          dialogMessage=DefaultMessagesImpl.getString("String_Node_Str",dbmsLanguage.getDbmsName());
          ;
        }
        MessageUI.openWarning(dialogMessage);
        changeExecuteLanguageToJava(false);
        execLang=execCombo1.getText();
        return;
      }
 else       if (ExecutionLanguage.JAVA.equals(currentLanguage) && checkSqlEngineIndicatorExist()) {
        if (isRunWithSampleData) {
          MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
        }
 else {
          MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
        }
        changeExecuteLanguageToSql(true);
        execLang=execCombo1.getText();
        return;
      }
      refreshEnginSection(javaEnginSection,currentLanguage);
    }
  }
);
}

Fixed version (ground truth):
private void addListenerToExecuteEngine(final CCombo execCombo1,final Composite javaEnginSection){
  execCombo1.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      execLang=execCombo1.getText();
      ExecutionLanguage currentLanguage=ExecutionLanguage.get(execLang);
      if (ExecutionLanguage.SQL.equals(currentLanguage) && includeJavaEngineIndicator()) {
        String dialogMessage=getNonJavaIndicatorMessage();
        MessageUI.openWarning(dialogMessage);
        changeExecuteLanguageToJava(false);
        execLang=execCombo1.getText();
        return;
      }
 else       if (ExecutionLanguage.JAVA.equals(currentLanguage) && checkSqlEngineIndicatorExist()) {
        if (isRunWithSampleData) {
          MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
        }
 else {
          MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str"));
        }
        changeExecuteLanguageToSql(true);
        execLang=execCombo1.getText();
        return;
      }
      refreshEnginSection(javaEnginSection,currentLanguage);
    }
  }
);
}
Program: 136479
Project: 136479
Buggy source:
public static FileInputDelimited createFileInputDelimited(DelimitedFileConnection delimitedFileconnection,int limit) throws IOException {
  String rowSeparator=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  String encoding=JavaSqlFactory.getEncoding(delimitedFileconnection);
  String fieldSeparatorValue=JavaSqlFactory.getFieldSeparatorValue(delimitedFileconnection);
  boolean isSpliteRecord=delimitedFileconnection.isSplitRecord();
  boolean isSkipeEmptyRow=delimitedFileconnection.isRemoveEmptyRow();
  String languageName=LanguageManager.getCurrentLanguage().getName();
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  int footValue=JavaSqlFactory.getFooterValue(delimitedFileconnection);
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  return new FileInputDelimited(ParameterUtil.trimParameter(path),ParameterUtil.trimParameter(encoding),ParameterUtil.trimParameter(StringUtils.loadConvert(fieldSeparatorValue,languageName)),ParameterUtil.trimParameter(StringUtils.loadConvert(rowSeparator,languageName)),isSkipeEmptyRow,headValue,footValue,limitValue < limit ? limitValue : limit,-1,isSpliteRecord);
}

Fixed version (ground truth):
public static FileInputDelimited createFileInputDelimited(DelimitedFileConnection delimitedFileconnection,int limit) throws IOException {
  String rowSeparator=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  String encoding=JavaSqlFactory.getEncoding(delimitedFileconnection);
  String fieldSeparatorValue=JavaSqlFactory.getFieldSeparatorValue(delimitedFileconnection);
  boolean isSpliteRecord=delimitedFileconnection.isSplitRecord();
  boolean isSkipeEmptyRow=delimitedFileconnection.isRemoveEmptyRow();
  String languageName=LanguageManager.getCurrentLanguage().getName();
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  if (limitValue <= 0) {
    limitValue=limit;
  }
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  int footValue=JavaSqlFactory.getFooterValue(delimitedFileconnection);
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  return new FileInputDelimited(ParameterUtil.trimParameter(path),ParameterUtil.trimParameter(encoding),ParameterUtil.trimParameter(StringUtils.loadConvert(fieldSeparatorValue,languageName)),ParameterUtil.trimParameter(StringUtils.loadConvert(rowSeparator,languageName)),isSkipeEmptyRow,headValue,footValue,limitValue < limit ? limitValue : limit,-1,isSpliteRecord);
}
Program: 136480
Project: 136480
Buggy source:
@Override protected int getCsvReaderLimit(){
  int connLimit=super.getCsvReaderLimit();
  int analysisLimit=getLimitNumber(this.analysis);
  return analysisLimit < connLimit ? analysisLimit : connLimit;
}

Fixed version (ground truth):
@Override protected int getCsvReaderLimit(){
  int connLimit=super.getCsvReaderLimit();
  int analysisLimit=getLimitNumber(this.analysis);
  if (connLimit <= 0) {
    return analysisLimit;
  }
  return analysisLimit < connLimit ? analysisLimit : connLimit;
}
Program: 136483
Project: 136483
Buggy source:
@Override public void addListenerToChartComp(Object chartComposite,final String referenceLink,final String menuText){
  final ChartComposite chartComp=(ChartComposite)chartComposite;
  ChartMouseListener listener=new ChartMouseListener(){
    @Override public void chartMouseClicked(    ChartMouseEvent event){
      if (event.getTrigger().getButton() == 1 && referenceLink != null) {
        Menu menu=new Menu(chartComp.getShell(),SWT.POP_UP);
        chartComp.setMenu(menu);
        MenuItem item=new MenuItem(menu,SWT.PUSH);
        item.setText(menuText);
        item.addSelectionListener(new SelectionAdapter(){
          @Override public void widgetSelected(          SelectionEvent e){
            ChartUtils.openReferenceLink(referenceLink);
          }
        }
);
        menu.setVisible(true);
      }
    }
    @Override public void chartMouseMoved(    ChartMouseEvent event){
    }
  }
;
  chartComp.addChartMouseListener(listener);
  chartComp.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      chartComp.removeChartMouseListener(listener);
      chartComp.dispose();
    }
  }
);
}

Fixed version (ground truth):
@Override public void addListenerToChartComp(Object chartComposite,final String referenceLink,final String menuText){
  final ChartComposite chartComp=(ChartComposite)chartComposite;
  final ChartMouseListener listener=new ChartMouseListener(){
    @Override public void chartMouseClicked(    ChartMouseEvent event){
      if (event.getTrigger().getButton() == 1 && referenceLink != null) {
        Menu menu=new Menu(chartComp.getShell(),SWT.POP_UP);
        chartComp.setMenu(menu);
        MenuItem item=new MenuItem(menu,SWT.PUSH);
        item.setText(menuText);
        item.addSelectionListener(new SelectionAdapter(){
          @Override public void widgetSelected(          SelectionEvent e){
            ChartUtils.openReferenceLink(referenceLink);
          }
        }
);
        menu.setVisible(true);
      }
    }
    @Override public void chartMouseMoved(    ChartMouseEvent event){
    }
  }
;
  chartComp.addChartMouseListener(listener);
  chartComp.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      chartComp.removeChartMouseListener(listener);
      chartComp.dispose();
    }
  }
);
}
Program: 136486
Project: 136486
Buggy source:
/** 
 * unregister the update execution event Added 20130725 TDQ-7639
 */
@Override public void dispose(){
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_ANALYSIS_CHECK_BEFORERUN);
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_ANALYSIS_RUN_FROM_MENU);
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement().getName(),EventEnum.DQ_ANALYSIS_REOPEN_EDITOR);
  if (analysisType.equals(AnalysisType.COLUMN_SET)) {
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_COLUMNSET_SHOW_MATCH_INDICATORS);
  }
  if (masterPage instanceof DynamicAnalysisMasterPage) {
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_DYNAMIC_REGISTER_DYNAMIC_CHART);
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_DYNAMIC_REGISTER_DYNAMIC_CHART);
  }
  super.dispose();
}

Fixed version (ground truth):
/** 
 * unregister the update execution event Added 20130725 TDQ-7639
 */
@Override public void dispose(){
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_ANALYSIS_CHECK_BEFORERUN);
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_ANALYSIS_RUN_FROM_MENU);
  EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement().getName(),EventEnum.DQ_ANALYSIS_REOPEN_EDITOR);
  if (analysisType.equals(AnalysisType.COLUMN_SET)) {
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_COLUMNSET_SHOW_MATCH_INDICATORS);
  }
  if (masterPage instanceof DynamicAnalysisMasterPage) {
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_DYNAMIC_REGISTER_DYNAMIC_CHART);
    EventManager.getInstance().clearEvent(getMasterPage().getCurrentModelElement(),EventEnum.DQ_DYNAMIC_UNREGISTER_DYNAMIC_CHART);
  }
  super.dispose();
}
Program: 136488
Project: 136488
Buggy source:
@Override public void dispose(){
  super.dispose();
  if (this.treeViewer != null) {
    this.treeViewer.removePropertyChangeListener(this);
  }
  if (dataFilterComp != null) {
    this.dataFilterComp.removePropertyChangeListener(this);
  }
  EventManager.getInstance().clearEvent(dataPreviewSection,EventEnum.DQ_SELECT_ELEMENT_AFTER_CREATE_CONNECTION);
  MapDBManager.getInstance().closeDB(getCurrentModelElement());
  if (oldConn != null && isDirty()) {
    getCurrentModelElement().getContext().setConnection(oldConn);
  }
  if (this.getSampleTable().getExistPreviewData() != null) {
    this.getSampleTable().getExistPreviewData().clear();
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  if (this.treeViewer != null) {
    this.treeViewer.removePropertyChangeListener(this);
  }
  if (dataFilterComp != null) {
    this.dataFilterComp.removePropertyChangeListener(this);
  }
  EventManager.getInstance().clearEvent(dataPreviewSection,EventEnum.DQ_SELECT_ELEMENT_AFTER_CREATE_CONNECTION);
  if (AnalysisHelper.isJavaExecutionEngine(getCurrentModelElement())) {
    MapDBManager.getInstance().closeDB(getCurrentModelElement());
  }
  if (oldConn != null && isDirty()) {
    getCurrentModelElement().getContext().setConnection(oldConn);
  }
  if (this.getSampleTable().getExistPreviewData() != null) {
    this.getSampleTable().getExistPreviewData().clear();
  }
}
Program: 136489
Project: 136489
Buggy source:
private void disposeComposite(){
  if (summaryComp != null && !summaryComp.isDisposed()) {
    summaryComp.dispose();
  }
  if (resultComp != null && !resultComp.isDisposed()) {
    resultComp.dispose();
  }
  if (chartComposite != null && !chartComposite.isDisposed()) {
    for (    Control control : chartComposite.getChildren()) {
      control.dispose();
    }
  }
}

Fixed version (ground truth):
private void disposeComposite(){
  if (summaryComp != null && !summaryComp.isDisposed()) {
    summaryComp.dispose();
  }
  if (resultComp != null && !resultComp.isDisposed()) {
    resultComp.dispose();
  }
}
Program: 136491
Project: 136491
Buggy source:
@Override public void dispose(){
  if (bg != null) {
    bg.dispose();
  }
  MapDBManager.getInstance().closeDB(masterPage.getCurrentModelElement());
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (bg != null) {
    bg.dispose();
  }
  if (AnalysisHelper.isJavaExecutionEngine(masterPage.getCurrentModelElement())) {
    MapDBManager.getInstance().closeDB(masterPage.getCurrentModelElement());
  }
  super.dispose();
}
Program: 136492
Project: 136492
Buggy source:
/** 
 * DOC yyin Comment method "createMenuForAllDataEntity".
 * @param shell
 * @param dataExplorer
 * @param analysis
 * @param chartDataEntities
 * @return
 */
protected Map<String,Object> createMenuForAllDataEntity(Shell shell,DataExplorer dataExplorer,Analysis analysis,ChartDataEntity[] chartDataEntities){
  Map<String,Object> menuMap=new HashMap<String,Object>();
  final ExecutionLanguage currentEngine=analysis.getParameters().getExecutionLanguage();
  if (ExecutionLanguage.JAVA == currentEngine && !analysis.getParameters().isStoreData()) {
    return menuMap;
  }
  for (  ChartDataEntity oneDataEntity : chartDataEntities) {
    Indicator indicator=oneDataEntity.getIndicator();
    Menu menu=TOPChartUtils.getInstance().createMenu(shell,dataExplorer,analysis,currentEngine,oneDataEntity,indicator,false);
    ChartTableFactory.addJobGenerationMenu(menu,analysis,indicator);
    menuMap.put(oneDataEntity.getLabel(),menu);
  }
  return menuMap;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "createMenuForAllDataEntity".
 * @param shell
 * @param dataExplorer
 * @param analysis
 * @param chartDataEntities
 * @return
 */
protected Map<String,Object> createMenuForAllDataEntity(Composite composite,DataExplorer dataExplorer,Analysis analysis,ChartDataEntity[] chartDataEntities){
  Map<String,Object> menuMap=new HashMap<String,Object>();
  final ExecutionLanguage currentEngine=analysis.getParameters().getExecutionLanguage();
  if (ExecutionLanguage.JAVA == currentEngine && !analysis.getParameters().isStoreData()) {
    return menuMap;
  }
  for (  ChartDataEntity oneDataEntity : chartDataEntities) {
    Indicator indicator=oneDataEntity.getIndicator();
    Menu menu=TOPChartUtils.getInstance().createMenu(composite,dataExplorer,analysis,currentEngine,oneDataEntity,indicator,false);
    ChartTableFactory.addJobGenerationMenu(menu,analysis,indicator);
    menuMap.put(oneDataEntity.getLabel(),menu);
  }
  return menuMap;
}
Program: 136494
Project: 136494
Buggy source:
private void createResultDataComposite(final Composite comp,final ModelElementIndicator modelElementIndicator){
  if (modelElementIndicator.getIndicators().length != 0) {
    Map<EIndicatorChartType,List<IndicatorUnit>> indicatorComposite=CompositeIndicator.getInstance().getIndicatorComposite(modelElementIndicator);
    for (    EIndicatorChartType chartType : indicatorComposite.keySet()) {
      List<IndicatorUnit> units=indicatorComposite.get(chartType);
      if (!units.isEmpty()) {
        if (chartType == EIndicatorChartType.UDI_FREQUENCY) {
          for (          IndicatorUnit unit : units) {
            List<IndicatorUnit> specialUnit=new ArrayList<IndicatorUnit>();
            specialUnit.add(unit);
            createChart(comp,chartType,specialUnit);
          }
        }
 else {
          createChart(comp,chartType,units);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void createResultDataComposite(Composite comp,ModelElementIndicator modelElementIndicator){
  if (modelElementIndicator.getIndicators().length != 0) {
    Map<EIndicatorChartType,List<IndicatorUnit>> indicatorComposite=CompositeIndicator.getInstance().getIndicatorComposite(modelElementIndicator);
    for (    EIndicatorChartType chartType : indicatorComposite.keySet()) {
      List<IndicatorUnit> units=indicatorComposite.get(chartType);
      if (!units.isEmpty()) {
        if (chartType == EIndicatorChartType.UDI_FREQUENCY) {
          for (          IndicatorUnit unit : units) {
            List<IndicatorUnit> specialUnit=new ArrayList<IndicatorUnit>();
            specialUnit.add(unit);
            createChart(comp,chartType,specialUnit);
          }
        }
 else {
          createChart(comp,chartType,units);
        }
      }
    }
  }
}
Program: 136499
Project: 136499
Buggy source:
@Override public void widgetSelected(SelectionEvent e1){
  DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(analysis);
  PatternTransformer pattTransformer=new PatternTransformer(language);
  createPattern(analysis,query,pattTransformer);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e1){
  String query=dataEntity.getKey() == null ? dataEntity.getLabel() : dataEntity.getKey().toString();
  createPattern(analysis,query);
}
Program: 136500
Project: 136500
Buggy source:
/** 
 * DOC yyin Comment method "createMenuOfGenerateRegularPattern".
 * @param analysis
 * @param menu
 * @param itemEntity
 */
public static void createMenuOfGenerateRegularPattern(final Analysis analysis,Menu menu,final ChartDataEntity dataEntity){
  final String query=dataEntity.getKey() == null ? dataEntity.getLabel() : dataEntity.getKey().toString();
  MenuItem itemCreatePatt=new MenuItem(menu,SWT.PUSH);
  itemCreatePatt.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  itemCreatePatt.setImage(ImageLib.getImage(ImageLib.PATTERN_REG));
  itemCreatePatt.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e1){
      DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(analysis);
      PatternTransformer pattTransformer=new PatternTransformer(language);
      createPattern(analysis,query,pattTransformer);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "createMenuOfGenerateRegularPattern".
 * @param analysis
 * @param menu
 * @param itemEntity
 */
public static void createMenuOfGenerateRegularPattern(final Analysis analysis,Menu menu,final ChartDataEntity dataEntity){
  MenuItem itemCreatePatt=new MenuItem(menu,SWT.PUSH);
  itemCreatePatt.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  itemCreatePatt.setImage(ImageLib.getImage(ImageLib.PATTERN_REG));
  itemCreatePatt.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e1){
      String query=dataEntity.getKey() == null ? dataEntity.getLabel() : dataEntity.getKey().toString();
      createPattern(analysis,query);
    }
  }
);
}
Program: 136501
Project: 136501
Buggy source:
/** 
 * DOC bZhou Comment method "createPattern".
 * @param analysis
 * @param itemEntity
 * @param pattTransformer
 */
public static void createPattern(Analysis analysis,String query,final PatternTransformer pattTransformer){
  String language=pattTransformer.getDbmsLanguage().getDbmsName();
  String regex=pattTransformer.getRegexp(query);
  IFolder folder=ResourceManager.getPatternRegexFolder();
  new CreatePatternAction(folder,ExpressionType.REGEXP,"String_Node_Str" + regex + "String_Node_Str",language).run();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createPattern".
 * @param analysis
 * @param itemEntity
 * @param pattTransformer
 */
public static void createPattern(Analysis analysis,String query){
  DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(analysis);
  PatternTransformer pattTransformer=new PatternTransformer(language);
  String regex=pattTransformer.getRegexp(query);
  IFolder folder=ResourceManager.getPatternRegexFolder();
  new CreatePatternAction(folder,ExpressionType.REGEXP,"String_Node_Str" + regex + "String_Node_Str",language.getDbmsName()).run();
}
Program: 136503
Project: 136503
Buggy source:
/** 
 * reload analysis connection.
 */
private void reloadConnection(TDQAnalysisItem runItem){
  if (AnalysisHelper.getReloadDatabases(runItem.getAnalysis())) {
    Connection conntion=(Connection)runItem.getAnalysis().getContext().getConnection();
    if (conntion != null) {
      try {
        RepositoryNode connectionNode=RepositoryNodeHelper.recursiveFind(conntion);
        ComparisonLevelFactory.creatComparisonLevel(connectionNode).reloadCurrentLevelElement();
      }
 catch (      ReloadCompareException e) {
        log.error(e,e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * reload analysis connection.
 */
private void reloadConnection(TDQAnalysisItem runItem){
  if (AnalysisHelper.getReloadDatabases(runItem.getAnalysis())) {
    Connection conntion=(Connection)runItem.getAnalysis().getContext().getConnection();
    if (conntion != null) {
      try {
        RepositoryNode connectionNode=RepositoryNodeHelper.recursiveFind(conntion);
        ComparisonLevelFactory.creatComparisonLevel(connectionNode).reloadCurrentLevelElement();
        CorePlugin.getDefault().refreshDQView(connectionNode);
      }
 catch (      ReloadCompareException e) {
        log.error(e,e);
      }
    }
  }
}
Program: 136504
Project: 136504
Buggy source:
public AnalysisHandler getAnalysisHandler(){
  AnalysisHandler analysisHandler=new AnalysisHandler();
  analysisHandler.setAnalysis(getCurrentModelElement());
  return analysisHandler;
}

Fixed version (ground truth):
@Override public AnalysisHandler getAnalysisHandler(){
  AnalysisHandler analysisHandler=new AnalysisHandler();
  analysisHandler.setAnalysis(getCurrentModelElement());
  return analysisHandler;
}
Program: 136505
Project: 136505
Buggy source:
/** 
 * DOC xqliu Comment method "createReloadDatabasesButton".
 * @param sectionClient
 */
private void createReloadDatabasesButton(Composite sectionClient){
  if (isConnectionAnalysis()) {
    reloadDatabasesBtn=new Button(sectionClient,SWT.CHECK);
    reloadDatabasesBtn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    reloadDatabasesBtn.setSelection(AnalysisHelper.getReloadDatabases(getCurrentModelElement()));
    reloadDatabasesBtn.addMouseListener(new MouseListener(){
      public void mouseDoubleClick(      MouseEvent e){
      }
      public void mouseDown(      MouseEvent e){
        setDirty(true);
      }
      public void mouseUp(      MouseEvent e){
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createReloadDatabasesButton".
 * @param sectionClient
 */
private void createReloadDatabasesButton(Composite sectionClient){
  if (isConnectionAnalysis()) {
    reloadDatabasesBtn=new Button(sectionClient,SWT.CHECK);
    reloadDatabasesBtn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    if (DqRepositoryViewService.isComeFromRefrenceProject(this.getTdDataProvider())) {
      reloadDatabasesBtn.setEnabled(false);
      reloadDatabasesBtn.setSelection(false);
    }
 else {
      reloadDatabasesBtn.setSelection(AnalysisHelper.getReloadDatabases(getCurrentModelElement()));
    }
    reloadDatabasesBtn.addMouseListener(new MouseListener(){
      public void mouseDoubleClick(      MouseEvent e){
      }
      public void mouseDown(      MouseEvent e){
        setDirty(true);
      }
      public void mouseUp(      MouseEvent e){
      }
    }
);
  }
}
Program: 136506
Project: 136506
Buggy source:
public ConnectionAnalysisDetailsPage(FormEditor editor,String id,String title){
  super(editor,id,title);
}

Fixed version (ground truth):
public ConnectionAnalysisDetailsPage(FormEditor editor,String id,String title){
  super(editor,id,title);
  fillDataProvider();
}
Program: 136507
Project: 136507
Buggy source:
@Override public void mouseDown(MouseEvent e){
  if (e.button == 3) {
    if (tableCatalogOrSchemaView.getItemCount() > 0 && tableCatalogOrSchemaView.getSelectionIndex() != -1) {
      final Menu menu=new Menu(tableCatalogOrSchemaView.getShell(),SWT.POP_UP);
      tableCatalogOrSchemaView.setMenu(menu);
      MenuItem tableAnalysisMenuItem=new MenuItem(menu,SWT.PUSH);
      tableAnalysisMenuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
      tableAnalysisMenuItem.setImage(ImageLib.getImage(ImageLib.ACTION_NEW_ANALYSIS));
      tableAnalysisMenuItem.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          TableItem tableItem=tableCatalogOrSchemaView.getItem(tableCatalogOrSchemaView.getSelectionIndex());
          ViewIndicator viewIndicator=(ViewIndicator)tableItem.getData();
          runTableAnalysis(viewIndicator.getTableName());
        }
      }
);
    }
 else {
      tableCatalogOrSchemaView.setMenu(null);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  if (e.button == 3) {
    TableItem tableItem=tableCatalogOrSchemaView.getItem(tableCatalogOrSchemaView.getSelectionIndex());
    final OverviewIndUIElement data=(OverviewIndUIElement)tableItem.getData();
    if (tableCatalogOrSchemaView.getItemCount() > 0 && tableCatalogOrSchemaView.getSelectionIndex() != -1) {
      final Menu menu=new Menu(tableCatalogOrSchemaView.getShell(),SWT.POP_UP);
      tableCatalogOrSchemaView.setMenu(menu);
      MenuItem tableAnalysisMenuItem=new MenuItem(menu,SWT.PUSH);
      tableAnalysisMenuItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
      tableAnalysisMenuItem.setImage(ImageLib.getImage(ImageLib.ACTION_NEW_ANALYSIS));
      tableAnalysisMenuItem.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          ViewIndicator viewIndicator=(ViewIndicator)data.getOverviewIndicator();
          runTableAnalysis(viewIndicator.getTableName());
        }
      }
);
      if (data.isVirtualNode()) {
        tableAnalysisMenuItem.setEnabled(false);
      }
    }
 else {
      tableCatalogOrSchemaView.setMenu(null);
    }
  }
}
Program: 136509
Project: 136509
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  TableItem tableItem=tableCatalogOrSchemaView.getItem(tableCatalogOrSchemaView.getSelectionIndex());
  ViewIndicator viewIndicator=(ViewIndicator)tableItem.getData();
  runTableAnalysis(viewIndicator.getTableName());
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  ViewIndicator viewIndicator=(ViewIndicator)data.getOverviewIndicator();
  runTableAnalysis(viewIndicator.getTableName());
}
Program: 136510
Project: 136510
Buggy source:
/** 
 * DOC klliu Comment method "wapperInput". relations
 * @param indicatorTableList
 * @param parentNode
 * @return
 */
private List<OverviewIndUIElement> wapperInput(EList<TableIndicator> indicatorTableList,IRepositoryNode parentNode){
  List<OverviewIndUIElement> cataUIEleList=new ArrayList<OverviewIndUIElement>();
  List<IRepositoryNode> children=parentNode.getChildren();
  for (  IRepositoryNode folderNode : children) {
    if (folderNode instanceof DBTableFolderRepNode) {
      List<IRepositoryNode> tableNodes=folderNode.getChildren();
      for (      TableIndicator indicator : indicatorTableList) {
        for (        IRepositoryNode tableNode : tableNodes) {
          MetadataTable table=((MetadataTableRepositoryObject)tableNode.getObject()).getTable();
          String name=table.getName();
          String tableName=indicator.getTableName();
          boolean equals=name.equals(tableName);
          if (equals) {
            OverviewIndUIElement tableUIEle=new OverviewIndUIElement();
            tableUIEle.setNode(tableNode);
            tableUIEle.setOverviewIndicator(indicator);
            cataUIEleList.add(tableUIEle);
            break;
          }
        }
      }
    }
  }
  return cataUIEleList;
}

Fixed version (ground truth):
/** 
 * DOC klliu Comment method "wapperInput". relations
 * @param indicatorTableList
 * @param parentNode
 * @return
 */
private List<OverviewIndUIElement> wapperInput(EList<TableIndicator> indicatorTableList,IRepositoryNode parentNode){
  List<OverviewIndUIElement> cataUIEleList=new ArrayList<OverviewIndUIElement>();
  List<IRepositoryNode> children=parentNode.getChildren();
  for (  IRepositoryNode folderNode : children) {
    if (folderNode instanceof DBTableFolderRepNode) {
      List<IRepositoryNode> tableNodes=folderNode.getChildren();
      for (      TableIndicator indicator : indicatorTableList) {
        boolean equals=false;
        for (        IRepositoryNode tableNode : tableNodes) {
          MetadataTable table=((MetadataTableRepositoryObject)tableNode.getObject()).getTable();
          String name=table.getName();
          String tableName=indicator.getTableName();
          equals=name.equals(tableName);
          if (equals) {
            OverviewIndUIElement tableUIEle=new OverviewIndUIElement();
            tableUIEle.setNode(tableNode);
            tableUIEle.setOverviewIndicator(indicator);
            try {
              if (DqRepositoryViewService.getColumns(getTdDataProvider(),(ColumnSet)table,true).isEmpty()) {
                tableUIEle.setVirtualNode(true);
              }
            }
 catch (            Exception e) {
              log.error(e,e);
            }
            cataUIEleList.add(tableUIEle);
            break;
          }
        }
        if (!equals) {
          OverviewIndUIElement tableUIEle=new OverviewIndUIElement();
          tableUIEle.setOverviewIndicator(indicator);
          tableUIEle.setVirtualNode(true);
          cataUIEleList.add(tableUIEle);
        }
      }
    }
  }
  return cataUIEleList;
}
Program: 136511
Project: 136511
Buggy source:
public Image getColumnImage(Object element,int columnIndex){
  if (element instanceof ViewIndicator && columnIndex == 0) {
    return CWMImageEnum.View.getImg();
  }
  return null;
}

Fixed version (ground truth):
public Image getColumnImage(Object element,int columnIndex){
  if (element instanceof OverviewIndUIElement && columnIndex == 0) {
    return CWMImageEnum.View.getImg();
  }
  return null;
}
Program: 136512
Project: 136512
Buggy source:
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ViewIndicator) {
    ViewIndicator indicatorUIEle=(ViewIndicator)element;
switch (columnIndex) {
case 0:
      return indicatorUIEle.getTableName();
case 1:
    return PluginConstant.EMPTY_STRING + indicatorUIEle.getRowCount();
default :
  break;
}
}
return PluginConstant.EMPTY_STRING;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  if (element instanceof OverviewIndUIElement) {
    ViewIndicator indicatorUIEle=(ViewIndicator)((OverviewIndUIElement)element).getOverviewIndicator();
switch (columnIndex) {
case 0:
      return indicatorUIEle.getTableName();
case 1:
    return PluginConstant.EMPTY_STRING + indicatorUIEle.getRowCount();
default :
  break;
}
}
return PluginConstant.EMPTY_STRING;
}
Program: 136513
Project: 136513
Buggy source:
public Color getBackground(Object element,int columnIndex){
  if (element instanceof ViewIndicator) {
    ViewIndicator indicator=(ViewIndicator)element;
    if (indicator.getRowCount() == 0) {
      return bg;
    }
  }
  return null;
}

Fixed version (ground truth):
public Color getBackground(Object element,int columnIndex){
  if (element instanceof OverviewIndUIElement) {
    ViewIndicator indicator=(ViewIndicator)((OverviewIndUIElement)element).getOverviewIndicator();
    if (indicator.getRowCount() == 0) {
      return bg;
    }
  }
  return null;
}
Program: 136515
Project: 136515
Buggy source:
/** 
 * return Column or TdXMLElement analysis executor. ADD xqliu bug 10238 2009-12-24
 * @param analysis
 * @param executionEngine
 * @return
 */
private static AnalysisExecutor getModelElementAnalysisExecutor(Analysis analysis,ExecutionLanguage executionEngine){
  boolean isDelimitedFile=ConnectionUtils.isDelimitedFileConnection((DataProvider)analysis.getContext().getConnection());
  boolean sql=ExecutionLanguage.SQL.equals(executionEngine);
  if (isDelimitedFile) {
    return new DelimitedFileAnalysisExecutor();
  }
 else {
    boolean isValid=hasSampleDataValid(analysis);
    if (isValid) {
      return new ColumnAnalysisExecutorWithSampleData();
    }
 else {
      return sql ? new ColumnAnalysisSqlExecutor() : new ColumnAnalysisExecutor();
    }
  }
}

Fixed version (ground truth):
/** 
 * return Column or TdXMLElement analysis executor. ADD xqliu bug 10238 2009-12-24
 * @param analysis
 * @param executionEngine
 * @return
 */
private static AnalysisExecutor getModelElementAnalysisExecutor(Analysis analysis,ExecutionLanguage executionEngine){
  boolean isDelimitedFile=ConnectionUtils.isDelimitedFileConnection((DataProvider)analysis.getContext().getConnection());
  boolean sql=ExecutionLanguage.SQL.equals(executionEngine);
  boolean isValid=hasSampleDataValid(analysis);
  if (isDelimitedFile) {
    if (isValid) {
      return new DelimitedFileAnalysisExecutorWithSampleData();
    }
 else {
      return new DelimitedFileAnalysisExecutor();
    }
  }
 else {
    if (isValid) {
      return new ColumnAnalysisExecutorWithSampleData();
    }
 else {
      return sql ? new ColumnAnalysisSqlExecutor() : new ColumnAnalysisExecutor();
    }
  }
}
Program: 136516
Project: 136516
Buggy source:
public static FileInputDelimited createFileInputDelimited(DelimitedFileConnection delimitedFileconnection) throws IOException {
  String rowSeparator=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  String encoding=JavaSqlFactory.getEncoding(delimitedFileconnection);
  String fieldSeparatorValue=JavaSqlFactory.getFieldSeparatorValue(delimitedFileconnection);
  boolean isSpliteRecord=delimitedFileconnection.isSplitRecord();
  boolean isSkipeEmptyRow=delimitedFileconnection.isRemoveEmptyRow();
  String languageName=LanguageManager.getCurrentLanguage().getName();
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  int footValue=JavaSqlFactory.getFooterValue(delimitedFileconnection);
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  return new FileInputDelimited(ParameterUtil.trimParameter(path),ParameterUtil.trimParameter(encoding),ParameterUtil.trimParameter(StringUtils.loadConvert(fieldSeparatorValue,languageName)),ParameterUtil.trimParameter(StringUtils.loadConvert(rowSeparator,languageName)),isSkipeEmptyRow,headValue,footValue,limitValue,-1,isSpliteRecord);
}

Fixed version (ground truth):
public static FileInputDelimited createFileInputDelimited(DelimitedFileConnection delimitedFileconnection,int limit) throws IOException {
  String rowSeparator=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  String encoding=JavaSqlFactory.getEncoding(delimitedFileconnection);
  String fieldSeparatorValue=JavaSqlFactory.getFieldSeparatorValue(delimitedFileconnection);
  boolean isSpliteRecord=delimitedFileconnection.isSplitRecord();
  boolean isSkipeEmptyRow=delimitedFileconnection.isRemoveEmptyRow();
  String languageName=LanguageManager.getCurrentLanguage().getName();
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  int footValue=JavaSqlFactory.getFooterValue(delimitedFileconnection);
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  return new FileInputDelimited(ParameterUtil.trimParameter(path),ParameterUtil.trimParameter(encoding),ParameterUtil.trimParameter(StringUtils.loadConvert(fieldSeparatorValue,languageName)),ParameterUtil.trimParameter(StringUtils.loadConvert(rowSeparator,languageName)),isSkipeEmptyRow,headValue,footValue,limitValue < limit ? limitValue : limit,-1,isSpliteRecord);
}
Program: 136517
Project: 136517
Buggy source:
/** 
 * DOC talend Comment method "useDelimitedReader".
 * @param file
 * @param delimitedFileconnection2
 * @param analysisElementList
 * @param columnElementList
 * @param indicToRowMap
 * @return
 */
private ReturnCode useDelimitedReader(List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  ReturnCode returnCode=new ReturnCode(true);
  try {
    FileInputDelimited fileInputDelimited=AnalysisExecutorHelper.createFileInputDelimited(delimitedFileconnection);
    long currentRow=JavaSqlFactory.getHeadValue(delimitedFileconnection);
    while (fileInputDelimited.nextRecord()) {
      if (!continueRun()) {
        break;
      }
      currentRow++;
      int columsCount=fileInputDelimited.getColumnsCountOfCurrentRow();
      String[] rowValues=new String[columsCount];
      for (int i=0; i < columsCount; i++) {
        rowValues[i]=fileInputDelimited.get(i);
      }
      returnCode.setOk(returnCode.isOk() && handleByARow(rowValues,currentRow,analysisElementList,columnElementList,indicToRowMap).isOk());
    }
    fileInputDelimited.close();
  }
 catch (  IOException e) {
    log.error(e,e);
  }
  return returnCode;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "useDelimitedReader".
 * @param file
 * @param delimitedFileconnection2
 * @param analysisElementList
 * @param columnElementList
 * @param indicToRowMap
 * @return
 */
private ReturnCode useDelimitedReader(List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  ReturnCode returnCode=new ReturnCode(true);
  try {
    FileInputDelimited fileInputDelimited=createFileInputDelimited();
    long currentRow=JavaSqlFactory.getHeadValue(delimitedFileconnection);
    while (fileInputDelimited.nextRecord()) {
      if (!continueRun()) {
        break;
      }
      currentRow++;
      int columsCount=fileInputDelimited.getColumnsCountOfCurrentRow();
      String[] rowValues=new String[columsCount];
      for (int i=0; i < columsCount; i++) {
        rowValues[i]=fileInputDelimited.get(i);
      }
      returnCode.setOk(returnCode.isOk() && handleByARow(rowValues,currentRow,analysisElementList,columnElementList,indicToRowMap).isOk());
    }
    fileInputDelimited.close();
  }
 catch (  IOException e) {
    log.error(e,e);
  }
  return returnCode;
}
Program: 136518
Project: 136518
Buggy source:
private ReturnCode useCsvReader(File file,List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  ReturnCode returnCode=new ReturnCode(true);
  int limitValue=JavaSqlFactory.getLimitValue(delimitedFileconnection);
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  CSVReader csvReader=null;
  try {
    csvReader=FileUtils.createCsvReader(file,delimitedFileconnection);
    FileUtils.initializeCsvReader(delimitedFileconnection,csvReader);
    for (int i=0; i < headValue && csvReader.readNext(); i++) {
    }
    String[] rowValues=null;
    long currentRecord=0;
    while (csvReader.readNext()) {
      currentRecord++;
      if (!continueRun() || limitValue != -1 && currentRecord > limitValue) {
        break;
      }
      rowValues=csvReader.getValues();
      returnCode.setOk(returnCode.isOk() && handleByARow(rowValues,currentRecord,analysisElementList,columnElementList,indicToRowMap).isOk());
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
 finally {
    if (csvReader != null) {
      try {
        csvReader.close();
      }
 catch (      IOException e) {
        log.error(e,e);
      }
    }
  }
  return returnCode;
}

Fixed version (ground truth):
private ReturnCode useCsvReader(File file,List<ModelElement> analysisElementList,List<MetadataColumn> columnElementList,EMap<Indicator,AnalyzedDataSet> indicToRowMap){
  ReturnCode returnCode=new ReturnCode(true);
  int limitValue=getCsvReaderLimit();
  int headValue=JavaSqlFactory.getHeadValue(delimitedFileconnection);
  CSVReader csvReader=null;
  try {
    csvReader=FileUtils.createCsvReader(file,delimitedFileconnection);
    FileUtils.initializeCsvReader(delimitedFileconnection,csvReader);
    for (int i=0; i < headValue && csvReader.readNext(); i++) {
    }
    String[] rowValues=null;
    long currentRecord=0;
    while (csvReader.readNext()) {
      currentRecord++;
      if (!continueRun() || limitValue != -1 && currentRecord > limitValue) {
        break;
      }
      rowValues=csvReader.getValues();
      returnCode.setOk(returnCode.isOk() && handleByARow(rowValues,currentRecord,analysisElementList,columnElementList,indicToRowMap).isOk());
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
 finally {
    if (csvReader != null) {
      try {
        csvReader.close();
      }
 catch (      IOException e) {
        log.error(e,e);
      }
    }
  }
  return returnCode;
}
Program: 136520
Project: 136520
Buggy source:
private void validateWhithspace(Text field){
  if (field.getText().length() > 0 && PluginConstant.EMPTY_STRING.equals(field.getText().trim())) {
    getManagedForm().getMessageManager().addMessage(WHITESPACE_CHECK_MSG,WHITESPACE_CHECK_MSG,null,IMessageProvider.ERROR,field);
    checkWhitespaceTextFields.add(field);
  }
 else {
    getManagedForm().getMessageManager().removeMessage(WHITESPACE_CHECK_MSG,field);
    checkWhitespaceTextFields.remove(field);
  }
}

Fixed version (ground truth):
private void validateWhithspace(Text field){
  String WHITESPACE_CHECK_MSG=DefaultMessagesImpl.getString("String_Node_Str");
  if (field.getText().length() > 0 && PluginConstant.EMPTY_STRING.equals(field.getText().trim())) {
    getManagedForm().getMessageManager().addMessage(WHITESPACE_CHECK_MSG,WHITESPACE_CHECK_MSG,null,IMessageProvider.ERROR,field);
    checkWhitespaceTextFields.add(field);
  }
 else {
    getManagedForm().getMessageManager().removeMessage(WHITESPACE_CHECK_MSG,field);
    checkWhitespaceTextFields.remove(field);
  }
}