nus-yam/ex-repair huggingface dataset:
Program: 139203
Project: 139203
Buggy source:
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    String fileExtension=elementURI.fileExtension();
    IPath path=new Path(elementURI.toPlatformString(true));
    path=path.makeRelativeTo(PropertyHelper.getItemWorkspaceBasePath(fileExtension));
    path=path.removeLastSegments(1);
    property.getItem().getState().setPath(path.toString());
  }
  URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateProperty".
 * @param elementResource
 * @param propertyResource
 */
private void updateProperty(final Resource elementResource,Resource propertyResource){
  EList<EObject> contents=propertyResource.getContents();
  Property property=(Property)EcoreUtil.getObjectByType(contents,PropertiesPackage.eINSTANCE.getProperty());
  if (property != null) {
    URI elementURI=elementResource.getURI();
    IPath path=new Path(elementURI.toPlatformString(true));
    path=path.makeRelativeTo(PropertyHelper.getItemWorkspaceBasePath(property));
    path=path.removeLastSegments(1);
    property.getItem().getState().setPath(path.toString());
  }
  URI desUri=elementResource.getURI().trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  EMFSharedResources.getInstance().saveToUri(propertyResource,desUri.trimSegments(1));
}
Program: 139204
Project: 139204
Buggy source:
public void initPath(ItemRecord resource,String destination){
  this.resource=resource;
  if (resource != null) {
    IPath itemResPath=new Path(resource.getFile().getAbsolutePath());
    IPath propResPath=new Path(resource.getPropertyFilePath());
    Object propOBJ=retrieveEObject(propResPath,PropertiesPackage.eINSTANCE.getProperty());
    if (propOBJ != null) {
      Property property=(Property)propOBJ;
      InternalEObject author=(InternalEObject)property.getAuthor();
      if (author != null) {
        Resource projResource=author.eResource();
        if (projResource != null) {
          URI projectUri=projResource.getURI();
          IPath projectPath=new Path(projectUri.toFileString());
          if (projectPath.toFile().exists()) {
            Object projOBJ=retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
            if (projOBJ != null) {
              Project project=(Project)projOBJ;
              resource.setProjectName(project.getLabel());
            }
          }
        }
      }
      IPath itemDesPath=PropertyHelper.getElementPath(property);
      itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemDesPath).getLocation();
      IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
      resMap.put(itemResPath,itemDesPath);
      resMap.put(propResPath,propDesPath);
    }
  }
}

Fixed version (ground truth):
public void initPath(ItemRecord resource,String destination){
  this.resource=resource;
  if (resource != null) {
    IPath itemResPath=new Path(resource.getFile().getAbsolutePath());
    IPath propResPath=new Path(resource.getPropertyFilePath());
    Object propOBJ=EObjectHelper.retrieveEObject(propResPath,PropertiesPackage.eINSTANCE.getProperty());
    if (propOBJ != null) {
      Property property=(Property)propOBJ;
      InternalEObject author=(InternalEObject)property.getAuthor();
      if (author != null) {
        Resource projResource=author.eResource();
        if (projResource != null) {
          URI projectUri=projResource.getURI();
          IPath projectPath=new Path(projectUri.toFileString());
          if (projectPath.toFile().exists()) {
            Object projOBJ=EObjectHelper.retrieveEObject(projectPath,PropertiesPackage.eINSTANCE.getProject());
            if (projOBJ != null) {
              Project project=(Project)projOBJ;
              resource.setProjectName(project.getLabel());
            }
          }
        }
      }
      IPath itemDesPath=PropertyHelper.getElementPath(property);
      itemDesPath=ResourcesPlugin.getWorkspace().getRoot().getFile(itemDesPath).getLocation();
      IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
      resMap.put(itemResPath,itemDesPath);
      resMap.put(propResPath,propDesPath);
    }
  }
}
Program: 139205
Project: 139205
Buggy source:
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  if (!(target instanceof IResource)) {
    return Status.CANCEL_STATUS;
  }
  IResource targetRes=(IResource)target;
  for (  IResource res : getSelectedResources()) {
    if (res.getType() == IResource.FILE) {
      IFile sourceFile=(IFile)res;
switch (targetRes.getType()) {
case IResource.FOLDER:
        IFolder targetFolder=(IFolder)targetRes;
      if (ResourceService.allowDND(sourceFile,targetFolder)) {
        return Status.OK_STATUS;
      }
    break;
case IResource.FILE:
  IFile targetFile=(IFile)targetRes;
if (FactoriesUtil.isAnalysisFile(sourceFile.getFileExtension()) && FactoriesUtil.isReportFile(targetFile.getFileExtension())) {
  return Status.OK_STATUS;
}
break;
default :
break;
}
}
}
return Status.CANCEL_STATUS;
}

