nus-yam/ex-repair huggingface dataset:
Program: 139102
Project: 139102
Buggy source:
@Override public boolean performFinish(){
  File[] files=exportPage.getElements();
  final String destPath=exportPage.getFilePath();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,destPath);
            writer.write();
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  final String destPath=exportPage.getFilePath();
  final ItemRecord[] records=exportPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record,destPath);
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139103
Project: 139103
Buggy source:
/** 
 * DOC bZhou Comment method "computInput".
 * @return
 */
private Object computInput(){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  return specifiedPath == null ? workspace.getRoot().getLocation().toFile() : workspace.getRoot().getFolder(new Path(specifiedPath)).getLocation().toFile();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computInput".
 * @return
 */
private Object computInput(){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  return specifiedPath == null ? ResourceManager.getRootProject().getLocation().toFile() : workspace.getRoot().getFolder(new Path(specifiedPath)).getLocation().toFile();
}
Program: 139104
Project: 139104
Buggy source:
/** 
 * DOC bZhou Comment method "computeDependencies".
 * @param elements
 * @return
 */
protected File[] computeDependencies(IFile... elements){
  List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
  List<File> dependencyFiles=new ArrayList<File>();
  ModelElement[] modelElements=ModelElementFileFactory.getModelElements(elements);
  for (  ModelElement melement : modelElements) {
    ModelElementHelper.iterateClientDependencies(melement,dependencyElements);
  }
  for (  ModelElement element : dependencyElements) {
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(element);
    IFile file=fileMap.findCorrespondingFile(element);
    if (file != null && file.exists()) {
      dependencyFiles.add(file.getLocation().toFile());
    }
  }
  return dependencyFiles.toArray(new File[dependencyFiles.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computeDependencies".
 * @param elements
 * @return
 */
protected File[] computeDependencies(IFile... elements){
  List<ModelElement> dependencyElements=new ArrayList<ModelElement>();
  List<File> dependencyFiles=new ArrayList<File>();
  ModelElement[] modelElements=ModelElementFileFactory.getModelElements(elements);
  for (  ModelElement melement : modelElements) {
    ModelElementHelper.iterateClientDependencies(melement,dependencyElements);
  }
  for (  ModelElement element : dependencyElements) {
    ResourceFileMap fileMap=ModelElementFileFactory.getResourceFileMap(element);
    if (fileMap != null) {
      IFile file=fileMap.findCorrespondingFile(element);
      if (file != null && file.exists()) {
        dependencyFiles.add(file.getLocation().toFile());
      }
    }
  }
  return dependencyFiles.toArray(new File[dependencyFiles.size()]);
}
Program: 139105
Project: 139105
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public File[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<File> files=new ArrayList<File>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        if (file.isFile()) {
          files.add(file);
        }
      }
    }
  }
  return files.toArray(new File[files.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public ItemRecord[] getElements(){
  List<ItemRecord> itemRecords=new ArrayList<ItemRecord>();
  Object[] checkedElements=repositoryTree.getCheckedElements();
  for (  Object obj : checkedElements) {
    if (obj instanceof File) {
      File file=(File)obj;
      if (file.isFile()) {
        itemRecords.add(new ItemRecord(file));
      }
    }
  }
  return itemRecords.toArray(new ItemRecord[itemRecords.size()]);
}
Program: 139106
Project: 139106
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.initPath(record,null);
        writer.write();
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.write(record,null);
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}
Program: 139107
Project: 139107
Buggy source:
@Override public boolean performFinish(){
  File[] files=importPage.getElements();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  ItemRecord[] invalidRecords=writer.populate(records);
  importPage.updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    importPage.removeInvalidRecords();
    return false;
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,null);
            writer.write();
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  final ItemRecord[] records=importPage.getElements();
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.write(record,null);
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139108
Project: 139108
Buggy source:
/** 
 * DOC bZhou Comment method "updateErrorList".
 * @param records
 */
public void updateErrorList(ItemRecord[] records){
  errors.clear();
  invalidRecords=records;
  for (  ItemRecord record : records) {
    errors.addAll(record.getErrors());
  }
  errorsList.setInput(errors);
  errorsList.refresh();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateErrorList".
 * @param records
 */
public void updateErrorList(ItemRecord[] records){
  errors.clear();
  for (  ItemRecord record : records) {
    errors.addAll(record.getErrors());
  }
  errorsList.setInput(errors);
  errorsList.refresh();
}
Program: 139109
Project: 139109
Buggy source:
/** 
 * DOC bZhou Comment method "createErrorsList".
 * @param top
 */
private void createErrorsList(Composite top){
  Group errorGroup=new Group(top,SWT.NONE);
  errorGroup.setLayout(new GridLayout());
  errorGroup.setText(Messages.getString("String_Node_Str"));
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=150;
  errorGroup.setLayoutData(gridData);
  errorsList=new TableViewer(errorGroup,SWT.BORDER);
  errorsList.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
  errorsList.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      return errors.toArray();
    }
  }
);
  errorsList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return element.toString();
    }
    @Override public Image getImage(    Object element){
      return ImageLib.getImage(ImageLib.ICON_ERROR_INFO);
    }
  }
);
  errorsList.setInput(this);
  errorsList.setSorter(new ViewerSorter());
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createErrorsList".
 * @param top
 */
