nus-yam/ex-repair huggingface dataset:
Program: 140633
Project: 140633
Buggy source:
/** 
 * DOC qzhang CreateSqlFileWizardPage constructor comment.
 */
public CreateSqlFileWizardPage(){
  metadata=new HashMap<String,String>();
  setPageComplete(false);
}

Fixed version (ground truth):
/** 
 * DOC qzhang CreateSqlFileWizardPage constructor comment.
 * @param folder
 */
public CreateSqlFileWizardPage(IFolder folder){
  metadata=new HashMap<String,String>();
  setPageComplete(false);
  defaultFolderProviderRes=folder;
}
Program: 140635
Project: 140635
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout(2,false));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout());
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
}
Program: 140636
Project: 140636
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite body=form.getBody();
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      while (!RunAnalysisAction.finishFlag) {
        try {
          Thread.sleep(3000);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
      refreshChart(form);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout(2,false));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      while (!RunAnalysisAction.finishFlag) {
        try {
          Thread.sleep(3000);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
      refreshChart(form);
    }
  }
);
}
Program: 140637
Project: 140637
Buggy source:
/** 
 * @param editor
 * @param id
 * @param title
 */
public ConnectionMasterDetailsPage(FormEditor editor,String id,String title){
  super(editor,id,title);
}

Fixed version (ground truth):
public ConnectionMasterDetailsPage(FormEditor editor,String id,String title){
  super(editor,id,title);
}
Program: 140638
Project: 140638
Buggy source:
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  savePattern();
  this.isDirty=false;
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  if (savePattern()) {
    this.isDirty=false;
  }
}
Program: 140639
Project: 140639
Buggy source:
protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  form.setText("String_Node_Str");
  body.setLayout(new GridLayout());
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  creatPatternDefinitionSection(form,topComp);
}

Fixed version (ground truth):
protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  creatPatternDefinitionSection(form,topComp);
}
Program: 140640
Project: 140640
Buggy source:
private void savePattern(){
  this.pattern.getComponents().clear();
  this.pattern.getComponents().addAll(tempPatternComponents);
  EMFUtil.saveSingleResource(pattern.eResource());
}

Fixed version (ground truth):
private boolean savePattern(){
  this.pattern.getComponents().clear();
  this.pattern.getComponents().addAll(tempPatternComponents);
  EList<PatternComponent> components=this.pattern.getComponents();
  List<String> existLanguage=new ArrayList<String>();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    String language=regularExpress.getExpression().getLanguage();
    if ((regularExpress.getExpression().getBody() == null) || (!regularExpress.getExpression().getBody().matches("String_Node_Str"))) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      return false;
    }
    if (existLanguage.contains(language)) {
      MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + language);
      return false;
    }
 else {
      existLanguage.add(language);
    }
  }
  EMFUtil.saveSingleResource(pattern.eResource());
  return true;
}
Program: 140641
Project: 140641
Buggy source:
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask("String_Node_Str" + analysis.getName() + "String_Node_Str",IProgressMonitor.UNKNOWN);
  final ReturnCode executed=finalExec.execute(finalAnalysis);
  monitor.done();
  if (executed.isOk()) {
    if (log.isInfoEnabled()) {
      int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
      log.info("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    }
    AnaResourceFileHelper.getInstance().save(finalAnalysis);
    return Status.OK_STATUS;
  }
 else {
    int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
    log.warn("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        MessageDialogWithToggle.openError(null,"String_Node_Str","String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed.getMessage());
      }
    }
);
    return Status.CANCEL_STATUS;
  }
}