Fixed version (ground truth):
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  if (!(target instanceof IResource)) {
    return Status.CANCEL_STATUS;
  }
  IResource targetRes=(IResource)target;
  for (  IResource res : getSelectedResources()) {
    if (res.getType() == IResource.FILE) {
      IFile sourceFile=(IFile)res;
switch (targetRes.getType()) {
case IResource.FOLDER:
        IFolder targetFolder=(IFolder)targetRes;
      if (allowDND(sourceFile,targetFolder)) {
        return Status.OK_STATUS;
      }
    break;
case IResource.FILE:
  IFile targetFile=(IFile)targetRes;
if (FactoriesUtil.isAnalysisFile(sourceFile.getFileExtension()) && FactoriesUtil.isReportFile(targetFile.getFileExtension())) {
  return Status.OK_STATUS;
}
break;
default :
break;
}
}
}
return Status.CANCEL_STATUS;
}
Program: 139206
Project: 139206
Buggy source:
/** 
 * DOC bZhou Comment method "getOneFolder".
 * @param file
 * @return null if can't find.
 */
static IFolder getOneFolder(IFile file){
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getFolder".
 * @param name
 * @return
 */
public static IFolder getOneFolder(EResourceConstant constant){
}
Program: 139207
Project: 139207
Buggy source:
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  String absolutePath=file.getAbsolutePath();
  boolean tdqProject=false;
  File[] listFiles=file.listFiles();
  if (listFiles != null) {
    for (    File afile : listFiles) {
      if (StringUtils.equals(afile.getName(),"String_Node_Str")) {
        tdqProject=true;
        break;
      }
    }
  }
  return absolutePath.indexOf(EResourceConstant.DATA_PROFILING.getName()) > 0 || absolutePath.indexOf(EResourceConstant.LIBRARIES.getName()) > 0 || absolutePath.indexOf(EResourceConstant.METADATA.getName()) > 0 || StringUtils.equals(file.getName(),"String_Node_Str") || tdqProject;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  String absolutePath=file.getAbsolutePath();
  boolean tdqProject=false;
  File[] listFiles=file.listFiles();
  if (listFiles != null) {
    for (    File afile : listFiles) {
      if (StringUtils.equals(afile.getName(),"String_Node_Str")) {
        tdqProject=true;
        break;
      }
    }
  }
  return absolutePath.indexOf(EResourceConstant.DATA_PROFILING.getName()) > 0 || absolutePath.indexOf(EResourceConstant.LIBRARIES.getName()) > 0 || absolutePath.indexOf(EResourceConstant.METADATA.getName()) > 0 || StringUtils.equals(file.getName(),ReponsitoryContextBridge.PROJECT_DEFAULT_NAME) || tdqProject;
}
Program: 139208
Project: 139208
Buggy source:
public void write() throws IOException, CoreException {
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (!desFile.exists()) {
      FilesUtils.copyFile(resFile,desFile);
      String oldProjectLabel=resource.getProjectName() == null ? "String_Node_Str" : resource.getProjectName();
      String curProjectLabel=ResourceManager.getRootProjectName();
      if (!StringUtils.equals(oldProjectLabel,curProjectLabel)) {
        String content=FileUtils.readFileToString(desFile);
        content=StringUtils.replace(content,"String_Node_Str" + oldProjectLabel + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
        FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
      }
    }
 else {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void write() throws IOException, CoreException {
  for (  IPath resPath : resMap.keySet()) {
    File resFile=resPath.toFile();
    File desFile=resMap.get(resPath).toFile();
    if (!desFile.exists()) {
      FilesUtils.copyFile(resFile,desFile);
      String oldProjectLabel=resource.getProjectName() == null ? ReponsitoryContextBridge.PROJECT_DEFAULT_NAME : resource.getProjectName();
      String curProjectLabel=ResourceManager.getRootProjectName();
      if (!StringUtils.equals(oldProjectLabel,curProjectLabel)) {
        String content=FileUtils.readFileToString(desFile);
        content=StringUtils.replace(content,"String_Node_Str" + oldProjectLabel + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
        FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
      }
    }
 else {
      log.warn(desFile.getAbsoluteFile() + "String_Node_Str");
    }
  }
}
Program: 139210
Project: 139210
Buggy source:
private void updateOtherCombos(CCombo combo){
  rebuildRemainDBTypeList();
  Collection<CCombo> allCombos=tempExpressionMap.keySet();
  for (  CCombo cb : allCombos) {
    if (combo != cb) {
      String tx=cb.getText();
      cb.setItems(remainDBTypeList.toArray(new String[remainDBTypeList.size()]));
      cb.setText(tx);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "updateOtherCombos". MOD xqliu 2010-03-23 feature 11201
 * @param combo
 */
private void updateOtherCombos(CCombo combo){
  Collection<CCombo> allCombos=tempExpressionMap.keySet();
  for (  CCombo cb : allCombos) {
    if (combo != cb) {
      String tx=cb.getText();
      cb.setItems(allDBTypeList.toArray(new String[allDBTypeList.size()]));
      cb.setText(tx);
    }
  }
}
Program: 139212
Project: 139212
Buggy source:
/** 
 * DOC bZhou Comment method "creatNewLine". MOD mzhao feature 11128 Be able to add Java UDI, 2010-01-27
 * @param expression
 */
private void createNewLine(){
  final Composite lineComp=new Composite(expressionComp,SWT.NONE);
  lineComp.setLayout(new GridLayout(5,false));
  final CCombo combo=new CCombo(lineComp,SWT.BORDER);
  combo.setLayoutData(new GridData());
  ((GridData)combo.getLayoutData()).widthHint=150;
  combo.setEditable(false);
  combo.setItems(allDBTypeList.toArray(new String[allDBTypeList.size()]));
  combo.select(0);
  combo.addSelectionListener(new LangCombSelectionListener());
  createDbVersionText(combo,lineComp,null,30);
  Expression expression=BooleanExpressionHelper.createExpression(combo.getText(),null);
  tempExpressionMap.put(combo,expression);
  if (combo.getText().equals(PatternLanguageType.JAVA.getName())) {
    updateLineForJava(combo);
  }
 else {
    updateLineForExpression(combo);
  }
  updateOtherCombos(combo);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "creatNewLine". MOD mzhao feature 11128 Be able to add Java UDI, 2010-01-27
 * @param expression
 */
private void createNewLine(){
  final Composite lineComp=new Composite(expressionComp,SWT.NONE);
  lineComp.setLayout(new GridLayout(5,false));
  final CCombo combo=new CCombo(lineComp,SWT.BORDER);
  combo.setLayoutData(new GridData());
  ((GridData)combo.getLayoutData()).widthHint=150;
  combo.setEditable(false);
  combo.setItems(allDBTypeList.toArray(new String[allDBTypeList.size()]));
  combo.select(0);
  combo.addSelectionListener(new LangCombSelectionListener());
  createDbVersionText(combo,lineComp,null,30);
  Expression expression=BooleanExpressionHelper.createExpression(combo.getText(),null);
  tempExpressionMap.put(combo,expression);
  if (combo.getText().equals(PatternLanguageType.JAVA.getName())) {
    updateLineForJava(combo);
  }
 else {
    updateLineForExpression(combo,expression);
  }
  updateOtherCombos(combo);
}
Program: 139213
Project: 139213
Buggy source:
private void createAddButton(final Composite parent){
  final Button addButton=new Button(parent,SWT.NONE);
  addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
  addButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.widthHint=65;
  addButton.setLayoutData(labelGd);
  addButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      rebuildRemainDBTypeList();
      createNewLine();
      definitionSection.setExpanded(true);
      setDirty(true);
    }
  }
);
}

Fixed version (ground truth):
private void createAddButton(final Composite parent){
  final Button addButton=new Button(parent,SWT.NONE);
  addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
  addButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.widthHint=65;
  addButton.setLayoutData(labelGd);
  addButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      createNewLine();
      definitionSection.setExpanded(true);
      setDirty(true);
    }
  }
);
}
Program: 139215
Project: 139215
Buggy source:
public void widgetSelected(SelectionEvent e){
  rebuildRemainDBTypeList();
  createNewLine();
  definitionSection.setExpanded(true);
  setDirty(true);
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  createNewLine();
  definitionSection.setExpanded(true);
  setDirty(true);
}
Program: 139216
Project: 139216
Buggy source:
private void updateLineForExpression(final CCombo combo){
  Composite detailComp=widgetMap.get(combo);
  if (detailComp != null) {
    detailComp.dispose();
  }
  detailComp=new Composite(combo.getParent(),SWT.NONE);
  widgetMap.put(combo,detailComp);
  detailComp.setLayout(new GridLayout(3,false));
  final Text patternText=new Text(detailComp,SWT.BORDER);
  patternText.setLayoutData(new GridData(GridData.FILL_BOTH));
  ((GridData)patternText.getLayoutData()).widthHint=600;
  patternText.addModifyListener(new ExpressTextModListener(combo));
  createExpressionEditButton(detailComp,patternText);
  createExpressionDelButton(detailComp,combo);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(detailComp);
  detailComp.getParent().layout();
  definitionSection.setExpanded(false);
  definitionSection.setExpanded(true);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "updateLineForExpression". // MOD xqliu 2010-03-23 feature 11201
 * @param combo
 * @param expression
 */
private void updateLineForExpression(final CCombo combo,Expression expression){
  Composite detailComp=widgetMap.get(combo);
  if (detailComp != null) {
    detailComp.dispose();
  }
  detailComp=new Composite(combo.getParent(),SWT.NONE);
  widgetMap.put(combo,detailComp);
  detailComp.setLayout(new GridLayout(3,false));
  final Text patternText=new Text(detailComp,SWT.BORDER);
  patternText.setLayoutData(new GridData(GridData.FILL_BOTH));
  ((GridData)patternText.getLayoutData()).widthHint=600;
  patternText.addModifyListener(new ExpressTextModListener(combo));
  patternText.setText(expression.getBody() == null ? "String_Node_Str" : expression.getBody());
  createExpressionEditButton(detailComp,patternText);
  createExpressionDelButton(detailComp,combo);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(detailComp);
  detailComp.getParent().layout();
  definitionSection.setExpanded(false);
  definitionSection.setExpanded(true);
}
Program: 139217
Project: 139217
Buggy source:
/** 
 * DOC bZhou Comment method "createPatternDefinitionComp". MOD mzhao feature 11128 Be able to add Java UDI, 2010-01-27
 * @param definitionSection
 * @return
 */
private Composite createDefinitionComp(Composite definitionSection){
  Composite composite=toolkit.createComposite(definitionSection);
  composite.setLayout(new GridLayout());
  expressionComp=new Composite(composite,SWT.NONE);
  expressionComp.setLayout(new GridLayout());
  expressionComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  addTitleComp(expressionComp);
  if (tempExpressionMap.size() == 0) {
    if (definition != null) {
      EList<Expression> expList=definition.getSqlGenericExpression();
      for (      Expression expression : expList) {
        createNewLineWithExpression(expression);
      }
      createNewLineWithJavaUDI();
    }
  }
  createAddButton(composite);
  return composite;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createPatternDefinitionComp". MOD mzhao feature 11128 Be able to add Java UDI, 2010-01-27
 * @param definitionSection
 * @return
 */
private Composite createDefinitionComp(Composite definitionSection){
  Composite composite=toolkit.createComposite(definitionSection);
  composite.setLayout(new GridLayout());
  expressionComp=new Composite(composite,SWT.NONE);
  expressionComp.setLayout(new GridLayout());
  expressionComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  addTitleComp(expressionComp);
  if (tempExpressionMap.size() == 0) {
    if (definition != null) {
      for (      Expression expression : tempExpressionList) {
        createNewLineWithExpression(expression);
      }
      createNewLineWithJavaUDI();
    }
  }
  createAddButton(composite);
  return composite;
}
Program: 139219
Project: 139219
Buggy source:
/** 
 * DOC xqliu Comment method "isMdmConnection".
 * @param connection
 * @return
 */
public static boolean isMdmConnection(TdProviderConnection connection){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.DBTYPE,connection.getTaggedValue());
  if (tv != null) {
    return SupportDBUrlType.MDM.getDBKey().equals(tv.getValue());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "isMdmConnection".
 * @param connection
 * @return
 */
public static boolean isMdmConnection(DataProvider dataprovider){
  ProviderConnection providerConnection=DataProviderHelper.getTdProviderConnection(dataprovider).getObject();
  if (providerConnection != null) {
    return isMdmConnection(providerConnection);
  }
  return false;
}
Program: 139222
Project: 139222
Buggy source:
/** 
 * DOC bZhou Comment method "decorateCategoryPlot".
 * @param chart
 */
public static void decorateCategoryPlot(JFreeChart chart){
  CategoryPlot plot=chart.getCategoryPlot();
  CategoryItemRenderer render=plot.getRenderer();
  CategoryAxis domainAxis=plot.getDomainAxis();
  ValueAxis valueAxis=plot.getRangeAxis();
  Font font=new Font("String_Node_Str",Font.BOLD,BASE_ITEM_LABEL_SIZE);
  render.setBaseItemLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  domainAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  valueAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_TICK_LABEL_SIZE);
  domainAxis.setTickLabelFont(font);
  valueAxis.setTickLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_LEGEND_LABEL_SIZE);
  LegendTitle legend=chart.getLegend();
  if (legend != null) {
    legend.setItemFont(font);
  }
  font=new Font("String_Node_Str",Font.BOLD,BASE_TITLE_LABEL_SIZE);
  TextTitle title=chart.getTitle();
  if (title != null) {
    title.setFont(font);
  }
  font=null;
  if (render instanceof BarRenderer) {
    int rowCount=chart.getCategoryPlot().getDataset().getRowCount();
    domainAxis.setTickLabelFont(new Font("String_Node_Str",Font.PLAIN,10));
    domainAxis.setUpperMargin(0.1);
    domainAxis.setMaximumCategoryLabelLines(2);
    ((BarRenderer)render).setItemMargin(-0.50 * rowCount);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "decorateCategoryPlot".
 * @param chart
 */
public static void decorateCategoryPlot(JFreeChart chart){
  CategoryPlot plot=chart.getCategoryPlot();
  CategoryItemRenderer render=plot.getRenderer();
  CategoryAxis domainAxis=plot.getDomainAxis();
  ValueAxis valueAxis=plot.getRangeAxis();
  Font font=new Font("String_Node_Str",Font.BOLD,BASE_ITEM_LABEL_SIZE);
  render.setBaseItemLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  domainAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.BOLD,BASE_LABEL_SIZE);
  valueAxis.setLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_TICK_LABEL_SIZE);
  domainAxis.setTickLabelFont(font);
  valueAxis.setTickLabelFont(font);
  font=new Font("String_Node_Str",Font.PLAIN,BASE_LEGEND_LABEL_SIZE);
  LegendTitle legend=chart.getLegend();
  if (legend != null) {
    legend.setItemFont(font);
  }
  font=new Font("String_Node_Str",Font.BOLD,BASE_TITLE_LABEL_SIZE);
  TextTitle title=chart.getTitle();
  if (title != null) {
    title.setFont(font);
  }
  font=null;
  if (render instanceof BarRenderer) {
    int rowCount=chart.getCategoryPlot().getDataset().getRowCount();
    domainAxis.setTickLabelFont(new Font("String_Node_Str",Font.PLAIN,10));
    domainAxis.setUpperMargin(0.1);
    domainAxis.setMaximumCategoryLabelLines(3);
    ((BarRenderer)render).setItemMargin(-0.50 * rowCount);
  }
}
Program: 139223
Project: 139223
Buggy source:
@Override public void create(){
  super.create();
  getShell().setText(TITLE);
  boolean isBlock=Platform.getPreferencesService().getBoolean(CorePlugin.PLUGIN_ID,WebBrowserPreferencePage.BLOCK_WEB_BROWSER,true,new IScopeContext[]{new InstanceScope()});
  if (!isBlock) {
    showHelp();
  }
}

Fixed version (ground truth):
@Override public void create(){
  super.create();
  getShell().setText(TITLE);
  if (!DQPreferenceManager.isBlockWeb()) {
    showHelp();
  }
}
Program: 139224
Project: 139224
Buggy source:
public void openIndicatorSelectDialog(Shell shell){
  final IndicatorSelectDialog dialog=new IndicatorSelectDialog(shell,DefaultMessagesImpl.getString("String_Node_Str"),modelElementIndicators);
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    @Override public void shellActivated(    ShellEvent e){
      dialog.getShell().setFocus();
      IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorSelectorHelpContextID());
      PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
    }
  }
);
  if (dialog.open() == Window.OK) {
    ModelElementIndicator[] result=dialog.getResult();
    for (    ModelElementIndicator modelElementIndicator : result) {
      modelElementIndicator.storeTempIndicator();
    }
    this.setElements(result);
    return;
  }
}