private void createErrorsList(Composite top){
  Group errorGroup=new Group(top,SWT.NONE);
  errorGroup.setLayout(new GridLayout());
  errorGroup.setText(Messages.getString("String_Node_Str"));
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=100;
  errorGroup.setLayoutData(gridData);
  errorsList=new TableViewer(errorGroup,SWT.BORDER);
  errorsList.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
  errorsList.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      return errors.toArray();
    }
  }
);
  errorsList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return element.toString();
    }
    @Override public Image getImage(    Object element){
      return ImageLib.getImage(ImageLib.ICON_ERROR_INFO);
    }
  }
);
  errorsList.setInput(this);
  errorsList.setSorter(new ViewerSorter());
}
Program: 139110
Project: 139110
Buggy source:
/** 
 * DOC sgandon Comment method "removeInvalidRecords".
 */
public void removeInvalidRecords(){
  if (invalidRecords != null) {
    for (    ItemRecord record : invalidRecords) {
      File file=record.getFile();
      repositoryTree.setChecked(file,false);
    }
    repositoryTree.refresh();
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "removeInvalidRecords".
 * @param invalidRecords
 */
public void removeInvalidRecords(ItemRecord[] invalidRecords){
  if (invalidRecords != null) {
    for (    ItemRecord record : invalidRecords) {
      File file=record.getFile();
      repositoryTree.setChecked(file,false);
    }
    repositoryTree.refresh();
  }
}
Program: 139111
Project: 139111
Buggy source:
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createRepositoryTree(top);
  createErrorsList(top);
  initControlState();
  addListeners();
  setControl(top);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  top.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSelectComposite(top);
  createRepositoryTree(top);
  createErrorsList(top);
  createOptionComposite(top);
  initControlState();
  addListeners();
  setControl(top);
}
Program: 139112
Project: 139112
Buggy source:
public ImportWizardPage(IImexWriter writer){
  super(Messages.getString("String_Node_Str"));
  setMessage(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
public ImportWizardPage(IImexWriter writer){
  super(Messages.getString("String_Node_Str"));
  setMessage(Messages.getString("String_Node_Str"));
  this.writer=writer;
}
Program: 139113
Project: 139113
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String result=openFileDialog();
  if (result != null) {
    archTxt.setText(result);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  dirTxt.setText(dirTxt.getText());
  populateElement();
}
Program: 139114
Project: 139114
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public File[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<File> files=new ArrayList<File>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        if (file.isFile()) {
          files.add(file);
        }
      }
    }
  }
  return files.toArray(new File[files.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public ItemRecord[] getElements(){
  List<ItemRecord> itemRecords=new ArrayList<ItemRecord>();
  Object[] checkedElements=repositoryTree.getCheckedElements();
  for (  Object obj : checkedElements) {
    if (obj instanceof File) {
      File file=(File)obj;
      if (file.isFile()) {
        itemRecords.add(new ItemRecord(file));
      }
    }
  }
  return itemRecords.toArray(new ItemRecord[itemRecords.size()]);
}
Program: 139116
Project: 139116
Buggy source:
public void menuDetected(MenuDetectEvent e){
  int column=cursor.getColumn();
  if (column == TABLE_COLUMN_INDEX) {
    cursor.setMenu(menu2);
    menu2.setVisible(true);
  }
 else   if (column == VIEW_COLUMN_INDEXES) {
    cursor.setMenu(menu1);
    menu1.setVisible(true);
  }
 else   if (column == VIEW_COLUMN_INDEX) {
    cursor.setMenu(menu);
    menu.setVisible(true);
  }
}

Fixed version (ground truth):
public void menuDetected(MenuDetectEvent e){
  int column=cursor.getColumn();
  if (column == TABLE_COLUMN_INDEX) {
    cursor.setMenu(menu2);
    menu2.setVisible(true);
  }
 else   if (column == VIEW_COLUMN_INDEXES) {
    cursor.setMenu(menu1);
    menu1.setVisible(true);
  }
 else   if (column == VIEW_COLUMN_INDEX) {
    cursor.setMenu(menu);
    menu.setVisible(true);
  }
 else {
    cursor.setMenu(null);
  }
}
Program: 139119
Project: 139119
Buggy source:
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  IPath itemPath=PropertyHelper.getElementPath(record.getProperty());
  IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
  ModelElement element=record.getElement();
  if (element != null && itemFile.exists()) {
    record.addError("String_Node_Str" + element.getName() + "String_Node_Str"+ itemFile.getFullPath().toString());
  }
}

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.getElementPath(property);
    IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
    ModelElement element=record.getElement();
    if (element != null && itemFile.exists()) {
      record.addError("String_Node_Str" + element.getName() + "String_Node_Str"+ itemFile.getFullPath().toString());
    }
  }
}
Program: 139120
Project: 139120
Buggy source:
public ItemRecord(File file){
  this.file=file;
  init();
}