Fixed version (ground truth):
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask("String_Node_Str" + analysis.getName() + "String_Node_Str",IProgressMonitor.UNKNOWN);
  final ReturnCode executed=finalExec.execute(finalAnalysis);
  monitor.done();
  if (executed.isOk()) {
    if (log.isInfoEnabled()) {
      int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
      log.info("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    }
    AnaResourceFileHelper.getInstance().save(finalAnalysis);
    if (page != null) {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          page.refreshChart(page.getForm());
        }
      }
);
    }
    return Status.OK_STATUS;
  }
 else {
    int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
    log.warn("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        MessageDialogWithToggle.openError(null,"String_Node_Str","String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed.getMessage());
      }
    }
);
    return Status.CANCEL_STATUS;
  }
}
Program: 140642
Project: 140642
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  new RunAnalysisAction().run();
  while (!RunAnalysisAction.finishFlag) {
    try {
      Thread.sleep(3000);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  refreshChart(form);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  new RunAnalysisAction().run();
}
Program: 140643
Project: 140643
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout(2,false));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      while (!RunAnalysisAction.finishFlag) {
        try {
          Thread.sleep(3000);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
      refreshChart(form);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  this.form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout(2,false));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
    }
  }
);
}
Program: 140644
Project: 140644
Buggy source:
public void linkActivated(HyperlinkEvent e){
  for (  Control control : chartComposite.getChildren()) {
    control.dispose();
  }
  boolean analysisStatue=analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
  if (!analysisStatue) {
    boolean returnCode=MessageDialog.openConfirm(null,"String_Node_Str","String_Node_Str");
    if (returnCode) {
      new RunAnalysisAction().run();
      createPreviewCharts(form,chartComposite,true);
      message.setVisible(false);
    }
 else {
      createPreviewCharts(form,chartComposite,false);
      message.setText("String_Node_Str" + "String_Node_Str");
      message.setVisible(true);
    }
  }
 else {
    createPreviewCharts(form,chartComposite,true);
  }
  chartComposite.layout();
  form.reflow(true);
}