Fixed version (ground truth):
public void openIndicatorSelectDialog(Shell shell){
  final IndicatorSelectDialog dialog=new IndicatorSelectDialog(shell,DefaultMessagesImpl.getString("String_Node_Str"),modelElementIndicators);
  dialog.create();
  if (!DQPreferenceManager.isBlockWeb()) {
    dialog.getShell().addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent e){
        dialog.getShell().setFocus();
        IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorSelectorHelpContextID());
        PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
      }
    }
);
  }
  if (dialog.open() == Window.OK) {
    ModelElementIndicator[] result=dialog.getResult();
    for (    ModelElementIndicator modelElementIndicator : result) {
      modelElementIndicator.storeTempIndicator();
    }
    this.setElements(result);
    return;
  }
}
Program: 139225
Project: 139225
Buggy source:
/** 
 * DOC bZhou Comment method "showHelp".
 */
public void showHelp(){
  boolean isBlock=Platform.getPreferencesService().getBoolean(CorePlugin.PLUGIN_ID,WebBrowserPreferencePage.BLOCK_WEB_BROWSER,true,new IScopeContext[]{new InstanceScope()});
  if (isValidHref(href) && !isBlock) {
    if (getTray() == null) {
      openTray(new HelpTray());
    }
    ((HelpTray)getTray()).getHelpPart().showURL(href);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "showHelp".
 */
public void showHelp(){
  if (isValidHref(href) && !DQPreferenceManager.isBlockWeb()) {
    if (getTray() == null) {
      openTray(new HelpTray());
    }
    ((HelpTray)getTray()).getHelpPart().showURL(href);
  }
}
Program: 139226
Project: 139226
Buggy source:
private void createSimpleStatistics(final ScrolledForm form,final Composite composite,final ColumnSetMultiValueIndicator columnSetMultiValueIndicator){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  dataset.addValue(columnSetMultiValueIndicator.getRowCountIndicator().getCount(),DefaultMessagesImpl.getString("String_Node_Str"),"String_Node_Str");
  dataset.addValue(columnSetMultiValueIndicator.getDistinctCountIndicator().getDistinctValueCount(),DefaultMessagesImpl.getString("String_Node_Str"),"String_Node_Str");
  dataset.addValue(columnSetMultiValueIndicator.getDuplicateCountIndicator().getDuplicateValueCount(),DefaultMessagesImpl.getString("String_Node_Str"),"String_Node_Str");
  dataset.addValue(columnSetMultiValueIndicator.getUniqueCountIndicator().getUniqueValueCount(),DefaultMessagesImpl.getString("String_Node_Str"),"String_Node_Str");
  JFreeChart chart=TopChartFactory.createBarChart(DefaultMessagesImpl.getString("String_Node_Str"),dataset,true);
  if (chart != null) {
    Plot plot=chart.getPlot();
    if (plot instanceof CategoryPlot) {
      ChartDecorator.decorateCategoryPlot(chart);
      ((CategoryPlot)plot).getRenderer().setSeriesPaint(0,ChartDecorator.IndiBindColor.INDICATOR_ROW_COUNT.getColor());
      ((CategoryPlot)plot).getRenderer().setSeriesPaint(1,ChartDecorator.IndiBindColor.INDICATOR_DISTINCT_COUNT.getColor());
      ((CategoryPlot)plot).getRenderer().setSeriesPaint(2,ChartDecorator.IndiBindColor.INDICATOR_UNIQUE_COUNT.getColor());
      ((CategoryPlot)plot).getRenderer().setSeriesPaint(3,ChartDecorator.IndiBindColor.INDICATOR_DUPLICATE_COUNT.getColor());
    }
  }
  ChartComposite chartComp=new ChartComposite(composite,SWT.NONE,chart);
  chartComp.setLayoutData(new GridData(GridData.FILL_BOTH));
}

Fixed version (ground truth):
private void createSimpleStatistics(final ScrolledForm form,final Composite composite){
  List<IndicatorUnit> units=new ArrayList<IndicatorUnit>();
  units.add(new IndicatorUnit(IndicatorEnum.RowCountIndicatorEnum,simpleStatIndicator.getRowCountIndicator(),null));
  units.add(new IndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum,simpleStatIndicator.getDistinctCountIndicator(),null));
  units.add(new IndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum,simpleStatIndicator.getDuplicateCountIndicator(),null));
  units.add(new IndicatorUnit(IndicatorEnum.UniqueIndicatorEnum,simpleStatIndicator.getUniqueCountIndicator(),null));
  IChartTypeStates chartTypeState=ChartTypeStatesOperator.getChartState(EIndicatorChartType.SIMPLE_STATISTICS,units);
  JFreeChart chart=chartTypeState.getChart();
  ChartDecorator.decorate(chart);
  if (chart != null) {
    ChartComposite cc=new ChartComposite(composite,SWT.NONE,chart,true);
    GridData gd=new GridData();
    gd.widthHint=PluginConstant.CHART_STANDARD_WIDHT;
    gd.heightHint=PluginConstant.CHART_STANDARD_HEIGHT;
    cc.setLayoutData(gd);
  }
}
Program: 139227
Project: 139227
Buggy source:
public void createPreviewCharts(final ScrolledForm form,final Composite parentComp,final boolean isCreate){
  Section previewSection=createSection(form,parentComp,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  previewSection.setLayoutData(new GridData(480,300));
  Composite sectionClient=toolkit.createComposite(previewSection);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite simpleComposite=toolkit.createComposite(sectionClient);
  simpleComposite.setLayout(new GridLayout(1,true));
  simpleComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSimpleStatistics(form,simpleComposite,getSimpleStatIndicator());
  previewSection.setClient(sectionClient);
}

Fixed version (ground truth):
public void createPreviewCharts(final ScrolledForm form,final Composite parentComp,final boolean isCreate){
  Section previewSection=createSection(form,parentComp,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite sectionClient=toolkit.createComposite(previewSection);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite simpleComposite=toolkit.createComposite(sectionClient);
  simpleComposite.setLayout(new GridLayout(1,true));
  simpleComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSimpleStatistics(form,simpleComposite);
  previewSection.setClient(sectionClient);
}
Program: 139228
Project: 139228
Buggy source:
private Section createTableSectionPart(Composite parentComp,String title,ColumnSetMultiValueIndicator columnSetMultiIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  table.setLayoutData(new GridData(GridData.FILL_BOTH));
  List<String> tableColumnNames=columnSetMultiIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=columnSetMultiIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  return columnSetElementSection;
}

Fixed version (ground truth):
private Section createTableSectionPart(Composite parentComp,String title,ColumnSetMultiValueIndicator columnSetMultiIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  List<String> tableColumnNames=columnSetMultiIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=columnSetMultiIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  setupTableGridDataLimitedSize(table,tableRows.size());
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  return columnSetElementSection;
}
Program: 139229
Project: 139229
Buggy source:
private Section createSimpleStatisticsPart(Composite parentComp,String title,SimpleStatIndicator simpleStatIndicator){
  Section section=createSection(form,parentComp,title,DefaultMessagesImpl.getString("String_Node_Str"));
  section.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite sectionClient=toolkit.createComposite(section);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.TOP).applyTo(sectionClient);
  Composite simpleComposite=toolkit.createComposite(sectionClient);
  simpleComposite.setLayout(new GridLayout(2,true));
  simpleComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSimpleTable2(form,simpleComposite,simpleStatIndicator);
  section.setClient(sectionClient);
  return section;
}

Fixed version (ground truth):
private Section createSimpleStatisticsPart(Composite parentComp,String title,SimpleStatIndicator simpleStatIndicator){
  Section section=createSection(form,parentComp,title,null);
  section.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite sectionClient=toolkit.createComposite(section);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.TOP).applyTo(sectionClient);
  Composite simpleComposite=toolkit.createComposite(sectionClient);
  simpleComposite.setLayout(new GridLayout(2,true));
  simpleComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  createSimpleTable2(form,simpleComposite,simpleStatIndicator);
  section.setClient(sectionClient);
  return section;
}
Program: 139230
Project: 139230
Buggy source:
private Section createTableSectionPart(Composite parentComp,String title,SimpleStatIndicator ssIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  table.setLayoutData(new GridData(GridData.FILL_BOTH));
  List<String> tableColumnNames=ssIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=ssIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  return columnSetElementSection;
}