Fixed version (ground truth):
public ItemRecord(File file){
  this.file=file;
  try {
    init();
  }
 catch (  Exception e) {
    addError(e.getMessage());
  }
}
Program: 139121
Project: 139121
Buggy source:
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0] == null ? "String_Node_Str" : indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1] == null ? "String_Node_Str" : indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && isContainRowCount) {
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[0])) {
      Double min=StringFormatUtil.parseDouble(indicatorPersentThreshold[0]);
      min=min > 1 ? min : min * 100;
      pLowerText.setText(String.valueOf(min));
    }
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[1])) {
      Double max=StringFormatUtil.parseDouble(indicatorPersentThreshold[1]);
      max=max > 1 ? max : max * 100;
      pHigherText.setText(String.valueOf(max));
    }
  }
}

Fixed version (ground truth):
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0] == null ? "String_Node_Str" : indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1] == null ? "String_Node_Str" : indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && isContainRowCount) {
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[0])) {
      Double min=StringFormatUtil.parseDouble(indicatorPersentThreshold[0]);
      min=min > 1 ? min : StringFormatUtil.formatPercentDecimalDouble(min);
      pLowerText.setText(String.valueOf(min));
    }
    if (StringUtils.isNotEmpty(indicatorPersentThreshold[1])) {
      Double max=StringFormatUtil.parseDouble(indicatorPersentThreshold[1]);
      max=max > 1 ? max : StringFormatUtil.formatPercentDecimalDouble(max);
      pHigherText.setText(String.valueOf(max));
    }
  }
}
Program: 139124
Project: 139124
Buggy source:
public void run(){
  MessageDialogWithToggle.openInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  SubMonitor progress=SubMonitor.convert(monitor,fExtensions.length * 10 + 5);
  progress.setTaskName(this.getName());
  for (  IEcosComponent extension : fExtensions) {
    if (progress.isCanceled()) {
      return Status.CANCEL_STATUS;
    }
    fMonitor=progress.newChild(10);
    downloadExtension(extension,fMonitor);
  }
  progress.setTaskName(EcosConstants.RELOAD_PALETTE);
  return Status.OK_STATUS;
}
Program: 139126
Project: 139126
Buggy source:
/** 
 * DOC bZhou Comment method "getAvailableCategory".
 * @param version
 * @return empty list if no any category.
 * @throws Exception
 */