Fixed version (ground truth):
public void linkActivated(HyperlinkEvent e){
  for (  Control control : chartComposite.getChildren()) {
    control.dispose();
  }
  boolean analysisStatue=analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
  if (!analysisStatue) {
    boolean returnCode=MessageDialog.openConfirm(null,"String_Node_Str","String_Node_Str");
    if (returnCode) {
      new RunAnalysisAction().run();
      message.setVisible(false);
    }
 else {
      createPreviewCharts(form,chartComposite,false);
      message.setText("String_Node_Str" + "String_Node_Str");
      message.setVisible(true);
    }
  }
 else {
    createPreviewCharts(form,chartComposite,true);
  }
  chartComposite.layout();
  form.reflow(true);
}
Program: 140645
Project: 140645
Buggy source:
public void refreshChart(ScrolledForm form){
  if (chartComposite != null) {
    try {
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      createPreviewCharts(form,chartComposite,true);
      chartComposite.layout();
      form.reflow(true);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "refreshChart".
 * @param form
 */
public void refreshChart(ScrolledForm form){
  if (chartComposite != null) {
    try {
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      createPreviewCharts(form,chartComposite,true);
      chartComposite.layout();
      form.reflow(true);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}
Program: 140647
Project: 140647
Buggy source:
@Override public void addPages(){
  mPage=new CreatePatternWizardPage1();
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage.setTitle("String_Node_Str");
  mPage.setDescription("String_Node_Str");
  mPage.setPageComplete(false);
  mPage2=new CreatePatternWizardPage2();
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage2.setTitle("String_Node_Str");
  mPage2.setDescription("String_Node_Str");
  mPage2.setPageComplete(false);
  addPage(mPage);
  addPage(mPage2);
}

Fixed version (ground truth):
@Override public void addPages(){
  mPage=new CreatePatternWizardPage1(folder);
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage.setTitle("String_Node_Str");
  mPage.setDescription("String_Node_Str");
  mPage.setPageComplete(false);
  mPage2=new CreatePatternWizardPage2();
  mPage2.setTitle("String_Node_Str");
  mPage2.setDescription("String_Node_Str");
  mPage2.setPageComplete(false);
  addPage(mPage);
  addPage(mPage2);
}
Program: 140648
Project: 140648
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  String fname=DqRepositoryViewService.createFilename(name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  IFile file=folder.getFile(fname);
  location=file.getFullPath();
  if (file.exists()) {
    log.error("String_Node_Str" + name + "String_Node_Str"+ file.getFullPath()+ "String_Node_Str");
    return false;
  }
  util.addPoolToResourceSet(file.getFullPath().toString(),pattern);
  util.saveLastResource();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  IFolder folderResource=AbstractWizardPage.getConnectionParams().getFolderProvider().getFolderResource();
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  String fname=DqRepositoryViewService.createFilename(name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  IFile file=folderResource.getFile(fname);
  location=file.getFullPath();
  if (file.exists()) {
    log.error("String_Node_Str" + name + "String_Node_Str"+ file.getFullPath()+ "String_Node_Str");
    return false;
  }
  util.addPoolToResourceSet(file.getFullPath().toString(),pattern);
  util.saveLastResource();
  return true;
}
Program: 140649
Project: 140649
Buggy source:
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider defaultFolder=new FolderProvider();
    defaultFolder.setFolderResource(defaultFolderProviderRes);
    getConnectionParams().setFolderProvider(defaultFolder);
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider folderProvider=getConnectionParams().getFolderProvider();
    if (folderProvider == null) {
      folderProvider=new FolderProvider();
    }
    folderProvider.setFolderResource(defaultFolderProviderRes);
    getConnectionParams().setFolderProvider(folderProvider);
  }
  super.setVisible(visible);
}
Program: 140650
Project: 140650
Buggy source:
/** 
 * DOC qzhang CreateSqlFileWizardPage constructor comment.
 */
public CreatePatternWizardPage1(){
  metadata=new HashMap<String,String>();
  setPageComplete(false);
}

Fixed version (ground truth):
/** 
 * DOC qzhang CreatePatternWizardPage1 constructor comment.
 * @param folder
 */
public CreatePatternWizardPage1(IFolder folder){
  this();
  this.defaultFolderProviderRes=folder;
}
Program: 140651
Project: 140651
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FillLayout());
  super.createControl(container);
  defaultFolderProviderRes=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  pathText.setText(defaultFolderProviderRes.getFullPath().toString());
  setControl(container);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      openFolderSelectionDialog(DQStructureManager.LIBRARIES,DQStructureManager.PATTERNS);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FillLayout());
  super.createControl(container);
  pathText.setText(defaultFolderProviderRes.getFullPath().toString());
  setControl(container);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      openFolderSelectionDialog(DQStructureManager.LIBRARIES,DQStructureManager.PATTERNS);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 140652
Project: 140652
Buggy source:
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider defaultFolder=new FolderProvider();
    defaultFolder.setFolderResource(defaultFolderProviderRes);
    getConnectionParams().setFolderProvider(defaultFolder);
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider folderProvider=getConnectionParams().getFolderProvider();
    if (folderProvider == null) {
      folderProvider=new FolderProvider();
    }
    folderProvider.setFolderResource(defaultFolderProviderRes);
    getConnectionParams().setFolderProvider(folderProvider);
  }
  super.setVisible(visible);
}
Program: 140654
Project: 140654
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  location=folder.getLocation();
  String fname=DqRepositoryViewService.createFilename(name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  IFile file=folder.getFile(fname);
  if (file.exists()) {
    log.error("String_Node_Str" + name + "String_Node_Str"+ file.getFullPath()+ "String_Node_Str");
    return false;
  }
  util.addPoolToResourceSet(file.getFullPath().toString(),pattern);
  util.saveLastResource();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  String fname=DqRepositoryViewService.createFilename(name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  IFile file=folder.getFile(fname);
  location=file.getFullPath();
  if (file.exists()) {
    log.error("String_Node_Str" + name + "String_Node_Str"+ file.getFullPath()+ "String_Node_Str");
    return false;
  }
  util.addPoolToResourceSet(file.getFullPath().toString(),pattern);
  util.saveLastResource();
  return true;
}
Program: 140655
Project: 140655
Buggy source:
public void run(){
  parentCreate();
  fViewer.setCheckedElements(getInitialElementSelections().toArray());
  updateOKStatus();
}

Fixed version (ground truth):
public void run(){
  parentCreate();
  fViewer.setCheckedElements(getInitialElementSelections().toArray());
  fViewer.getTree().addTreeListener(new TreeAdapter(){
    @Override public void treeExpanded(    TreeEvent e){
      TreeItem item=(TreeItem)e.item;
      if (!item.getText().endsWith("String_Node_Str")) {
        Object obj=item.getData();
        if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
          item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
          fViewer.getTree().layout();
        }
      }
      super.treeExpanded(e);
    }
  }
);
  updateOKStatus();
}
Program: 140656
Project: 140656
Buggy source:
public void create(){
  BusyIndicator.showWhile(null,new Runnable(){
    public void run(){
      parentCreate();
      fViewer.setCheckedElements(getInitialElementSelections().toArray());
      updateOKStatus();
    }
  }
);
}