Fixed version (ground truth):
private Section createTableSectionPart(Composite parentComp,String title,SimpleStatIndicator ssIndicator){
  Section columnSetElementSection=this.createSection(form,parentComp,title,null);
  Composite sectionTableComp=toolkit.createComposite(columnSetElementSection);
  sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  sectionTableComp.setLayout(new GridLayout());
  TableViewer columnsElementViewer=new TableViewer(sectionTableComp,SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=columnsElementViewer.getTable();
  List<String> tableColumnNames=ssIndicator.getColumnHeaders();
  for (  String tableColumnName : tableColumnNames) {
    final TableColumn columnHeader=new TableColumn(table,SWT.NONE);
    columnHeader.setText(tableColumnName);
  }
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableSectionViewerProvider provider=new TableSectionViewerProvider();
  List<Object[]> tableRows=ssIndicator.getListRows();
  columnsElementViewer.setContentProvider(provider);
  columnsElementViewer.setLabelProvider(provider);
  columnsElementViewer.setInput(tableRows);
  for (int i=0; i < tableColumnNames.size(); i++) {
    table.getColumn(i).pack();
  }
  columnSetElementSection.setClient(sectionTableComp);
  setupTableGridDataLimitedSize(table,tableRows.size());
  addColumnSorters(columnsElementViewer,table.getColumns(),this.buildSorter(tableRows));
  return columnSetElementSection;
}
Program: 139233
Project: 139233
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());
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);
      outOfRange=!StringUtils.equals(value,expectedValue);
      if (ignoreCaseOption) {
        outOfRange=!(ignoreCaseOption && StringUtils.equalsIgnoreCase(value,expectedValue));
      }
    }
  break;