public static List<IEcosCategory> getAvailableCategory(String version) throws Exception {
  return EcosystemService.getCategoryList(version);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getAvailableCategory".
 * @param version
 * @return empty list if no any category.
 * @throws Exception
 */
public static List<IEcosCategory> getAvailableCategory(String version) throws Exception {
  if (ecosCategories == null) {
    ecosCategories=EcosystemService.getCategoryList(version);
  }
  return ecosCategories;
}
Program: 139127
Project: 139127
Buggy source:
public void init(IWorkbench workbench){
  isBlockWeb=Platform.getPreferencesService().getBoolean(CorePlugin.PLUGIN_ID,BLOCK_WEB_BROWSER,true,new IScopeContext[]{new InstanceScope()});
}

Fixed version (ground truth):
public void init(IWorkbench workbench){
  isBlockWeb=Platform.getPreferencesService().getBoolean(CorePlugin.PLUGIN_ID,BLOCK_WEB_BROWSER,false,new IScopeContext[]{new InstanceScope()});
}
Program: 139128
Project: 139128
Buggy source:
@Override protected void performDefaults(){
  blockWebBtn.setSelection(true);
  isBlockWeb=true;
}

Fixed version (ground truth):
@Override protected void performDefaults(){
  blockWebBtn.setSelection(false);
  isBlockWeb=true;
}
Program: 139130
Project: 139130
Buggy source:
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage)     this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage) {
      this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
      DataManager connection=((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getAnalysis().getContext().getConnection();
      this.dbms=DbmsLanguageFactory.createDbmsLanguage(connection);
    }
  }
}
Program: 139134
Project: 139134
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  if (invalidRecords != null) {
    for (    ItemRecord record : invalidRecords) {
      File file=record.getFile();
      if (repositoryTree.getChecked(file)) {
        repositoryTree.setChecked(file,!removeInvalidBTN.getSelection());
      }
    }
    repositoryTree.refresh();
  }
  super.widgetSelected(e);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  if (invalidRecords != null) {
    for (    ItemRecord record : invalidRecords) {
      File file=record.getFile();
      repositoryTree.setChecked(file,false);
    }
    repositoryTree.refresh();
  }
  super.widgetSelected(e);
}
Program: 139135
Project: 139135
Buggy source:
/** 
 * DOC bZhou Comment method "updateErrorList".
 * @param records
 */
public void updateErrorList(ItemRecord[] records){
  errors.clear();
  invalidRecords=records;
  for (  ItemRecord record : records) {
    errors.addAll(record.getErrors());
  }
  errorsList.setInput(errors);
  errorsList.refresh();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateErrorList".
 * @param records
 */
public void updateErrorList(ItemRecord[] records){
  errors.clear();
  invalidRecords=records;
  for (  ItemRecord record : records) {
    errors.addAll(record.getErrors());
  }
  errorsList.setInput(errors);
  errorsList.refresh();
  removeInvalidBTN.setEnabled(true);
}
Program: 139136
Project: 139136
Buggy source:
/** 
 * DOC bZhou Comment method "createErrorsList".
 * @param top
 */
private void createErrorsList(Composite top){
  Group errorGroup=new Group(top,SWT.NONE);
  errorGroup.setLayout(new GridLayout());
  errorGroup.setText("String_Node_Str");
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=150;
  errorGroup.setLayoutData(gridData);
  removeInvalidBTN=new Button(errorGroup,SWT.CHECK);
  removeInvalidBTN.setText("String_Node_Str");
  errorsList=new TableViewer(errorGroup,SWT.BORDER);
  errorsList.getControl().setLayoutData(gridData);
  errorsList.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      return errors.toArray();
    }
  }
);
  errorsList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return element.toString();
    }
    @Override public Image getImage(    Object element){
      return ImageLib.getImage(ImageLib.ICON_ERROR_INFO);
    }
  }
);
  errorsList.setInput(this);
  errorsList.setSorter(new ViewerSorter());
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createErrorsList".
 * @param top
 */