Fixed version (ground truth):
public void create(){
  BusyIndicator.showWhile(null,new Runnable(){
    public void run(){
      parentCreate();
      fViewer.setCheckedElements(getInitialElementSelections().toArray());
      fViewer.getTree().addTreeListener(new TreeAdapter(){
        @Override public void treeExpanded(        TreeEvent e){
          TreeItem item=(TreeItem)e.item;
          if (!item.getText().endsWith("String_Node_Str")) {
            Object obj=item.getData();
            if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
              item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
              fViewer.getTree().layout();
            }
          }
          super.treeExpanded(e);
        }
      }
);
      updateOKStatus();
    }
  }
);
}
Program: 140657
Project: 140657
Buggy source:
public String getText(Object element){
  if (element instanceof IContainer) {
    return ((IContainer)element).getName();
  }
 else   if (element instanceof IFolderNode) {
    IFolderNode node=((IFolderNode)element);
    if (node.isLoaded()) {
      return ((IFolderNode)element).getName() + "String_Node_Str" + ((IFolderNode)element).getChildren().length+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  String text=super.getText(element);
  if (text.endsWith(PluginConstant.PRV_SUFFIX)) {
    IFile file=(IFile)element;
    TypedReturnCode<TdDataProvider> rc=PrvResourceFileHelper.getInstance().getTdProvider(file);
    String decorateText=PluginConstant.EMPTY_STRING;
    if (rc.isOk()) {
      decorateText=rc.getObject().getName();
    }
 else {
      log.warn(rc.getMessage());
    }
    return decorateText;
  }
  if (element instanceof TdTable) {
    text=text + "String_Node_Str" + TableHelper.getColumns((TdTable)element).size()+ "String_Node_Str";
  }
  if (element instanceof TdView) {
    text=text + "String_Node_Str" + ViewHelper.getColumns((TdView)element).size()+ "String_Node_Str";
  }
  return text;
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof IContainer) {
    return ((IContainer)element).getName();
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getName();
  }
  String text=super.getText(element);
  if (text.endsWith(PluginConstant.PRV_SUFFIX)) {
    IFile file=(IFile)element;
    TypedReturnCode<TdDataProvider> rc=PrvResourceFileHelper.getInstance().getTdProvider(file);
    String decorateText=PluginConstant.EMPTY_STRING;
    if (rc.isOk()) {
      decorateText=rc.getObject().getName();
    }
 else {
      log.warn(rc.getMessage());
    }
    return decorateText;
  }
  return text;
}
Program: 140659
Project: 140659
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  Tree tree=(Tree)e.getSource();
  Point point=new Point(e.x,e.y);
  TreeItem item=tree.getItem(point);
  if (!item.getText().endsWith("String_Node_Str")) {
    Object obj=item.getData();
    if (obj instanceof AbstractFolderNode) {
      AbstractFolderNode node=(AbstractFolderNode)obj;
      node.loadChildren();
      Object[] children=node.getChildren();
      if (children != null) {
        item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
      }
      getCommonViewer().getTree().layout();
    }
  }
  super.mouseDoubleClick(e);
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  Tree tree=(Tree)e.getSource();
  Point point=new Point(e.x,e.y);
  TreeItem item=tree.getItem(point);
  if (item != null && !item.getText().endsWith("String_Node_Str")) {
    Object obj=item.getData();
    if (obj instanceof AbstractFolderNode) {
      AbstractFolderNode node=(AbstractFolderNode)obj;
      node.loadChildren();
      Object[] children=node.getChildren();
      if (children != null) {
        item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
      }
      getCommonViewer().getTree().layout();
    }
  }
  super.mouseDoubleClick(e);
}
Program: 140660
Project: 140660
Buggy source:
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  this.addViewerFilter(EMFObjFilter.FILTER_ID);
  this.addViewerFilter(ReportingFilter.FILTER_ID);
  adjustFilter();
  activateContext();
  this.getCommonViewer().setSorter(null);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  this.addViewerFilter(EMFObjFilter.FILTER_ID);
  this.addViewerFilter(ReportingFilter.FILTER_ID);
  adjustFilter();
  activateContext();
  this.getCommonViewer().setSorter(null);
  this.getCommonViewer().getTree().addTreeListener(new TreeAdapter(){
    @Override public void treeExpanded(    TreeEvent e){
      TreeItem item=(TreeItem)e.item;
      if (!item.getText().endsWith("String_Node_Str")) {
        Object obj=item.getData();
        if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
          item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
          getCommonViewer().getTree().layout();
        }
      }
      super.treeExpanded(e);
    }
  }
);
  this.getCommonViewer().getTree().addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      Tree tree=(Tree)e.getSource();
      Point point=new Point(e.x,e.y);
      TreeItem item=tree.getItem(point);
      if (!item.getText().endsWith("String_Node_Str")) {
        Object obj=item.getData();
        if (obj instanceof AbstractFolderNode) {
          AbstractFolderNode node=(AbstractFolderNode)obj;
          node.loadChildren();
          Object[] children=node.getChildren();
          if (children != null) {
            item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
          }
          getCommonViewer().getTree().layout();
        }
      }
      super.mouseDoubleClick(e);
    }
  }
);
}
Program: 140661
Project: 140661
Buggy source:
public String getText(Object element){
  if (element instanceof TableFolderNode) {
    TableFolderNode node=(TableFolderNode)element;
    Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
    return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getTables(catalogOrSchema).size()+ "String_Node_Str";
  }
  if (element instanceof ViewFolderNode) {
    ViewFolderNode node=(ViewFolderNode)element;
    Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
    return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getViews(catalogOrSchema).size()+ "String_Node_Str";
  }
  if (element instanceof ColumnFolderNode) {
    ColumnFolderNode node=(ColumnFolderNode)element;
    ColumnSet table=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(node.getParent());
    return ((IFolderNode)element).getName() + "String_Node_Str" + ColumnSetHelper.getColumns(table).size()+ "String_Node_Str";
  }
  if (element instanceof Pattern) {
    Pattern pattern=(Pattern)element;
    RegularExpression patternComponent=(RegularExpression)pattern.getComponents().get(0);
    return patternComponent.getExpression().getBody();
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof TableFolderNode || element instanceof ViewFolderNode || element instanceof ColumnFolderNode) {
    return ((IFolderNode)element).getName();
  }
  if (element instanceof Pattern) {
    Pattern pattern=(Pattern)element;
    RegularExpression patternComponent=(RegularExpression)pattern.getComponents().get(0);
    return patternComponent.getExpression().getBody();
  }
  return super.getText(element);
}
Program: 140665
Project: 140665
Buggy source:
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    this.createNewFoler(project,ANALYSIS);
    this.createNewFoler(project,REPORTS);
    project=this.createNewProject(LIBRARIES,shell);
    IFolder patternFolder=this.createNewFoler(project,PATTERNS);
    this.copyFilesToFolder(PATTERN_PATH,PluginConstant.PATTERN_SUFFIX,true,patternFolder);
    IFolder sqlSourceFolder=this.createNewFoler(project,SOURCE_FILES);
    this.copyFilesToFolder(DEMO_PATH,PluginConstant.SQL_SUFFIX,true,sqlSourceFolder);
    project=this.createNewProject(METADATA,shell);
    this.createNewFoler(project,DB_CONNECTIONS);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    this.createNewFoler(project,ANALYSIS);
    this.createNewFoler(project,REPORTS);
    project=this.createNewProject(LIBRARIES,shell);
    IFolder patternFolder=this.createNewFoler(project,PATTERNS);
    this.copyFilesToFolder(PATTERN_PATH,true,patternFolder);
    IFolder sqlSourceFolder=this.createNewFoler(project,SOURCE_FILES);
    this.copyFilesToFolder(DEMO_PATH,true,sqlSourceFolder);
    project=this.createNewProject(METADATA,shell);
    this.createNewFoler(project,DB_CONNECTIONS);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}