default :
outOfRange=checkRange(inputValue);
}
}
return outOfRange;
}
Program: 139234
Project: 139234
Buggy source:
public boolean isMdmFlag(){
  return mdmFlag;
}

Fixed version (ground truth):
private boolean isMdmFlag(){
  FolderProvider folderProvider=connectionParam.getFolderProvider();
  return folderProvider != null && ResourceManager.isMdmConnectionFolder(folderProvider.getFolderResource());
}
Program: 139235
Project: 139235
Buggy source:
/** 
 * Constructor for DatabaseWizard. Analyse Iselection to extract DatabaseConnection and the pathToSave. Start the Lock Strategy.
 * @param selection
 * @param existingNames
 */
public DatabaseConnectionWizard(DBConnectionParameter connectionParam){
  this.connectionParam=connectionParam;
  mdmFlag=ResourceManager.isMdmConnectionFolder(connectionParam.getFolderProvider().getFolderResource());
}

Fixed version (ground truth):
/** 
 * Constructor for DatabaseWizard. Analyse Iselection to extract DatabaseConnection and the pathToSave. Start the Lock Strategy.
 * @param selection
 * @param existingNames
 */
public DatabaseConnectionWizard(DBConnectionParameter connectionParam){
  this.connectionParam=connectionParam;
}
Program: 139236
Project: 139236
Buggy source:
/** 
 * Adding the page to the wizard and set Title, Description and PageComplete.
 */