private void createErrorsList(Composite top){
  Group errorGroup=new Group(top,SWT.NONE);
  errorGroup.setLayout(new GridLayout());
  errorGroup.setText("String_Node_Str");
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=150;
  errorGroup.setLayoutData(gridData);
  errorsList=new TableViewer(errorGroup,SWT.BORDER);
  errorsList.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
  errorsList.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      return errors.toArray();
    }
  }
);
  errorsList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return element.toString();
    }
    @Override public Image getImage(    Object element){
      return ImageLib.getImage(ImageLib.ICON_ERROR_INFO);
    }
  }
);
  errorsList.setInput(this);
  errorsList.setSorter(new ViewerSorter());
  removeInvalidBTN=new Button(errorGroup,SWT.PUSH);
  removeInvalidBTN.setText("String_Node_Str");
  removeInvalidBTN.setEnabled(false);
  removeInvalidBTN.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
}
Program: 139140
Project: 139140
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public Double getMean(){
  Long c=getCount();
  if (c.compareTo(0L) == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  Double sum=null;
  try {
    sum=Double.valueOf(getSumStr());
  }
 catch (  Exception e) {
    return Double.NaN;
  }
  if (sum == null) {
    throw new RuntimeException("String_Node_Str");
  }
  return sum / c;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public Double getMean(){
  Long c=getCount();
  if (c.compareTo(0L) == 0) {
    return Double.NaN;
  }
  Double sum=null;
  try {
    sum=Double.valueOf(getSumStr());
  }
 catch (  Exception e) {
    return Double.NaN;
  }
  if (sum == null) {
    throw new RuntimeException("String_Node_Str");
  }
  return sum / c;
}
Program: 139141
Project: 139141
Buggy source:
private static String createStandardNumber(Object input){
  return NumberFormat.getInstance().format(input);
}

Fixed version (ground truth):
private static String createStandardNumber(Object input){
  return NumberFormat.getInstance(Locale.US).format(input);
}
Program: 139142
Project: 139142
Buggy source:
@Override protected void handleRemoveElement(ModelElementChangeLeftTarget removeElement){
  ColumnSet removeColumnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumnSet == null) {
    return;
  }
  popRemoveElementConfirm();
  PackageHelper.removeColumnSet(removeColumnSet,(Package)selectedObj);
}

Fixed version (ground truth):
@Override protected void handleRemoveElement(ModelElementChangeLeftTarget removeElement){
  ColumnSet removeColumnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumnSet != null) {
    popRemoveElementConfirm();
    if (isValidTableHandle(removeColumnSet) || isValidViewHandle(removeColumnSet)) {
      PackageHelper.removeColumnSet(removeColumnSet,(Package)selectedObj);
    }
  }
}
Program: 139143
Project: 139143
Buggy source:
@Override protected void handleAddElement(ModelElementChangeRightTarget addElement){
  EObject rightElement=addElement.getRightElement();
  ColumnSet columnSetSwitch=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    Package catalog=(Package)selectedObj;
    PackageHelper.addColumnSet(columnSetSwitch,catalog);
  }
}

Fixed version (ground truth):
@Override protected void handleAddElement(ModelElementChangeRightTarget addElement){
  EObject rightElement=addElement.getRightElement();
  ColumnSet columnSetSwitch=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    if (isValidTableHandle(columnSetSwitch) || isValidViewHandle(columnSetSwitch)) {
      PackageHelper.addColumnSet(columnSetSwitch,(Package)selectedObj);
    }
  }
}
Program: 139144
Project: 139144
Buggy source:
/** 
 * This method is created right before 4.0 release to avoid exporting a non consistent repository. this should be removed when implementing consistency check on the export. This will disable selection on the reposiroty tree and check all the items to force complete selection and avoid partial unchecked selection.
 */