Program: 140666
Project: 140666
Buggy source:
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    this.createNewFoler(project,ANALYSIS);
    this.createNewFoler(project,REPORTS);
    project=this.createNewProject(LIBRARIES,shell);
    IFolder patternFolder=this.createNewFoler(project,PATTERNS);
    this.copyFilesToFolder(PATTERN_PATH,true,patternFolder);
    IFolder sqlSourceFolder=this.createNewFoler(project,SOURCE_FILES);
    this.copyFilesToFolder(DEMO_PATH,true,sqlSourceFolder);
    project=this.createNewProject(METADATA,shell);
    this.createNewFoler(project,DB_CONNECTIONS);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    this.createNewFoler(project,ANALYSIS);
    this.createNewFoler(project,REPORTS);
    project=this.createNewProject(LIBRARIES,shell);
    IFolder patternFolder=this.createNewFoler(project,PATTERNS);
    IFolder sqlPatternFolder=this.createNewFoler(project,SQL_PATTERNS);
    this.copyFilesToFolder(PATTERN_PATH,true,patternFolder);
    IFolder sqlSourceFolder=this.createNewFoler(project,SOURCE_FILES);
    this.copyFilesToFolder(DEMO_PATH,true,sqlSourceFolder);
    project=this.createNewProject(METADATA,shell);
    this.createNewFoler(project,DB_CONNECTIONS);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}