public void addPages(){
  String winTitle=mdmFlag ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  setWindowTitle(winTitle);
  setDefaultPageImageDescriptor(ImageLib.getImageDescriptor(ImageLib.REFRESH_IMAGE));
  propertiesWizardPage=new DatabaseMetadataWizardPage();
  databaseWizardPage=new DatabaseWizardPage();
  databaseWizardPage.setMdmFlag(mdmFlag);
  String propTitle=mdmFlag ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  String propDesc=DefaultMessagesImpl.getString("String_Node_Str");
  propertiesWizardPage.setTitle(propTitle);
  propertiesWizardPage.setDescription(propDesc);
  propertiesWizardPage.setPageComplete(false);
  String dataTitle=mdmFlag ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  String dataDesc=mdmFlag ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  databaseWizardPage.setTitle(dataTitle);
  databaseWizardPage.setDescription(dataDesc);
  try {
    addPage(propertiesWizardPage);
    addPage(databaseWizardPage);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard and set Title, Description and PageComplete.
 */
public void addPages(){
  String winTitle=isMdmFlag() ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  setWindowTitle(winTitle);
  setDefaultPageImageDescriptor(ImageLib.getImageDescriptor(ImageLib.REFRESH_IMAGE));
  propertiesWizardPage=new DatabaseMetadataWizardPage();
  databaseWizardPage=new DatabaseWizardPage();
  databaseWizardPage.setMdmFlag(isMdmFlag());
  String propTitle=isMdmFlag() ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  String propDesc=DefaultMessagesImpl.getString("String_Node_Str");
  propertiesWizardPage.setTitle(propTitle);
  propertiesWizardPage.setDescription(propDesc);
  propertiesWizardPage.setPageComplete(false);
  String dataTitle=isMdmFlag() ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  String dataDesc=isMdmFlag() ? DefaultMessagesImpl.getString("String_Node_Str") : DefaultMessagesImpl.getString("String_Node_Str");
  databaseWizardPage.setTitle(dataTitle);
  databaseWizardPage.setDescription(dataDesc);
  try {
    addPage(propertiesWizardPage);
    addPage(databaseWizardPage);
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 139238
Project: 139238
Buggy source:
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator
 * @return
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    double userCount=Double.valueOf(getIndicatorValue(indicator));
    double count=Double.valueOf(indicator.getCount());
    return computePercent(userCount,count);
  }
 catch (  NullPointerException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator, never null
 * @return null in case of error
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    double userCount=NumberFormat.getInstance().parse(getIndicatorValue(indicator)).doubleValue();
    double count=Double.valueOf(indicator.getCount());
    return computePercent(userCount,count);
  }
 catch (  NumberFormatException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
    return null;
  }
catch (  ParseException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
    return null;
  }
}
Program: 139239
Project: 139239
Buggy source:
private static String createStandardNumber(Object input){
  DecimalFormat format=(DecimalFormat)DecimalFormat.getNumberInstance();
  format.applyPattern("String_Node_Str");
  try {
    return format.format(new Double(input.toString()));
  }
 catch (  Exception ne) {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private static String createStandardNumber(Object input){
  return NumberFormat.getInstance().format(input);
}
Program: 139240
Project: 139240
Buggy source:
/** 
 * Method "getAnalyzedTable".
 * @param indicator
 * @return the table name (within quotes)
 */
private String getAnalyzedTable(Indicator indicator){
  return quote(this.catalogOrSchema) + dbms().getDelimiter() + quote(indicator.getAnalyzedElement().getName());
}

Fixed version (ground truth):
/** 
 * Method "getAnalyzedTable".
 * @param indicator
 * @return the table name (within quotes)
 */
private String getAnalyzedTable(Indicator indicator){
  String analyzedTableName=null;
  ColumnSet columnSetOwner=(ColumnSet)indicator.getAnalyzedElement();
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + indicator.getName());
  }
 else {
    String schemaName=getQuotedSchemaName(columnSetOwner);
    String table=quote(columnSetOwner.getName());
    String catalogName=getQuotedCatalogName(columnSetOwner);
    if (catalogName == null && schemaName != null) {
      final TdSchema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
      final TdCatalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
      catalogName=parentCatalog != null ? parentCatalog.getName() : null;
    }
    analyzedTableName=dbms().toQualifiedName(catalogName,schemaName,table);
  }
  return analyzedTableName;
}
Program: 139241
Project: 139241
Buggy source:
/** 
 * DOC bZhou Comment method "getPropertyFile".
 * @param resource
 * @return
 */
private IFile getPropertyFile(Resource resource){
  if (resource != null) {
    EList<EObject> modelElements=resource.getContents();
    ModelElement modelElement=(ModelElement)EcoreUtil.getObjectByType(modelElements,CorePackage.eINSTANCE.getModelElement());
    if (modelElement != null) {
      String propertyPath=MetadataHelper.getPropertyPath(modelElement);
      return (IFile)ResourcesPlugin.getWorkspace().getRoot().findMember(propertyPath);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getPropertyFile".
 * @param resource
 * @return
 */
private IFile getPropertyFile(Resource resource){
  if (resource != null) {
    EList<EObject> modelElements=resource.getContents();
    ModelElement modelElement=(ModelElement)EcoreUtil.getObjectByType(modelElements,CorePackage.eINSTANCE.getModelElement());
    if (modelElement != null) {
      String propertyPath=MetadataHelper.getPropertyPath(modelElement);
      if (propertyPath != null) {
        return (IFile)ResourcesPlugin.getWorkspace().getRoot().findMember(propertyPath);
      }
    }
  }
  return null;
}