private void temporaryDisableTreeSelection(){
  TreeItem topItem=repositoryTree.getTree().getTopItem();
  if (topItem != null) {
    repositoryTree.setSubtreeChecked(topItem.getData(),true);
  }
  repositoryTree.getTree().setEnabled(false);
}

Fixed version (ground truth):
/** 
 * This method is created right before 4.0 release to avoid exporting a non consistent repository. this should be removed when implementing consistency check on the export. This will disable selection on the reposiroty tree and check all the items to force complete selection and avoid partial unchecked selection.
 */
private void temporaryDisableTreeSelection(){
  TreeItem topItem=repositoryTree.getTree().getTopItem();
  TreeItem[] topItems=repositoryTree.getTree().getItems();
  for (  TreeItem treeItem : topItems) {
    repositoryTree.setSubtreeChecked(treeItem.getData(),true);
  }
  repositoryTree.getTree().setEnabled(false);
}
Program: 139145
Project: 139145
Buggy source:
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem topItem=repositoryTree.getTree().getTopItem();
    if (topItem != null) {
      repositoryTree.setSubtreeChecked(topItem.getData(),true);
    }
    repositoryTree.getTree().setEnabled(false);
    repositoryTree.refresh();
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
  updatePageStatus();
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "dirTextModified".
 */
protected void dirTextModified(){
  File file=new File(dirTxt.getText());
  if (file.exists()) {
    repositoryTree.setInput(file);
    repositoryTree.expandAll();
    TreeItem[] topItems=repositoryTree.getTree().getItems();
    for (    TreeItem treeItem : topItems) {
      repositoryTree.setSubtreeChecked(treeItem.getData(),true);
    }
    repositoryTree.getTree().setEnabled(false);
    repositoryTree.refresh();
  }
 else {
    repositoryTree.setInput(null);
  }
  checkforErrors();
  updatePageStatus();
}
Program: 139146
Project: 139146
Buggy source:
/** 
 * @return query string for full table select
 */
private String createTableSelect(){
  TableNode node=(TableNode)_selectedNodes[0];
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  List columnNames=node.getColumnNames();
  Iterator it=columnNames.iterator();
  while (it.hasNext()) {
    query.append(sep);
    String column=(String)it.next();
    query.append(column);
    sep="String_Node_Str";
  }
  query.append("String_Node_Str");
  query.append(node.getQualifiedName());
  return query.toString();
}

Fixed version (ground truth):
/** 
 * @return query string for full table select
 */
private String createTableSelect(){
  TableNode node=(TableNode)_selectedNodes[0];
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  List columnNames=node.getColumnNames();
  Iterator it=columnNames.iterator();
  while (it.hasNext()) {
    query.append(sep);
    String column=(String)it.next();
    query.append(quote(column,getQuoteString(node)));
    sep="String_Node_Str";
  }
  query.append("String_Node_Str");
  query.append(node.getQualifiedName());
  return query.toString();
}
Program: 139147
Project: 139147
Buggy source:
/** 
 * @return query string for full table select
 */
private String createColumnSelect(){
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  String table="String_Node_Str";
  for (int i=0; i < _selectedNodes.length; i++) {
    INode node=_selectedNodes[i];
    if (node instanceof ColumnNode) {
      ColumnNode column=(ColumnNode)node;
      if (table.length() == 0) {
        table=column.getQualifiedParentTableName();
      }
      if (column.getQualifiedParentTableName().equals(table)) {
        query.append(sep);
        query.append(column.getName());
        sep="String_Node_Str";
      }
    }
  }
  query.append("String_Node_Str");
  query.append(table);
  return query.toString();
}

Fixed version (ground truth):
/** 
 * @return query string for full table select
 */