Program: 140667
Project: 140667
Buggy source:
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider folderProvider=getConnectionParams().getFolderProvider();
    if (folderProvider == null) {
      folderProvider=new FolderProvider();
    }
    folderProvider.setFolderResource(defaultFolderProviderRes);
    getConnectionParams().setFolderProvider(folderProvider);
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  if (defaultFolderProviderRes != null) {
    FolderProvider folderProvider=getConnectionParams().getFolderProvider();
    if (folderProvider == null) {
      folderProvider=new FolderProvider();
    }
    if (folderProvider.getFolderResource() == null) {
      folderProvider.setFolderResource(defaultFolderProviderRes);
    }
    getConnectionParams().setFolderProvider(folderProvider);
  }
  super.setVisible(visible);
}
Program: 140668
Project: 140668
Buggy source:
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  for (  IResource res : getSelectedResources()) {
    if (res instanceof IFile) {
      IFile file=(IFile)res;
      if (file.getFileExtension().equals(FactoriesUtil.SQL)) {
        if (target instanceof IFolder) {
          IFolder folder=(IFolder)target;
          IPath path=new Path(DQStructureManager.LIBRARIES);
          path=path.append(DQStructureManager.SOURCE_FILES);
          IPath fullPath=folder.getFullPath();
          if (path.isPrefixOf(fullPath)) {
            dropSql=true;
            return Status.OK_STATUS;
          }
        }
      }
      if (!res.getName().endsWith(PluginConstant.ANA_SUFFIX)) {
        if (target instanceof IFile) {
          IFile tfile=(IFile)target;
          if (tfile.getFileExtension().equals(FactoriesUtil.REP)) {
            dropRep=true;
            return Status.OK_STATUS;
          }
        }
      }
    }
  }
  return Status.CANCEL_STATUS;
}

