nus-yam/ex-repair huggingface dataset:
Program: 138264
Project: 138264
Buggy source:
@Override public void run(){
  SQLExplorerPlugin default1=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=default1.getAliasManager().getAliases();
  Connection tdDataProvider=ConnectionHelper.getDataProvider(view);
  String url=JavaSqlFactory.getURL(tdDataProvider);
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      String qualifiedName=getTableQualifiedName(tdDataProvider);
      String query="String_Node_Str" + qualifiedName;
      SQLEditorInput input=new SQLEditorInput("String_Node_Str" + SQLExplorerPlugin.getDefault().getEditorSerialNo() + "String_Node_Str");
      input.setUser(alias.getDefaultUser());
      try {
        IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
        SQLEditor editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
        editorPart.setText(query);
        ExecSQLAction execSQLAction=new ExecSQLAction(editorPart);
        execSQLAction.run();
      }
 catch (      PartInitException e) {
        log.error(e,e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  SQLExplorerPlugin default1=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=default1.getAliasManager().getAliases();
  Connection tdDataProvider=ConnectionHelper.getDataProvider(view);
  String url=JavaSqlFactory.getURL(tdDataProvider);
  String qualifiedName=getTableQualifiedName(tdDataProvider);
  String query="String_Node_Str" + qualifiedName;
  String connectionName=tdDataProvider.getName();
  User defaultUser=null;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      defaultUser=alias.getDefaultUser();
    }
  }
  if (null == defaultUser) {
    return;
  }
  SQLEditorInput input=new SQLEditorInput("String_Node_Str" + connectionName + "String_Node_Str"+ qualifiedName+ "String_Node_Str");
  input.setUser(defaultUser);
  try {
    IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
    SQLEditor editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
    editorPart.setText(query);
    ExecSQLAction execSQLAction=new ExecSQLAction(editorPart);
    execSQLAction.run();
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}
Program: 138265
Project: 138265
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
  if (PluginConstant.ISDIRTY_PROPERTY.equals(evt.getPropertyName())) {
    currentEditor.firePropertyChange(IEditorPart.PROP_DIRTY);
    currentEditor.setRefreshResultPage(true);
  }
 else   if (PluginConstant.DATAFILTER_PROPERTY.equals(evt.getPropertyName())) {
    this.analysisHandler.setStringDataFilter((String)evt.getNewValue());
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent evt){
  if (PluginConstant.ISDIRTY_PROPERTY.equals(evt.getPropertyName())) {
    currentEditor.firePropertyChange(IEditorPart.PROP_DIRTY);
    currentEditor.setRefreshResultPage(true);
  }
 else   if (PluginConstant.DATAFILTER_PROPERTY.equals(evt.getPropertyName())) {
    this.analysisHandler.setStringDataFilter((String)evt.getNewValue());
  }
 else   if (PluginConstant.EXPAND_TREE.equals(evt.getPropertyName())) {
    ModelElementIndicator indicator=(ModelElementIndicator)((Widget)evt.getNewValue()).getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
    expandChart(indicator);
  }
}
Program: 138266
Project: 138266
Buggy source:
public void createPreviewCharts(final ScrolledForm form,final Composite composite,final boolean isCreate){
  previewChartList=new ArrayList<ExpandableComposite>();
  final ModelElementIndicator[] modelElementIndicatores=treeViewer.getModelElementIndicator();
  UIPagination uiPagination=new UIPagination(toolkit,composite);
  int pageSize=IndicatorPaginationInfo.getPageSize();
  int totalPages=modelElementIndicatores.length / pageSize;
  List<ModelElementIndicator> modelElementIndicators=null;
  for (int index=0; index < totalPages; index++) {
    modelElementIndicators=new ArrayList<ModelElementIndicator>();
    for (int idx=0; idx < pageSize; idx++) {
      modelElementIndicators.add(modelElementIndicatores[index * pageSize + idx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicators,uiPagination);
    uiPagination.addPage(pginfo);
  }
  int left=modelElementIndicatores.length % pageSize;
  if (left != 0) {
    modelElementIndicators=new ArrayList<ModelElementIndicator>();
    for (int leftIdx=0; leftIdx < left; leftIdx++) {
      modelElementIndicators.add(modelElementIndicatores[totalPages * pageSize + leftIdx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicators,uiPagination);
    uiPagination.addPage(pginfo);
    totalPages++;
  }
  uiPagination.init();
  for (  ExpandableComposite comp : previewChartList) {
    registerSection(comp);
  }
  composite.layout();
  composite.pack();
  form.reflow(true);
}

Fixed version (ground truth):
public void createPreviewCharts(final ScrolledForm form,final Composite composite,final boolean isCreate){
  previewChartList=new ArrayList<ExpandableComposite>();
  final ModelElementIndicator[] modelElementIndicatores=treeViewer.getModelElementIndicator();
  uiPagination=new UIPagination(toolkit,composite);
  int pageSize=IndicatorPaginationInfo.getPageSize();
  int totalPages=modelElementIndicatores.length / pageSize;
  List<ModelElementIndicator> modelElementIndicators=null;
  for (int index=0; index < totalPages; index++) {
    modelElementIndicators=new ArrayList<ModelElementIndicator>();
    for (int idx=0; idx < pageSize; idx++) {
      modelElementIndicators.add(modelElementIndicatores[index * pageSize + idx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicators,uiPagination);
    uiPagination.addPage(pginfo);
  }
  int left=modelElementIndicatores.length % pageSize;
  if (left != 0) {
    modelElementIndicators=new ArrayList<ModelElementIndicator>();
    for (int leftIdx=0; leftIdx < left; leftIdx++) {
      modelElementIndicators.add(modelElementIndicatores[totalPages * pageSize + leftIdx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicators,uiPagination);
    uiPagination.addPage(pginfo);
    totalPages++;
  }
  uiPagination.init();
  for (  ExpandableComposite comp : previewChartList) {
    registerSection(comp);
  }
  composite.layout();
  composite.pack();
  form.reflow(true);
}
Program: 138268
Project: 138268
Buggy source:
@Override public void treeExpanded(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
    theSuitedComposite.setExpanded(true);
  }
  comp.layout();
  form.reflow(true);
}

Fixed version (ground truth):
@Override public void treeExpanded(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
    theSuitedComposite.setExpanded(true);
  }
 else {
    propertyChangeSupport.firePropertyChange(PluginConstant.EXPAND_TREE,null,e.item);
  }
  comp.layout();
  form.reflow(true);
}
Program: 138269
Project: 138269
Buggy source:
private Section createTableSectionPart(Composite parentComp,String title,ColumnSetMultiValueIndicator columnSetMultiIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  List<String> tableColumnNames=columnSetMultiIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=columnSetMultiIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  setupTableGridDataLimitedSize(table,tableRows.size());
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  columnSetElementSection.setExpanded(false);
  return columnSetElementSection;
}

Fixed version (ground truth):
private Section createTableSectionPart(Composite parentComp,String title,ColumnSetMultiValueIndicator columnSetMultiIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  List<String> tableColumnNames=columnSetMultiIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=columnSetMultiIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  setupTableGridDataLimitedSize(table,tableRows != null ? tableRows.size() : 0);
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  columnSetElementSection.setExpanded(false);
  return columnSetElementSection;
}
Program: 138272
Project: 138272
Buggy source:
public void run(){
  tree.getColumn(0).setWidth(tree.getColumn(0).getWidth() + 1);
  tree.getColumn(0).setWidth(tree.getColumn(0).getWidth() - 1);
}

Fixed version (ground truth):
public void run(){
  tree.getColumn(0).setWidth(tree.getColumn(0).getWidth() - 1);
}
Program: 138273
Project: 138273
Buggy source:
@Override public void run(){
  ISelection selection=this.getSelection();
  boolean onlyDeleteReportFile=true;
  for (  Object obj : ((IStructuredSelection)selection).toArray()) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      if (node instanceof ReportFileRepNode) {
        deleteReportFile((ReportFileRepNode)node);
        continue;
      }
      onlyDeleteReportFile=false;
      boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(node);
      if (!isStateDeleted) {
        closeEditors(selection);
        excuteSuperRun(null);
        break;
      }
      boolean hasDependency=false;
      if (node.getType() == ENodeType.SIMPLE_FOLDER) {
        List<IRepositoryNode> newLs=RepositoryNodeHelper.getRepositoryElementFromFolder(node,true);
        for (        IRepositoryNode subNode : newLs) {
          hasDependency=RepositoryNodeHelper.hasDependencyClients(subNode);
          if (!hasDependency || hasDependency && handleDependencies(subNode)) {
            excuteSuperRun((RepositoryNode)subNode);
          }
        }
        excuteSuperRun(node);
      }
 else {
        hasDependency=RepositoryNodeHelper.hasDependencyClients(node);
        if (!hasDependency || hasDependency && handleDependencies(node)) {
          excuteSuperRun((RepositoryNode)node);
        }
      }
    }
  }
  if (!onlyDeleteReportFile) {
    CorePlugin.getDefault().refreshWorkSpace();
    CorePlugin.getDefault().refreshDQView();
  }
}

Fixed version (ground truth):
@Override public void run(){
  ISelection selection=this.getSelection();
  boolean onlyDeleteReportFile=true;
  for (  Object obj : ((IStructuredSelection)selection).toArray()) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      if (node instanceof ReportFileRepNode) {
        deleteReportFile((ReportFileRepNode)node);
        continue;
      }
      onlyDeleteReportFile=false;
      boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(node);
      if (!isStateDeleted) {
        closeEditors(selection);
        excuteSuperRun(null);
        break;
      }
      boolean hasDependency=false;
      if (node.getType() == ENodeType.SIMPLE_FOLDER || node.getType() == ENodeType.SYSTEM_FOLDER) {
        List<IRepositoryNode> newLs=RepositoryNodeHelper.getRepositoryElementFromFolder(node,true);
        for (        IRepositoryNode subNode : newLs) {
          hasDependency=RepositoryNodeHelper.hasDependencyClients(subNode);
          if (!hasDependency || hasDependency && handleDependencies(subNode)) {
            excuteSuperRun((RepositoryNode)subNode);
          }
        }
        excuteSuperRun(node);
      }
 else {
        hasDependency=RepositoryNodeHelper.hasDependencyClients(node);
        if (!hasDependency || hasDependency && handleDependencies(node)) {
          excuteSuperRun((RepositoryNode)node);
        }
      }
    }
  }
  if (!onlyDeleteReportFile) {
    CorePlugin.getDefault().refreshWorkSpace();
    CorePlugin.getDefault().refreshDQView();
  }
}
Program: 138274
Project: 138274
Buggy source:
@Override protected boolean doExecute() throws Exception {
  newFileList=new ArrayList<File>();
  replaceMap=new HashMap<String,String>();
  ArrayList<File> fileList=getNeedUpdateFiles();
  for (  File file : fileList) {
    createNewItemFile(file);
    deleteOldItemFile(file);
  }
  addConnectionFileToUpdate();
  updateFile();
  return true;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  newFileList=new ArrayList<File>();
  replaceMap=new HashMap<String,String>();
  ArrayList<File> fileList=getNeedUpdateFiles();
  for (  File file : fileList) {
    createNewItemFile(file);
    deleteOldItemFile(file);
  }
  updateConnectionFile();
  updateFile();
  return true;
}
Program: 138276
Project: 138276
Buggy source:
/** 
 * DOC xqliu Comment method "getPath".
 * @param element
 * @param itemPath
 * @return
 */
private IPath getPath(ModelElement element,IPath itemPath){
  IPath path=new Path(PluginConstant.EMPTY_STRING);
  if (element instanceof DatabaseConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getTDQConnectionFolder().getFullPath());
  }
 else   if (element instanceof MDMConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
  }
 else   if (element instanceof Analysis) {
    path=itemPath.makeRelativeTo(ResourceManager.getAnalysisFolder().getFullPath());
  }
 else   if (element instanceof Report) {
    path=itemPath.makeRelativeTo(ResourceManager.getReportsFolder().getFullPath());
  }
 else   if (element instanceof IndicatorDefinition) {
    if (element instanceof WhereRule) {
      path=itemPath.makeRelativeTo(ResourceManager.getRulesSQLFolder().getFullPath());
    }
 else {
      path=itemPath.makeRelativeTo(ResourceManager.getIndicatorFolder().getFullPath());
    }
  }
 else   if (element instanceof Pattern) {
    path=itemPath.makeRelativeTo(ResourceManager.getPatternFolder().getFullPath());
  }
  return path;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getPath".
 * @param element
 * @param itemPath
 * @return
 */
private IPath getPath(ModelElement element,IPath itemPath){
  IPath path=new Path(PluginConstant.EMPTY_STRING);
  if (element instanceof DatabaseConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getTDQConnectionFolder().getFullPath());
  }
 else   if (element instanceof MDMConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
  }
 else   if (element instanceof Analysis) {
    path=itemPath.makeRelativeTo(ResourceManager.getAnalysisFolder().getFullPath());
  }
 else   if (element instanceof Report) {
    path=itemPath.makeRelativeTo(ResourceManager.getReportsFolder().getFullPath());
  }
 else   if (element instanceof IndicatorDefinition) {
    if (element instanceof WhereRule) {
      path=itemPath.makeRelativeTo(ResourceManager.getRulesFolder().getFullPath());
    }
 else {
      path=itemPath.makeRelativeTo(ResourceManager.getIndicatorFolder().getFullPath());
    }
  }
 else   if (element instanceof Pattern) {
    path=itemPath.makeRelativeTo(ResourceManager.getPatternFolder().getFullPath());
  }
  return path;
}
Program: 138277
Project: 138277
Buggy source:
/** 
 * DOC bZhou Comment method "checkConflict".
 * @param record
 */
private void checkConflict(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    try {
      RepositoryNode node=RepositoryNodeHelper.recursiveFind(property);
      if (node != null) {
        record.setConflictNode(node);
        record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
      }
    }
 catch (    Exception e) {
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkConflict".
 * @param record
 */
private void checkConflict(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    try {
      List<IRepositoryViewObject> allObjects=DqRepositoryViewService.getAllRepositoryResourceObjects(true);
      for (      IRepositoryViewObject object : allObjects) {
        if (record.getProperty() != null && record.getProperty().getId().equals(object.getProperty().getId())) {
          record.setConflictObject(object);
          record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
          break;
        }
      }
    }
 catch (    Exception e) {
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
    }
  }
}
Program: 138278
Project: 138278
Buggy source:
@Override protected void run(){
  try {
    for (    ItemRecord record : fRecords) {
      if (fMonitor.isCanceled()) {
        break;
      }
      Map<IPath,IPath> toImportMap=mapping(record);
      fMonitor.subTask("String_Node_Str" + record.getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        IRepositoryNode conflictNode=record.getConflictNode();
        if (conflictNode != null) {
          IRepositoryViewObject object=conflictNode.getObject();
          ProxyRepositoryFactory.getInstance().deleteObjectPhysical(object);
        }
        for (        IPath resPath : toImportMap.keySet()) {
          IPath desPath=toImportMap.get(resPath);
          ResourceSet resourceSet=ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;
synchronized (resourceSet) {
            write(resPath,desPath);
          }
        }
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      fMonitor.worked(1);
    }
    finish(fRecords,fMonitor);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override protected void run(){
  try {
    for (    ItemRecord record : fRecords) {
      if (fMonitor.isCanceled()) {
        break;
      }
      Map<IPath,IPath> toImportMap=mapping(record);
      fMonitor.subTask("String_Node_Str" + record.getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        IRepositoryViewObject object=record.getConflictObject();
        if (object != null) {
          ProxyRepositoryFactory.getInstance().deleteObjectPhysical(object);
        }
        for (        IPath resPath : toImportMap.keySet()) {
          IPath desPath=toImportMap.get(resPath);
          ResourceSet resourceSet=ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;
synchronized (resourceSet) {
            write(resPath,desPath);
          }
        }
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      fMonitor.worked(1);
    }
    finish(fRecords,fMonitor);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 138280
Project: 138280
Buggy source:
/** 
 * DOC mzhao Comment method "setAnalysisFilterDateFrom".
 * @param report
 * @param dateText
 * @return
 * @return
 * @throws ParseException
 */
public static void setAnalysisFilterDateTo(TdReport report,String dateText){
  if (dateText == null || dateText.trim().equals("String_Node_Str")) {
    return;
  }
  try {
    report.setDateTo(DateUtils.parse(DateUtils.PATTERN_1,dateText));
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * DOC mzhao Comment method "setAnalysisFilterDateFrom".
 * @param report
 * @param dateText
 * @return
 * @return
 * @throws ParseException
 */
public static void setAnalysisFilterDateTo(TdReport report,String dateText){
  if (dateText == null || dateText.trim().equals("String_Node_Str")) {
    report.setDateTo(null);
    return;
  }
  try {
    report.setDateTo(DateUtils.parse(DateUtils.PATTERN_1,dateText));
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
}
Program: 138281
Project: 138281
Buggy source:
/** 
 * DOC mzhao Set analysis filter date from.
 * @param report
 * @param dateText
 * @return
 * @throws ParseException
 */
public static void setAnalysisFilterDateFrom(TdReport report,String dateText){
  if (dateText == null || dateText.trim().equals("String_Node_Str")) {
    return;
  }
  try {
    report.setDateFrom(DateUtils.parse(DateUtils.PATTERN_1,dateText));
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * DOC mzhao Set analysis filter date from.
 * @param report
 * @param dateText
 * @return
 * @throws ParseException
 */
public static void setAnalysisFilterDateFrom(TdReport report,String dateText){
  if (dateText == null || dateText.trim().equals("String_Node_Str")) {
    report.setDateFrom(null);
    return;
  }
  try {
    report.setDateFrom(DateUtils.parse(DateUtils.PATTERN_1,dateText));
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
}
Program: 138282
Project: 138282
Buggy source:
protected void saveReloadResult(){
  ElementWriterFactory.getInstance().createDataProviderWriter().save(oldDataProvider);
}

Fixed version (ground truth):
protected void saveReloadResult(){
  ElementWriterFactory.getInstance().createDataProviderWriter().save(oldDataProvider,true);
}
Program: 138284
Project: 138284
Buggy source:
@Override protected Connection findDataProvider(){
  Assert.isTrue(selectedObj instanceof IRepositoryViewObject,this.selectedObj + "String_Node_Str");
  Connection returnValue=null;
  ModelElement modelElement=PropertyHelper.retrieveElement(((IRepositoryViewObject)selectedObj).getProperty().getItem());
  if (modelElement instanceof Connection) {
    returnValue=(Connection)modelElement;
  }
  return returnValue;
}

Fixed version (ground truth):
@Override protected Connection findDataProvider(){
  Assert.isTrue(selectedObj instanceof IRepositoryViewObject,this.selectedObj + "String_Node_Str");
  Connection returnValue=null;
  ModelElement modelElement=PropertyHelper.getModelElement(((IRepositoryViewObject)selectedObj).getProperty());
  if (modelElement instanceof Connection) {
    returnValue=(Connection)modelElement;
  }
  return returnValue;
}
Program: 138285
Project: 138285
Buggy source:
@Override protected boolean isValid(){
  ModelElement modelElement=PropertyHelper.retrieveElement(((IRepositoryViewObject)selectedObj).getProperty().getItem());
  return modelElement instanceof Connection;
}

Fixed version (ground truth):
@Override protected boolean isValid(){
  ModelElement modelElement=PropertyHelper.getModelElement(((IRepositoryViewObject)selectedObj).getProperty());
  return modelElement instanceof Connection;
}
Program: 138286
Project: 138286
Buggy source:
/** 
 * DOC bZhou Comment method "getProperty".
 * @param element
 * @return property or null
 */
public static Property getProperty(ModelElement element){
  if (element != null && element.eIsProxy()) {
    element=(ModelElement)EObjectHelper.resolveObject(element);
  }
  URI uri=element.eResource() == null ? null : element.eResource().getURI();
  if (uri != null) {
    if (uri.isPlatform()) {
      IFile propertyFile=PropertyHelper.getPropertyFile(element);
      return getProperty(propertyFile);
    }
 else {
      File file=new Path(uri.toFileString()).removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION).toFile();
      return getProperty(file);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getProperty".
 * @param element
 * @return property or null
 */
public static Property getProperty(ModelElement element){
  URI uri=element.eResource() == null ? null : element.eResource().getURI();
  if (uri != null) {
    if (uri.isPlatform()) {
      IFile propertyFile=PropertyHelper.getPropertyFile(element);
      return getProperty(propertyFile);
    }
 else {
      File file=new Path(uri.toFileString()).removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION).toFile();
      return getProperty(file);
    }
  }
  return null;
}
Program: 138287
Project: 138287
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof DBConnectionRepNode) {
    DBConnectionRepNode node=(DBConnectionRepNode)element;
    Integer selectIndex=metadataFormPage.getConnCombo().getSelectionIndex();
    Integer connectionIndex=null;
    ModelElement modelelement=PropertyHelper.retrieveElement((node.getObject()).getProperty().getItem());
    Object value=metadataFormPage.getConnCombo().getData(modelelement == null ? "String_Node_Str" : modelelement.getName());
    if (value != null && value instanceof Integer) {
      connectionIndex=(Integer)value;
    }
    return (connectionIndex != null && selectIndex.intValue() == connectionIndex.intValue());
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof DBConnectionRepNode) {
    DBConnectionRepNode node=(DBConnectionRepNode)element;
    Integer selectIndex=metadataFormPage.getConnCombo().getSelectionIndex();
    Integer connectionIndex=null;
    ModelElement modelelement=PropertyHelper.getModelElement((node.getObject()).getProperty());
    Object value=metadataFormPage.getConnCombo().getData(modelelement == null ? "String_Node_Str" : modelelement.getName());
    if (value != null && value instanceof Integer) {
      connectionIndex=(Integer)value;
    }
    return (connectionIndex != null && selectIndex.intValue() == connectionIndex.intValue());
  }
  return true;
}
Program: 138288
Project: 138288
Buggy source:
/** 
 * DOC mzhao 2009-05-05 bug: 6587, Add connection metadata filter.
 */
private void addConnFilterListener(){
  AbstractViewerFilter connFiler=new AbstractViewerFilter(){
    @Override public int getId(){
      return 0;
    }
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof DBConnectionRepNode) {
        DBConnectionRepNode node=(DBConnectionRepNode)element;
        Integer selectIndex=metadataFormPage.getConnCombo().getSelectionIndex();
        Integer connectionIndex=null;
        ModelElement modelelement=PropertyHelper.retrieveElement((node.getObject()).getProperty().getItem());
        Object value=metadataFormPage.getConnCombo().getData(modelelement == null ? "String_Node_Str" : modelelement.getName());
        if (value != null && value instanceof Integer) {
          connectionIndex=(Integer)value;
        }
        return (connectionIndex != null && selectIndex.intValue() == connectionIndex.intValue());
      }
      return true;
    }
  }
;
  addFilter(connFiler);
}

Fixed version (ground truth):
/** 
 * DOC mzhao 2009-05-05 bug: 6587, Add connection metadata filter.
 */
private void addConnFilterListener(){
  AbstractViewerFilter connFiler=new AbstractViewerFilter(){
    @Override public int getId(){
      return 0;
    }
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof DBConnectionRepNode) {
        DBConnectionRepNode node=(DBConnectionRepNode)element;
        Integer selectIndex=metadataFormPage.getConnCombo().getSelectionIndex();
        Integer connectionIndex=null;
        ModelElement modelelement=PropertyHelper.getModelElement((node.getObject()).getProperty());
        Object value=metadataFormPage.getConnCombo().getData(modelelement == null ? "String_Node_Str" : modelelement.getName());
        if (value != null && value instanceof Integer) {
          connectionIndex=(Integer)value;
        }
        return (connectionIndex != null && selectIndex.intValue() == connectionIndex.intValue());
      }
      return true;
    }
  }
;
  addFilter(connFiler);
}
Program: 138289
Project: 138289
Buggy source:
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  List<String> dErrors=new ArrayList<String>();
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  dErrors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyMap().keySet()) {
      ModelElement element=record.getDependencyMap().get(depFile);
      ItemRecord findRecord=ItemRecord.findRecord(depFile);
      if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
        dErrors.add("String_Node_Str" + record.getName() + "String_Node_Str"+ element.getName());
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * check that directory exist and issue an error message if not. <br> check that the folder is a data quality repository or issue an error.<br> check that anything is check in the tree or issue an error.<br>
 */
private void checkforErrors(){
  List<String> dErrors=new ArrayList<String>();
  if (repositoryTree.getTree().getItems().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  if (repositoryTree.getCheckedElements().length == 0) {
    dErrors.add(Messages.getString("String_Node_Str"));
  }
  dErrors.addAll(writer.check());
  ItemRecord[] elements=getElements();
  for (  ItemRecord record : elements) {
    for (    File depFile : record.getDependencyMap().keySet()) {
      ModelElement element=record.getDependencyMap().get(depFile);
      ItemRecord findRecord=ItemRecord.findRecord(depFile);
      String dptLabel=element != null ? element.getName() : depFile.getName();
      if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
        dErrors.add("String_Node_Str" + record.getName() + "String_Node_Str"+ dptLabel);
      }
    }
  }
  if (!dErrors.isEmpty()) {
    setErrorMessage(dErrors.get(0));
  }
 else {
    setErrorMessage(null);
  }
  updatePageStatus();
}
Program: 138291
Project: 138291
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    record.getErrors().clear();
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
      checkConflict(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    record.getErrors().clear();
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138292
Project: 138292
Buggy source:
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    if (itemPath != null) {
      IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
      if (itemFile.exists()) {
        record.addError("String_Node_Str" + record.getName() + "String_Node_Str"+ itemFile.getFullPath().toString());
      }
    }
 else {
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    if (itemPath != null) {
      IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
      if (itemFile.exists()) {
        record.addError("String_Node_Str" + record.getName() + "String_Node_Str"+ itemFile.getFullPath().toString());
      }
 else {
        checkConflict(record);
      }
    }
 else {
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str");
    }
  }
}
Program: 138293
Project: 138293
Buggy source:
/** 
 * DOC bZhou Comment method "changePerspective".
 * @param perspectiveID
 */
public static void changePerspective(String perspectiveID){
  IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  try {
    PlatformUI.getWorkbench().showPerspective(perspectiveID,activeWindow);
  }
 catch (  WorkbenchException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "changePerspective".
 * @param perspectiveID
 */
public static void changePerspective(final String perspectiveID){
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      try {
        PlatformUI.getWorkbench().showPerspective(perspectiveID,activeWindow);
      }
 catch (      WorkbenchException e) {
        log.error(e.getMessage(),e);
      }
    }
  }
);
}
Program: 138294
Project: 138294
Buggy source:
public static void autoChange2DataProfilerPerspective(){
  if (!AUTO_CHANGE2DATA_PROFILER) {
    return;
  }
  try {
    IPerspectiveDescriptor perspective=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getPerspective();
    if (!PluginConstant.PERSPECTIVE_ID.equals(perspective.getId())) {
      int autoChange=ResourcesPlugin.getPlugin().getPluginPreferences().getInt(PluginConstant.AUTO_CHANGE2DATA_PROFILER);
switch (autoChange) {
case AUTO_CHANGE2DATA_PROFILER_TRUE:
        Thread.sleep(SLEEP_TIME_MILLIS);
      changePerspective(PluginConstant.PERSPECTIVE_ID);
    break;
case AUTO_CHANGE2DATA_PROFILER_FALSE:
  break;
default :
if (MessageUI.openYesNoQuestion(DefaultMessagesImpl.getString("String_Node_Str"))) {
  ResourcesPlugin.getPlugin().getPluginPreferences().setValue(PluginConstant.AUTO_CHANGE2DATA_PROFILER,AUTO_CHANGE2DATA_PROFILER_TRUE);
  Thread.sleep(SLEEP_TIME_MILLIS);
  changePerspective(PluginConstant.PERSPECTIVE_ID);
}
 else {
  ResourcesPlugin.getPlugin().getPluginPreferences().setValue(PluginConstant.AUTO_CHANGE2DATA_PROFILER,AUTO_CHANGE2DATA_PROFILER_FALSE);
}
}
}
}
 catch (Throwable t) {
log.warn(t,t);
}
}

Fixed version (ground truth):
public static void autoChange2DataProfilerPerspective(){
  if (!AUTO_CHANGE2DATA_PROFILER) {
    return;
  }
  try {
    IPerspectiveDescriptor perspective=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getPerspective();
    if (!PluginConstant.PERSPECTIVE_ID.equals(perspective.getId())) {
      int autoChange=ResourcesPlugin.getPlugin().getPluginPreferences().getInt(PluginConstant.AUTO_CHANGE2DATA_PROFILER);
switch (autoChange) {
case AUTO_CHANGE2DATA_PROFILER_TRUE:
        changePerspective(PluginConstant.PERSPECTIVE_ID);
      break;
case AUTO_CHANGE2DATA_PROFILER_FALSE:
    break;
default :
  if (MessageUI.openYesNoQuestion(DefaultMessagesImpl.getString("String_Node_Str"))) {
    ResourcesPlugin.getPlugin().getPluginPreferences().setValue(PluginConstant.AUTO_CHANGE2DATA_PROFILER,AUTO_CHANGE2DATA_PROFILER_TRUE);
    changePerspective(PluginConstant.PERSPECTIVE_ID);
  }
 else {
    ResourcesPlugin.getPlugin().getPluginPreferences().setValue(PluginConstant.AUTO_CHANGE2DATA_PROFILER,AUTO_CHANGE2DATA_PROFILER_FALSE);
  }
}
}
}
 catch (Throwable t) {
log.warn(t,t);
}
}
Program: 138295
Project: 138295
Buggy source:
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  if (catalogName != null) {
    changeCatalog(catalogName,connection);
  }
  Statement statement=connection.createStatement();
  if (log.isInfoEnabled()) {
    log.info(Messages.getString("String_Node_Str",queryStmt));
  }
  if (continueRun()) {
    statement.execute(queryStmt);
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess=Messages.getString("String_Node_Str") + queryStmt;
    log.warn(mess);
    return null;
  }
  ResultSetMetaData metaData=resultSet.getMetaData();
  int columnCount=metaData.getColumnCount();
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  while (resultSet.next()) {
    Object[] result=new Object[columnCount];
    for (int i=0; i < columnCount; i++) {
      result[i]=resultSet.getObject(i + 1);
    }
    myResultSet.add(result);
  }
  resultSet.close();
  statement.close();
  return myResultSet;
}

Fixed version (ground truth):
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  if (catalogName != null) {
    changeCatalog(catalogName,connection);
  }
  Statement statement=connection.createStatement();
  if (log.isInfoEnabled()) {
    log.info(Messages.getString("String_Node_Str",queryStmt));
  }
  if (continueRun()) {
    statement.execute(queryStmt);
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess=Messages.getString("String_Node_Str") + queryStmt;
    log.warn(mess);
    return null;
  }
  ResultSetMetaData metaData=resultSet.getMetaData();
  int columnCount=metaData.getColumnCount();
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  while (resultSet.next()) {
    Object[] result=new Object[columnCount];
    for (int i=0; i < columnCount; i++) {
      result[i]=resultSet.getObject(i + 1);
    }
    myResultSet.add(result);
  }
  resultSet.close();
  statement.close();
  connection.close();
  return myResultSet;
}
Program: 138296
Project: 138296
Buggy source:
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  if (catalogName != null) {
    changeCatalog(catalogName,connection);
  }
  Statement statement=connection.createStatement();
  if (log.isInfoEnabled()) {
    log.info(Messages.getString("String_Node_Str",queryStmt));
  }
  if (continueRun()) {
    statement.execute(queryStmt);
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess=Messages.getString("String_Node_Str") + queryStmt;
    log.warn(mess);
    return null;
  }
  ResultSetMetaData metaData=resultSet.getMetaData();
  int columnCount=metaData.getColumnCount();
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  while (resultSet.next()) {
    Object[] result=new Object[columnCount];
    for (int i=0; i < columnCount; i++) {
      result[i]=resultSet.getObject(i + 1);
    }
    myResultSet.add(result);
  }
  resultSet.close();
  statement.close();
  connection.close();
  return myResultSet;
}

Fixed version (ground truth):
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  if (catalogName != null) {
    changeCatalog(catalogName,connection);
  }
  Statement statement=connection.createStatement();
  if (log.isInfoEnabled()) {
    log.info(Messages.getString("String_Node_Str",queryStmt));
  }
  if (continueRun()) {
    statement.execute(queryStmt);
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess=Messages.getString("String_Node_Str") + queryStmt;
    log.warn(mess);
    return null;
  }
  ResultSetMetaData metaData=resultSet.getMetaData();
  int columnCount=metaData.getColumnCount();
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  while (resultSet.next()) {
    Object[] result=new Object[columnCount];
    for (int i=0; i < columnCount; i++) {
      result[i]=resultSet.getObject(i + 1);
    }
    myResultSet.add(result);
  }
  resultSet.close();
  statement.close();
  return myResultSet;
}
Program: 138297
Project: 138297
Buggy source:
public void run(){
  try {
    if (indicator instanceof CompositeIndicator) {
      return;
    }
synchronized (schemata) {
      String catalogName=getCatalogOrSchemaName(indicator.getAnalyzedElement());
      if (catalogName != null) {
        changeCatalog(catalogName,connection);
      }
    }
    Expression query=dbms().getInstantiatedExpression(indicator);
    if (query == null || !executeQuery(indicator,connection,query.getBody())) {
      ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
    }
 else {
      indicator.setComputed(true);
    }
synchronized (elementToIndicator) {
      MultiMapHelper.addUniqueObjectToListMap(indicator.getAnalyzedElement(),indicator,elementToIndicator);
    }
  }
 catch (  SQLException e) {
    this.setException(e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (indicator instanceof CompositeIndicator) {
      return;
    }
synchronized (schemata) {
      String catalogName=getCatalogOrSchemaName(indicator.getAnalyzedElement());
      if (catalogName != null) {
        changeCatalog(catalogName,connection);
      }
    }
    Expression query=dbms().getInstantiatedExpression(indicator);
    if (query == null || !executeQuery(indicator,connection,query.getBody())) {
      ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
    }
 else {
      indicator.setComputed(true);
    }
synchronized (elementToIndicator) {
      MultiMapHelper.addUniqueObjectToListMap(indicator.getAnalyzedElement(),indicator,elementToIndicator);
    }
  }
 catch (  SQLException e) {
    this.setException(e);
  }
 finally {
    try {
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      this.setException(e);
    }
  }
}
Program: 138298
Project: 138298
Buggy source:
public static void export(File exportFile,IFolder folder,IndicatorDefinition... indicatorDefinitions){
  if (exportFile.isDirectory()) {
    for (    IndicatorDefinition id : indicatorDefinitions) {
      File file=new File(exportFile,id.getName() + "String_Node_Str");
      export(file,folder,id);
    }
  }
  String fileExtName=getFileExtName(exportFile);
  if ("String_Node_Str".equalsIgnoreCase(fileExtName)) {
    try {
      CsvWriter out=new CsvWriter(new FileOutputStream(exportFile),CURRENT_SEPARATOR,Charset.defaultCharset());
      out.setEscapeMode(ESCAPE_MODE_BACKSLASH);
      out.setTextQualifier(TEXT_QUAL);
      out.setForceQualifier(USE_TEXT_QUAL);
      PatternToExcelEnum[] values=PatternToExcelEnum.values();
      String[] temp=new String[values.length];
      for (int i=0; i < indicatorDefinitions.length + 1; i++) {
        for (int j=0; j < values.length; j++) {
          if (i == 0) {
            temp[j]=values[j].getLiteral();
          }
 else {
            temp[j]=getRelatedValueFromIndicatorDefinition(indicatorDefinitions[i - 1],folder).get(values[j]);
          }
        }
        out.writeRecord(temp);
      }
      out.flush();
      out.close();
    }
 catch (    FileNotFoundException fe) {
      MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    }
catch (    Exception e) {
      log.error(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public static void export(File exportFile,IFolder folder,IndicatorDefinition... indicatorDefinitions){
  if (exportFile.isDirectory()) {
    for (    IndicatorDefinition id : indicatorDefinitions) {
      File file=new File(exportFile,id.getName() + "String_Node_Str");
      export(file,folder,id);
    }
  }
  String fileExtName=getFileExtName(exportFile);
  if ("String_Node_Str".equalsIgnoreCase(fileExtName)) {
    try {
      CsvWriter out=new CsvWriter(new FileOutputStream(exportFile),CURRENT_SEPARATOR,Charset.defaultCharset());
      out.setEscapeMode(CsvWriter.ESCAPE_MODE_DOUBLED);
      out.setTextQualifier(TEXT_QUAL);
      out.setForceQualifier(USE_TEXT_QUAL);
      PatternToExcelEnum[] values=PatternToExcelEnum.values();
      String[] temp=new String[values.length];
      for (int i=0; i < indicatorDefinitions.length + 1; i++) {
        for (int j=0; j < values.length; j++) {
          if (i == 0) {
            temp[j]=values[j].getLiteral();
          }
 else {
            temp[j]=getRelatedValueFromIndicatorDefinition(indicatorDefinitions[i - 1],folder).get(values[j]);
          }
        }
        out.writeRecord(temp);
      }
      out.flush();
      out.close();
    }
 catch (    FileNotFoundException fe) {
      MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    }
catch (    Exception e) {
      log.error(e.getMessage());
    }
  }
}