private String createColumnSelect(){
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  String table="String_Node_Str";
  for (int i=0; i < _selectedNodes.length; i++) {
    INode node=_selectedNodes[i];
    if (node instanceof ColumnNode) {
      ColumnNode column=(ColumnNode)node;
      if (table.length() == 0) {
        table=column.getQualifiedParentTableName();
      }
      if (column.getQualifiedParentTableName().equals(table)) {
        query.append(sep);
        query.append(quote(column.getName(),getQuoteString(column)));
        sep="String_Node_Str";
      }
    }
  }
  query.append("String_Node_Str");
  query.append(table);
  return query.toString();
}
Program: 139148
Project: 139148
Buggy source:
/** 
 * DOC bZhou ExportWizard constructor comment.
 */
public ExportWizard(String specifiedPath){
  exportPage=new ExportWizardPage(specifiedPath);
  setWindowTitle("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * DOC bZhou ExportWizard constructor comment.
 */
public ExportWizard(EImexType type,String specifiedPath){
  setWindowTitle("String_Node_Str");
  this.exportPage=new ExportWizardPage(specifiedPath);
  this.writer=ExportWriterFactory.create(type);
}
Program: 139149
Project: 139149
Buggy source:
@Override public boolean performFinish(){
  File[] files=exportPage.getElements();
  IImexWriter writer=ExportWriterFactory.create(type);
  try {
    for (    File file : files) {
      writer.initPath(new ItemRecord(file),exportPage.getFilePath());
      writer.write();
    }
    writer.finish(null);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File[] files=exportPage.getElements();
  final String destPath=exportPage.getFilePath();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,destPath);
            writer.write();
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139150
Project: 139150
Buggy source:
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public File[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<File> files=new ArrayList<File>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        files.add((File)obj);
      }
    }
  }
  return files.toArray(new File[files.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getElements".
 * @return
 */
public File[] getElements(){
  Object[] checkedElements=repositoryTree.getCheckedElements();
  List<File> files=new ArrayList<File>();
  if (checkedElements != null) {
    for (    Object obj : checkedElements) {
      if (obj instanceof File) {
        File file=(File)obj;
        if (file.isFile()) {
          files.add(file);
        }
      }
    }
  }
  return files.toArray(new File[files.size()]);
}
Program: 139151
Project: 139151
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.initPath(record,null);
        writer.write();
      }
 else {
        for (        String error : record.getErrors()) {
          log.error(error);
        }
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str",records.length);
  try {
    for (    ItemRecord record : records) {
      if (monitor.isCanceled()) {
        break;
      }
      monitor.subTask("String_Node_Str" + record.getElement().getName());
      if (record.isValid()) {
        log.info("String_Node_Str" + record.getFile().getAbsolutePath());
        writer.initPath(record,null);
        writer.write();
      }
      monitor.worked(1);
    }
    writer.finish(records);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  monitor.done();
}
Program: 139152
Project: 139152
Buggy source:
@Override public boolean performFinish(){
  File[] files=importPage.getElements();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  ItemRecord[] invalidRecords=writer.populate(records);
  importPage.updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    return false;
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,null);
            writer.write();
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File[] files=importPage.getElements();
  final ItemRecord[] records=new ItemRecord[files.length];
  for (int i=0; i < files.length; i++) {
    records[i]=new ItemRecord(files[i]);
  }
  ItemRecord[] invalidRecords=writer.populate(records);
  importPage.updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    return false;
  }
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",records.length);
      try {
        for (        ItemRecord record : records) {
          if (monitor.isCanceled()) {
            break;
          }
          monitor.subTask("String_Node_Str" + record.getElement().getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            writer.initPath(record,null);
            writer.write();
          }
          monitor.worked(1);
        }
        writer.finish(records);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
      monitor.done();
    }
  }
;
  try {
    ProgressUI.popProgressDialog(op);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return true;
}
Program: 139153
Project: 139153
Buggy source:
public void run(IAction action){
  ExportWizard wizard=new ExportWizard();
  wizard.setType(EImexType.FILE);
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(550,500);
  dialog.open();
}

Fixed version (ground truth):
public void run(IAction action){
  ExportWizard wizard=new ExportWizard(EImexType.FILE);
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(550,500);
  dialog.open();
}
Program: 139154
Project: 139154
Buggy source:
/** 
 * Getter for fullPath.
 * @return the fullPath
 */
public IPath getFullPath(){
  if (file.isFile()) {
    IPath path=new Path(file.getAbsolutePath());
    path=path.makeRelativeTo(ResourceManager.getRootProject().getLocation());
    return path.removeLastSegments(1);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Getter for fullPath.
 * @return the fullPath
 */
public IPath getFullPath(){
  if (file.isFile()) {
    IPath path=new Path(file.getAbsolutePath());
    path=path.makeRelativeTo(ResourceManager.getRootProject().getLocation());
    return path;
  }
  return null;
}
Program: 139155
Project: 139155
Buggy source:
/** 
 * DOC Zqin Comment method "isOutOfRange".
 * @return
 */
public boolean isOutOfRange(String inputValue){
  outOfRange=false;
  if (inputValue == null || indicator == null) {
    return false;
  }
  IndicatorEnum indicatorEnum=IndicatorEnum.findIndicatorEnum(indicator.eClass());
  if (indicatorEnum != null) {
switch (indicatorEnum) {
case ModeIndicatorEnum:
      String expectedValue=IndicatorHelper.getExpectedValue(indicator);
    if (expectedValue != null) {
      Boolean ignoreCaseOption=IndicatorHelper.ignoreCaseOption(indicator);
      outOfRange=!StringUtils.equals(value,expectedValue);
      if (ignoreCaseOption) {
        outOfRange=!(ignoreCaseOption && StringUtils.equalsIgnoreCase(value,expectedValue));
      }
    }
  break;
default :
outOfRange=checkRange(inputValue);
}
}
return outOfRange;
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "isOutOfRange".
 * @return
 */
public boolean isOutOfRange(String inputValue){
  outOfRange=false;
  if (inputValue == null || indicator == null) {
    return false;
  }
  IndicatorEnum indicatorEnum=IndicatorEnum.findIndicatorEnum(indicator.eClass());
  if (indicatorEnum != null) {
switch (indicatorEnum) {
case ModeIndicatorEnum:
      String expectedValue=IndicatorHelper.getExpectedValue(indicator);
    if (expectedValue != null) {
      Boolean ignoreCaseOption=IndicatorHelper.ignoreCaseOption(indicator);
      if (ignoreCaseOption != null && ignoreCaseOption) {
        outOfRange=!(ignoreCaseOption && StringUtils.equalsIgnoreCase(value,expectedValue));
      }
 else {
        outOfRange=!StringUtils.equals(value,expectedValue);
      }
    }
  break;
default :
outOfRange=checkRange(inputValue);
}
}
return outOfRange;
}
Program: 139156
Project: 139156
Buggy source:
/** 
 * DOC bZhou Comment method "iterateClientDependencies".
 * @param element
 * @param returnElements
 */
public static void iterateClientDependencies(ModelElement element,List<ModelElement> returnElements){
  if (returnElements != null) {
    for (    Dependency dependency : element.getClientDependency()) {
      EList<ModelElement> supplier=dependency.getSupplier();
      if (supplier != null) {
        for (        ModelElement subElement : supplier) {
          iterateClientDependencies(subElement,returnElements);
        }
        returnElements.addAll(supplier);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "iterateClientDependencies".
 * @param element
 * @param returnElements
 */
public static void iterateClientDependencies(ModelElement element,List<ModelElement> returnElements){
  if (returnElements != null) {
    for (    Dependency dependency : element.getClientDependency()) {
      if (dependency.eIsProxy()) {
        returnElements.add(dependency);
        continue;
      }
      EList<ModelElement> supplier=dependency.getSupplier();
      if (supplier != null) {
        for (        ModelElement subElement : supplier) {
          iterateClientDependencies(subElement,returnElements);
        }
        returnElements.addAll(supplier);
      }
    }
  }
}