Fixed version (ground truth):
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  for (  IResource res : getSelectedResources()) {
    if (res instanceof IFile) {
      IFile file=(IFile)res;
      if (file.getFileExtension().equals(FactoriesUtil.SQL)) {
        if (target instanceof IFolder) {
          IFolder folder=(IFolder)target;
          IPath path=new Path(DQStructureManager.LIBRARIES);
          path=path.append(DQStructureManager.SOURCE_FILES);
          IPath fullPath=folder.getFullPath();
          if (path.isPrefixOf(fullPath)) {
            dropSql=true;
            return Status.OK_STATUS;
          }
        }
      }
      if (res.getName().endsWith(PluginConstant.ANA_SUFFIX)) {
        if (target instanceof IFile) {
          IFile tfile=(IFile)target;
          if (tfile.getFileExtension().equals(FactoriesUtil.REP)) {
            dropRep=true;
            return Status.OK_STATUS;
          }
        }
      }
    }
  }
  return Status.CANCEL_STATUS;
}
Program: 140670
Project: 140670
Buggy source:
@Override public void run(){
  if (page.isDirty()) {
    try {
      page.saveAnalysis();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  page.refreshChart(page.getManagedForm().getForm());
}

Fixed version (ground truth):
@Override public void run(){
  if (page == null) {
    AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor != null) {
      page=(ColumnMasterDetailsPage)editor.getMasterPage();
    }
  }
  if (page.isDirty()) {
    try {
      page.saveAnalysis();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  page.refreshChart(page.getManagedForm().getForm());
}
Program: 140671
Project: 140671
Buggy source:
public RefreshChartAction() throws Exception {
  super("String_Node_Str");
  AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null) {
    page=(ColumnMasterDetailsPage)editor.getMasterPage();
  }
 else {
    throw new Exception("String_Node_Str");
  }
}

Fixed version (ground truth):
public RefreshChartAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.SECTION_PREVIEW));
}
Program: 140672
Project: 140672
Buggy source:
public RunAnalysisAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.REFRESH_IMAGE));
  setDisabledImageDescriptor(ImageLib.getImageDescriptor(ImageLib.RUN_DISABLE));
}

Fixed version (ground truth):
public RunAnalysisAction(boolean toolbar){
  this();
  this.toolbar=toolbar;
}
Program: 140673
Project: 140673
Buggy source:
public static ImageDescriptor createStacked3DBarChart(String titile,CategoryDataset dataset){
  JFreeChart chart=ChartFactory.createStackedBarChart3D(null,null,"String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  CategoryPlot plot=chart.getCategoryPlot();
  BarRenderer renderer=(BarRenderer)plot.getRenderer();
  renderer.setSeriesPaint(0,Color.RED);
  renderer.setSeriesPaint(1,Color.GREEN);
  renderer.setBaseItemLabelsVisible(true);
  renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator("String_Node_Str",NumberFormat.getIntegerInstance(),new DecimalFormat("String_Node_Str")));
  renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER,TextAnchor.CENTER));
  NumberAxis axis=(NumberAxis)plot.getRangeAxis();
  axis.setNumberFormatOverride(NumberFormat.getPercentInstance());
  axis.setUpperMargin(0.05f);
  axis.setLowerMargin(0.01f);
  try {
    return ChartUtils.convertToImage(chart,CHART_WIDTH,CHART_HEIGHT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static ImageDescriptor createStacked3DBarChart(String titile,CategoryDataset dataset){
  JFreeChart chart=ChartFactory.createStackedBarChart3D(null,null,"String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  CategoryPlot plot=chart.getCategoryPlot();
  BarRenderer renderer=(BarRenderer)plot.getRenderer();
  renderer.setSeriesPaint(0,Color.GREEN);
  renderer.setSeriesPaint(1,Color.RED);
  renderer.setBaseItemLabelsVisible(true);
  renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator("String_Node_Str",NumberFormat.getIntegerInstance(),new DecimalFormat("String_Node_Str")));
  renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER,TextAnchor.CENTER));
  NumberAxis axis=(NumberAxis)plot.getRangeAxis();
  axis.setNumberFormatOverride(NumberFormat.getPercentInstance());
  axis.setUpperMargin(0.05f);
  axis.setLowerMargin(0.01f);
  try {
    return ChartUtils.convertToImage(chart,CHART_WIDTH,CHART_HEIGHT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 140674
Project: 140674
Buggy source:
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",label);
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",label);
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",label);
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",label);
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}