nus-yam/ex-repair huggingface dataset:
Program: 139927
Project: 139927
Buggy source:
/** 
 * Creates a new project resource with the special name.MOD mzhao 2009-03-18 make this method as public.For  {@link org.talend.dataprofiler.core.migration.impl.TDCPFolderMergeTask} use.
 * @return the created project resource, or <code>null</code> if the project was not created
 * @throws InterruptedException
 * @throws InvocationTargetException
 * @throws CoreException
 */
public IProject createNewProject(String projectName,Shell shell) throws InvocationTargetException, InterruptedException, CoreException {
  final Shell currentShell=shell;
  final IProject newProjectHandle=ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  final IProjectDescription description=workspace.newProjectDescription(newProjectHandle.getName());
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      CreateProjectOperation op=new CreateProjectOperation(description,DefaultMessagesImpl.getString("String_Node_Str"));
      try {
        PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op,monitor,WorkspaceUndoUtil.getUIInfoAdapter(currentShell));
      }
 catch (      ExecutionException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  if (!newProjectHandle.exists()) {
    ProgressUI.popProgressDialog(op,shell);
  }
  newProjectHandle.setPersistentProperty(PROJECT_TDQ_KEY,PROJECT_TDQ_PROPERTY);
  return newProjectHandle;
}

Fixed version (ground truth):
/** 
 * Creates a new project resource with the special name.MOD mzhao 2009-03-18 make this method as public.For  {@link org.talend.dataprofiler.core.migration.impl.TDCPFolderMergeTask} use.
 * @return the created project resource, or <code>null</code> if the project was not created
 * @throws InterruptedException
 * @throws InvocationTargetException
 * @throws CoreException
 */
public IProject createNewProject(String projectName) throws InvocationTargetException, InterruptedException, CoreException {
  final IProject newProjectHandle=ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  final IProjectDescription description=workspace.newProjectDescription(newProjectHandle.getName());
  IRunnableWithProgress op=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException {
      CreateProjectOperation op=new CreateProjectOperation(description,DefaultMessagesImpl.getString("String_Node_Str"));
      try {
        PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op,monitor,WorkspaceUndoUtil.getUIInfoAdapter(null));
      }
 catch (      ExecutionException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  if (!newProjectHandle.exists()) {
    ProgressUI.popProgressDialog(op);
  }
  newProjectHandle.setPersistentProperty(PROJECT_TDQ_KEY,PROJECT_TDQ_PROPERTY);
  return newProjectHandle;
}
Program: 139929
Project: 139929
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException {
  CreateProjectOperation op=new CreateProjectOperation(description,DefaultMessagesImpl.getString("String_Node_Str"));
  try {
    PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op,monitor,WorkspaceUndoUtil.getUIInfoAdapter(currentShell));
  }
 catch (  ExecutionException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException {
  CreateProjectOperation op=new CreateProjectOperation(description,DefaultMessagesImpl.getString("String_Node_Str"));
  try {
    PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op,monitor,WorkspaceUndoUtil.getUIInfoAdapter(null));
  }
 catch (  ExecutionException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 139935
Project: 139935
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem item=tree.getSelection()[0];
  if (item != null) {
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object columnobj=item.getData(COLUMN_INDICATOR_KEY);
    if (columnobj != null && indicatorobj == null) {
      openIndicatorSelectDialog(null);
    }
 else     if (columnobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] selection=tree.getSelection();
  if (selection.length == 0) {
    return;
  }
  TreeItem item=selection[0];
  if (item != null) {
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object columnobj=item.getData(COLUMN_INDICATOR_KEY);
    if (columnobj != null && indicatorobj == null) {
      openIndicatorSelectDialog(null);
    }
 else     if (columnobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}
Program: 139936
Project: 139936
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  String s="String_Node_Str";
  Label nameLab=new Label(container,SWT.NONE);
  if (type != null) {
switch (type) {
case SQL_LIKE:
      s="String_Node_Str";
default :
  }
}
nameLab.setText(s);
expressionText=new Text(container,SWT.BORDER);
expressionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(container);
expressionText.setText(expression == null ? PluginConstant.EMPTY_STRING : expression);
nameLab=new Label(container,SWT.NONE);
nameLab.setText(DefaultMessagesImpl.getString("String_Node_Str"));
String[] types=PatternLanguageType.getAllLanguageTypes();
comboLang=new Combo(container,SWT.BORDER);
comboLang.setItems(types);
comboLang.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (types.length > 0 && language == null) {
  comboLang.setText(PatternLanguageType.ALL_DATABASE_TYPE.getName());
  PatternParameter parameter=(PatternParameter)getParameter();
  parameter.setLanguage(PatternLanguageType.ALL_DATABASE_TYPE.getName());
}
 else {
  comboLang.setText(language);
}
addHelpSurpport();
addListeners();
if (!checkFieldsValue()) {
  this.setPageComplete(false);
}
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  String s="String_Node_Str";
  Label nameLab=new Label(container,SWT.NONE);
  if (type != null) {
switch (type) {
case SQL_LIKE:
      s="String_Node_Str";
default :
  }
}
nameLab.setText(s);
expressionText=new Text(container,SWT.BORDER);
expressionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(container);
expressionText.setText(expression == null ? PluginConstant.EMPTY_STRING : expression);
nameLab=new Label(container,SWT.NONE);
nameLab.setText(DefaultMessagesImpl.getString("String_Node_Str"));
String[] types=PatternLanguageType.getAllLanguageTypes();
comboLang=new Combo(container,SWT.BORDER);
comboLang.setItems(types);
comboLang.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (types.length > 0 && language == null) {
  language=PatternLanguageType.ALL_DATABASE_TYPE.getName();
}
comboLang.setText(language);
PatternParameter parameter=(PatternParameter)getParameter();
parameter.setLanguage(language);
parameter.setExpression(expression);
addHelpSurpport();
addListeners();
if (!checkFieldsValue()) {
  this.setPageComplete(false);
}
}
Program: 139937
Project: 139937
Buggy source:
@Override public void run(){
  PatternParameter parameter=new PatternParameter();
  FolderProvider folderProvider=new FolderProvider();
  folderProvider.setFolderResource(folder);
  parameter.setFolderProvider(folderProvider);
  CreatePatternWizard fileWizard;
  if (this.expression != null && this.lanuage != null) {
    fileWizard=(CreatePatternWizard)WizardFactory.createPatternWizard(type,parameter,expression,lanuage);
  }
 else {
    fileWizard=(CreatePatternWizard)WizardFactory.createPatternWizard(type,parameter);
  }
  IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
  IHelpResource[] relatedTopics=context.getRelatedTopics();
  String href=relatedTopics[0].getHref();
switch (type) {
case SQL_LIKE:
    href=relatedTopics[1].getHref();
  break;
default :
break;
}
WizardDialog dialog=new OpeningHelpWizardDialog(Display.getDefault().getActiveShell(),fileWizard,href);
fileWizard.setWindowTitle(getText());
dialog.open();
}

Fixed version (ground truth):
@Override public void run(){
  if (folder.exists()) {
    PatternParameter parameter=new PatternParameter();
    FolderProvider folderProvider=new FolderProvider();
    folderProvider.setFolderResource(folder);
    parameter.setFolderProvider(folderProvider);
    CreatePatternWizard fileWizard;
    if (this.expression != null && this.lanuage != null) {
      fileWizard=(CreatePatternWizard)WizardFactory.createPatternWizard(type,parameter,expression,lanuage);
    }
 else {
      fileWizard=(CreatePatternWizard)WizardFactory.createPatternWizard(type,parameter);
    }
    IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
    IHelpResource[] relatedTopics=context.getRelatedTopics();
    String href=relatedTopics[0].getHref();
switch (type) {
case SQL_LIKE:
      href=relatedTopics[1].getHref();
    break;
default :
  break;
}
WizardDialog dialog=new OpeningHelpWizardDialog(Display.getDefault().getActiveShell(),fileWizard,href);
fileWizard.setWindowTitle(getText());
dialog.open();
}
}
Program: 139938
Project: 139938
Buggy source:
public static void createPattern(Analysis analysis,MenuItemEntity itemEntity,final PatternTransformer pattTransformer){
  String language=pattTransformer.getDbmsLanguage().getDbmsName();
  String query=itemEntity.getQuery();
  String regex=pattTransformer.getRegexp(query.substring(query.indexOf('=') + 3,query.lastIndexOf(')') - 1));
  new CreatePatternAction(ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.getLibraries()).getFolder(DQStructureManager.PATTERNS),ExpressionType.REGEXP,"String_Node_Str" + regex + "String_Node_Str",language).run();
}

Fixed version (ground truth):
public static void createPattern(Analysis analysis,MenuItemEntity itemEntity,final PatternTransformer pattTransformer){
  String language=pattTransformer.getDbmsLanguage().getDbmsName();
  String query=itemEntity.getQuery();
  String regex=pattTransformer.getRegexp(query.substring(query.indexOf('=') + 3,query.lastIndexOf(')') - 1));
  IFolder folder=ResourcesPlugin.getWorkspace().getRoot().getProject(org.talend.dataquality.PluginConstant.getRootProjectName()).getFolder(DQStructureManager.getLibraries()).getFolder(DQStructureManager.PATTERNS);
  new CreatePatternAction(folder,ExpressionType.REGEXP,"String_Node_Str" + regex + "String_Node_Str",language).run();
}
Program: 139939
Project: 139939
Buggy source:
/** 
 * DOC scorreia Comment method "createWhereClause".
 * @param tableNameB
 * @param columnSetB
 * @return
 */
private String createWhereClause(String tableNameB,EList<Column> columnSetB){
  StringBuilder builder=new StringBuilder();
  int size=columnSetB.size();
  for (int i=0; i < size; i++) {
    builder.append(tableNameB).append('.').append(getQuotedColumnName(columnSetB.get(i))).append(dbms().isNull());
    if (i != size - 1) {
      builder.append(dbms().and());
    }
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "createWhereClause".
 * @param tableNameB
 * @param columnSetB
 * @return
 */
private String createWhereClause(String tableNameB,EList<Column> columnSetB){
  final String isNull=dbms().isNull();
  final String and=dbms().and();
  return conditionOnAllColumns(tableNameB,columnSetB,isNull,and);
}
Program: 139940
Project: 139940
Buggy source:
/** 
 * DOC scorreia Comment method "instantiateQuery".
 * @param indicator
 */
private boolean instantiateQuery(Indicator indicator){
  if (ColumnsetPackage.eINSTANCE.getRowMatchingIndicator().equals(indicator.eClass())) {
    RowMatchingIndicator rowMatchingIndicator=(RowMatchingIndicator)indicator;
    EList<Column> columnSetA=rowMatchingIndicator.getColumnSetA();
    EList<Column> columnSetB=rowMatchingIndicator.getColumnSetB();
    if (columnSetA.size() != columnSetB.size()) {
      return traceError("String_Node_Str");
    }
    IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
    Expression sqlGenericExpression=dbms().getSqlExpression(indicatorDefinition);
    boolean useNulls=true;
    Expression instantiatedSqlExpression=createInstantiatedSqlExpression(sqlGenericExpression,columnSetA,columnSetB,useNulls);
    indicator.setInstantiatedExpression(instantiatedSqlExpression);
    return true;
  }
  return traceError("String_Node_Str" + indicator.getName());
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "instantiateQuery".
 * @param indicator
 */
private boolean instantiateQuery(Indicator indicator){
  if (ColumnsetPackage.eINSTANCE.getRowMatchingIndicator().equals(indicator.eClass())) {
    RowMatchingIndicator rowMatchingIndicator=(RowMatchingIndicator)indicator;
    EList<Column> columnSetA=rowMatchingIndicator.getColumnSetA();
    EList<Column> columnSetB=rowMatchingIndicator.getColumnSetB();
    if (columnSetA.size() != columnSetB.size()) {
      return traceError("String_Node_Str");
    }
    IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
    Expression sqlGenericExpression=dbms().getSqlExpression(indicatorDefinition);
    boolean useNulls=false;
    Expression instantiatedSqlExpression=createInstantiatedSqlExpression(sqlGenericExpression,columnSetA,columnSetB,useNulls);
    indicator.setInstantiatedExpression(instantiatedSqlExpression);
    return true;
  }
  return traceError("String_Node_Str" + indicator.getName());
}
Program: 139941
Project: 139941
Buggy source:
/** 
 * DOC scorreia Comment method "createInstantiatedSqlExpression".
 * @param sqlGenericExpression
 * @param columnSetA
 * @param columnSetB
 * @param useNulls
 * @return
 */
private Expression createInstantiatedSqlExpression(Expression sqlGenericExpression,EList<Column> columnSetA,EList<Column> columnSetB,boolean useNulls){
  String tableNameA=getTableName(columnSetA);
  String tableNameB=getTableName(columnSetB);
  String genericSQL=sqlGenericExpression.getBody();
  String joinClause=createJoinClause(tableNameA,columnSetA,tableNameB,columnSetB,useNulls);
  String whereClause=createWhereClause(tableNameB,columnSetB);
  String instantiatedSQL=dbms().fillGenericQueryWithJoin(genericSQL,tableNameA,tableNameB,joinClause,whereClause);
  Expression instantiatedExpression=CoreFactory.eINSTANCE.createExpression();
  instantiatedExpression.setLanguage(sqlGenericExpression.getLanguage());
  instantiatedExpression.setBody(instantiatedSQL);
  return instantiatedExpression;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "createInstantiatedSqlExpression".
 * @param sqlGenericExpression
 * @param columnSetA
 * @param columnSetB
 * @param useNulls
 * @return
 */
private Expression createInstantiatedSqlExpression(Expression sqlGenericExpression,EList<Column> columnSetA,EList<Column> columnSetB,boolean useNulls){
  String tableNameA=getTableName(columnSetA);
  String tableNameB=getTableName(columnSetB);
  String genericSQL=sqlGenericExpression.getBody();
  String joinClause=createJoinClause(tableNameA,columnSetA,tableNameB,columnSetB,useNulls);
  String whereClause=createWhereClause(tableNameB,columnSetB);
  if (useNulls) {
    whereClause+=dbms().and() + '(' + createNotNullCondition(tableNameA,columnSetA)+ ')';
  }
  String instantiatedSQL=dbms().fillGenericQueryWithJoin(genericSQL,tableNameA,tableNameB,joinClause,whereClause);
  Expression instantiatedExpression=CoreFactory.eINSTANCE.createExpression();
  instantiatedExpression.setLanguage(sqlGenericExpression.getLanguage());
  instantiatedExpression.setBody(instantiatedSQL);
  return instantiatedExpression;
}
Program: 139945
Project: 139945
Buggy source:
@Override protected void saveAnalysis() throws DataprofilerCoreException {
  List<ModelElement> analysedElements=new ArrayList<ModelElement>();
  setColumnABForMatchingIndicator(rowMatchingIndicatorA,columnListA,columnListB);
  setColumnABForMatchingIndicator(rowMatchingIndicatorB,columnListB,columnListA);
  for (int i=0; i < columnListA.size(); i++) {
    analysedElements.add(columnListA.get(i));
  }
  for (int i=0; i < columnListB.size(); i++) {
    analysedElements.add(columnListB.get(i));
  }
  if (analysedElements.size() > 0) {
    TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider((Column)analysedElements.get(0));
    analysis.getContext().setConnection(tdDataProvider);
  }
  AnalysisBuilder anaBuilder=new AnalysisBuilder();
  anaBuilder.setAnalysis(this.analysis);
  if (checkComputeButton.getSelection()) {
    analysis.getParameters().getDeactivatedIndicators().add(rowMatchingIndicatorB);
  }
 else {
    analysis.getParameters().getDeactivatedIndicators().clear();
  }
  anaBuilder.addElementsToAnalyze(analysedElements.toArray(new ModelElement[analysedElements.size()]),new Indicator[]{rowMatchingIndicatorA,rowMatchingIndicatorB});
  ReturnCode save=AnaResourceFileHelper.getInstance().save(analysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}

Fixed version (ground truth):
@Override protected void saveAnalysis() throws DataprofilerCoreException {
  List<ModelElement> analysedElements=new ArrayList<ModelElement>();
  setColumnABForMatchingIndicator(rowMatchingIndicatorA,columnListA,columnListB);
  setColumnABForMatchingIndicator(rowMatchingIndicatorB,columnListB,columnListA);
  for (int i=0; i < columnListA.size(); i++) {
    analysedElements.add(columnListA.get(i));
  }
  for (int i=0; i < columnListB.size(); i++) {
    analysedElements.add(columnListB.get(i));
  }
  if (analysedElements.size() > 0) {
    TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider((Column)analysedElements.get(0));
    analysis.getContext().setConnection(tdDataProvider);
  }
 else {
    analysis.getContext().setConnection(null);
    analysis.getClientDependency().clear();
  }
  AnalysisBuilder anaBuilder=new AnalysisBuilder();
  anaBuilder.setAnalysis(this.analysis);
  if (checkComputeButton.getSelection()) {
    analysis.getParameters().getDeactivatedIndicators().add(rowMatchingIndicatorB);
  }
 else {
    analysis.getParameters().getDeactivatedIndicators().clear();
  }
  anaBuilder.addElementsToAnalyze(analysedElements.toArray(new ModelElement[analysedElements.size()]),new Indicator[]{rowMatchingIndicatorA,rowMatchingIndicatorB});
  ReturnCode save=AnaResourceFileHelper.getInstance().save(analysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}
Program: 139946
Project: 139946
Buggy source:
@Override public void saveAnalysis() throws DataprofilerCoreException {
  analysisHandler.clearAnalysis();
  TableIndicator[] tableIndicators=treeViewer.getTableIndicator();
  TdDataProvider tdProvider=null;
  Analysis analysis=analysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  if (tableIndicators != null) {
    if (tableIndicators.length != 0) {
      tdProvider=EObjectHelper.getTdDataProvider(tableIndicators[0].getTdTable());
      analysis.getContext().setConnection(tdProvider);
    }
    for (    TableIndicator tableIndicator : tableIndicators) {
      analysisHandler.addIndicator(tableIndicator.getTdTable(),tableIndicator.getIndicators());
    }
  }
  analysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  String urlString=analysis.eResource() != null ? analysis.eResource().getURI().toFileString() : PluginConstant.EMPTY_STRING;
  ReturnCode saved=AnaResourceFileHelper.getInstance().save(analysis);
  if (saved.isOk()) {
    if (tdProvider != null) {
      PrvResourceFileHelper.getInstance().save(tdProvider);
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + urlString + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName(),urlString,saved.getMessage()));
  }
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}

Fixed version (ground truth):
@Override public void saveAnalysis() throws DataprofilerCoreException {
  analysisHandler.clearAnalysis();
  TableIndicator[] tableIndicators=treeViewer.getTableIndicator();
  TdDataProvider tdProvider=null;
  Analysis analysis=analysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  if (tableIndicators != null && tableIndicators.length != 0) {
    tdProvider=EObjectHelper.getTdDataProvider(tableIndicators[0].getTdTable());
    analysis.getContext().setConnection(tdProvider);
    for (    TableIndicator tableIndicator : tableIndicators) {
      analysisHandler.addIndicator(tableIndicator.getTdTable(),tableIndicator.getIndicators());
    }
  }
 else {
    analysis.getContext().setConnection(null);
    analysis.getClientDependency().clear();
  }
  analysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  String urlString=analysis.eResource() != null ? analysis.eResource().getURI().toFileString() : PluginConstant.EMPTY_STRING;
  ReturnCode saved=AnaResourceFileHelper.getInstance().save(analysis);
  if (saved.isOk()) {
    if (tdProvider != null) {
      PrvResourceFileHelper.getInstance().save(tdProvider);
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + urlString + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName(),urlString,saved.getMessage()));
  }
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}
Program: 139947
Project: 139947
Buggy source:
public void run(){
  try {
    creatComparisonLevel.popComparisonUI(new UiHandler());
  }
 catch (  ReloadCompareException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException {
  final IComparisonLevel creatComparisonLevel=ComparisonLevelFactory.creatComparisonLevel(selectedObject);
  try {
    creatComparisonLevel.popComparisonUI(new UiHandler());
  }
 catch (  ReloadCompareException e) {
    log.error(e,e);
  }
}
Program: 139949
Project: 139949
Buggy source:
public String createJoinConditionAsString(List<JoinElement> joinElements){
  if (joinElements.isEmpty()) {
    return "String_Node_Str";
  }
  StringBuilder builder=new StringBuilder();
  for (  JoinElement joinElement : joinElements) {
    ModelElement colA=joinElement.getColA();
    String tableA=getTableName(colA);
    String tableAliasA=joinElement.getTableAliasA();
    String columnAName=getColumnName(colA);
    String columnAliasA=joinElement.getColumnAliasA();
    boolean hasTableAliasA=StringUtils.isEmpty(tableAliasA);
    boolean hasColumnAliasA=StringUtils.isEmpty(columnAliasA);
    ModelElement colB=joinElement.getColB();
    String tableB=getTableName(colB);
    String tableAliasB=joinElement.getTableAliasB();
    String columnBName=getColumnName(colB);
    String columnAliasB=joinElement.getColumnAliasB();
    boolean hasTableAliasB=StringUtils.isEmpty(tableAliasB);
    boolean hasColumnAliasB=StringUtils.isEmpty(columnAliasB);
    String operator=joinElement.getOperator();
    createJoinClause(builder,columnAName,columnAliasA,hasColumnAliasA,tableB,tableAliasB,columnBName,columnAliasB,hasTableAliasB,hasColumnAliasB,operator);
  }
  return builder.toString();
}

Fixed version (ground truth):
public String createJoinConditionAsString(List<JoinElement> joinElements){
  if (joinElements.isEmpty()) {
    return "String_Node_Str";
  }
  StringBuilder builder=new StringBuilder();
  for (  JoinElement joinElement : joinElements) {
    ModelElement colA=joinElement.getColA();
    String tableA=getTableName(colA);
    String tableAliasA=joinElement.getTableAliasA();
    String columnAName=getColumnName(colA);
    String columnAliasA=joinElement.getColumnAliasA();
    boolean hasTableAliasA=!StringUtils.isEmpty(tableAliasA);
    boolean hasColumnAliasA=!StringUtils.isEmpty(columnAliasA);
    ModelElement colB=joinElement.getColB();
    String tableB=getTableName(colB);
    String tableAliasB=joinElement.getTableAliasB();
    String columnBName=getColumnName(colB);
    String columnAliasB=joinElement.getColumnAliasB();
    boolean hasTableAliasB=!StringUtils.isEmpty(tableAliasB);
    boolean hasColumnAliasB=!StringUtils.isEmpty(columnAliasB);
    String operator=joinElement.getOperator();
    if (hasTableAliasA) {
      builder.append(surroundWithSpaces(tableAliasA));
    }
    builder.append("String_Node_Str");
    builder.append(surroundWithSpaces(quote(tableB)));
    if (hasTableAliasB) {
      builder.append(surroundWithSpaces(tableAliasB));
    }
    builder.append("String_Node_Str");
    String tA=hasTableAliasA ? null : quote(tableA);
    String tB=hasTableAliasB ? null : quote(tableB);
    String cA=hasColumnAliasA ? columnAliasA : quote(columnAName);
    String cB=hasColumnAliasB ? columnAliasB : quote(columnBName);
    createJoinClause(builder,tA,cA,tB,cB,operator);
  }
  return builder.toString();
}
Program: 139950
Project: 139950
Buggy source:
/** 
 * DOC scorreia Comment method "createJoinClause".
 * @param builder
 * @param columnAName
 * @param columnAliasA
 * @param hasColumnAliasA
 * @param tableB
 * @param tableAliasB
 * @param columnBName
 * @param columnAliasB
 * @param hasTableAliasB
 * @param hasColumnAliasB
 * @param operator
 */
private void createJoinClause(StringBuilder builder,String columnAName,String columnAliasA,boolean hasColumnAliasA,String tableB,String tableAliasB,String columnBName,String columnAliasB,boolean hasTableAliasB,boolean hasColumnAliasB,String operator){
  builder.append("String_Node_Str");
  builder.append(surroundWithSpaces(quote(tableB)));
  if (hasTableAliasB) {
    builder.append(surroundWithSpaces(tableAliasB));
  }
  builder.append("String_Node_Str");
  builder.append('(');
  if (hasColumnAliasA) {
    builder.append(surroundWithSpaces(columnAliasA));
  }
 else {
    builder.append(surroundWithSpaces(quote(columnAName)));
  }
  builder.append(operator);
  if (hasColumnAliasB) {
    builder.append(surroundWithSpaces(columnAliasB));
  }
 else {
    builder.append(surroundWithSpaces(quote(columnBName)));
  }
  builder.append(')');
}

Fixed version (ground truth):
/** 
 * Method "createJoinClause" appends a join condition to the builder.
 * @param builder
 * @param tableA the name of the table or null
 * @param columnAName a column name (or an alias)
 * @param tableB the name of the second table or null
 * @param columnBName the column name (or an alias)
 * @param operator the operator used in the joinWhen using a column alias instead of a name, the table name must be set to null (because it's not required)
 */
private void createJoinClause(StringBuilder builder,String tableA,String columnAName,String tableB,String columnBName,String operator){
  builder.append('(');
  if (tableA != null) {
    builder.append(surroundWithSpaces(tableA + "String_Node_Str"));
  }
  builder.append(surroundWithSpaces(columnAName));
  builder.append(operator);
  if (tableB != null) {
    builder.append(surroundWithSpaces(tableB + "String_Node_Str"));
  }
  builder.append(surroundWithSpaces(columnBName));
  builder.append(')');
}
Program: 139951
Project: 139951
Buggy source:
/** 
 * DOC xqliu Comment method "createJoinConditionSection".
 * @param topComp
 */
private void createJoinConditionSection(Composite topComp){
  joinConditionSection=createSection(form,topComp,DefaultMessagesImpl.getString("String_Node_Str"),false,null);
  Label label=new Label(joinConditionSection,SWT.WRAP);
  label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  joinConditionSection.setDescriptionControl(label);
  createJoinConditionComp();
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createJoinConditionSection".
 * @param comp
 */
private void createJoinConditionSection(Composite comp){
  joinConditionSection=createSection(form,comp,DefaultMessagesImpl.getString("String_Node_Str"),false,null);
  Label label=new Label(joinConditionSection,SWT.WRAP);
  label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  joinConditionSection.setDescriptionControl(label);
  createJoinConditionComp();
}
Program: 139952
Project: 139952
Buggy source:
/** 
 * DOC xqliu Comment method "creatDQRuleDefinitionSection".
 * @param topComp
 */
private void createDQRuleDefinitionSection(Composite topComp){
  dqRuleDefinitionSection=createSection(form,topComp,DefaultMessagesImpl.getString("String_Node_Str"),false,null);
  Label label=new Label(dqRuleDefinitionSection,SWT.WRAP);
  label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  dqRuleDefinitionSection.setDescriptionControl(label);
  String temp=DefaultMessagesImpl.getString("String_Node_Str");
  createDQRuleDefinitionComp();
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "creatDQRuleDefinitionSection".
 * @param comp
 */
private void createDQRuleDefinitionSection(Composite comp){
  dqRuleDefinitionSection=createSection(form,comp,DefaultMessagesImpl.getString("String_Node_Str"),false,null);
  Label label=new Label(dqRuleDefinitionSection,SWT.WRAP);
  label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  dqRuleDefinitionSection.setDescriptionControl(label);
  createDQRuleDefinitionComp();
}
Program: 139953
Project: 139953
Buggy source:
public void setColumn(Column column){
switch (getIndex()) {
case LEFT:
    getJoinElement().setColA(column);
  getJoinElement().setColumnAliasA(column.getName());
getJoinElement().setTableAliasA(ColumnHelper.getColumnSetOwner(column).getName());
break;
case RIGHT:
getJoinElement().setColB(column);
getJoinElement().setColumnAliasB(column.getName());
getJoinElement().setTableAliasB(ColumnHelper.getColumnSetOwner(column).getName());
break;
default :
}
}

Fixed version (ground truth):
public void setColumn(Column column){
switch (getIndex()) {
case LEFT:
    getJoinElement().setColA(column);
  break;
case RIGHT:
getJoinElement().setColB(column);
break;
default :
}
}
Program: 139954
Project: 139954
Buggy source:
public Expression getExpression(){
  if (expression == null) {
    expression=BooleanExpressionHelper.createExpression(EXPRESSION_LANG,EXPRESSION_BODY);
  }
  return expression;
}

Fixed version (ground truth):
public Expression getExpression(){
  if (expression == null) {
    expression=(Expression)EcoreUtil.copy(DefinitionHandler.getInstance().getDQRuleDefaultIndicatorDefinition().getSqlGenericExpression().get(0));
  }
  return expression;
}
Program: 139955
Project: 139955
Buggy source:
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setInitialSize(new Point(1024,768));
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(false);
  String buildId=CorePlugin.getDefault().getProductVersion().toString();
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  configurer.setTitle(brandingService.getFullProductName() + "String_Node_Str" + buildId+ "String_Node_Str");
}

Fixed version (ground truth):
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setInitialSize(new Point(1024,768));
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(false);
  String buildId=CorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION).toString();
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  configurer.setTitle(brandingService.getFullProductName() + "String_Node_Str" + buildId+ "String_Node_Str");
}
Program: 139956
Project: 139956
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IPath projectRelativePath=((IFolder)element).getFullPath();
    if (projectRelativePath.toString().equals(PluginConstant.REPORT_FOLDER_PATH)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    try {
      if (DQStructureManager.REPORT_FOLDER_PROPERTY.equals(folder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY))) {
        return false;
      }
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
  return true;
}
Program: 139957
Project: 139957
Buggy source:
@Override public boolean performFinish(){
  String targetFile=page.getTargetFile();
  Object[] elements=page.getSelectedPatternsTree().getCheckedElements();
  List<Pattern> seletedPatterns=new ArrayList<Pattern>();
  for (  Object element : elements) {
    if (element instanceof IFile) {
      IFile file=(IFile)element;
      if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PATTERN)) {
        seletedPatterns.add(PatternResourceFileHelper.getInstance().findPattern(file));
      }
    }
  }
  File file=new File(targetFile);
  boolean isContinue=true;
  if (file.exists() && !isForExchange) {
    isContinue=MessageDialogWithToggle.openConfirm(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
  if (isContinue) {
    ExportFactory.export(file,folder,seletedPatterns.toArray(new Pattern[seletedPatterns.size()]));
    if (isForExchange && file.isDirectory()) {
      for (      File patternFile : file.listFiles()) {
        try {
          FilesUtils.zip(patternFile,patternFile.getPath() + "String_Node_Str");
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
        }
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  String targetFile=page.getTargetFile();
  Object[] elements=page.getSelectedPatternsTree().getCheckedElements();
  List<Pattern> seletedPatterns=new ArrayList<Pattern>();
  for (  Object element : elements) {
    if (element instanceof IFile) {
      IFile file=(IFile)element;
      if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PATTERN)) {
        seletedPatterns.add(PatternResourceFileHelper.getInstance().findPattern(file));
      }
    }
  }
  File file=new File(targetFile);
  boolean isContinue=true;
  if (file.exists() && !isForExchange) {
    isContinue=MessageDialogWithToggle.openConfirm(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
  if (isContinue) {
    ExportFactory.export(file,folder,seletedPatterns.toArray(new Pattern[seletedPatterns.size()]));
    if (isForExchange && file.isDirectory()) {
      for (      File patternFile : file.listFiles()) {
        try {
          FilesUtils.zip(patternFile,patternFile.getPath() + "String_Node_Str");
          patternFile.delete();
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
        }
      }
    }
    return true;
  }
  return false;
}
Program: 139959
Project: 139959
Buggy source:
@Override public void createPartControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new FillLayout());
  ScrolledComposite scomp=new ScrolledComposite(comp,SWT.H_SCROLL | SWT.V_SCROLL);
  scomp.setLayout(new FillLayout());
  Composite composite=new Composite(scomp,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  scomp.setExpandHorizontal(true);
  scomp.setExpandVertical(true);
  scomp.setMinWidth(400);
  scomp.setMinHeight(350);
  scomp.setContent(composite);
  gContainer=new Group(composite,SWT.NONE);
  gContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridLayout layout=new GridLayout(2,false);
  GridData data=new GridData(GridData.FILL_BOTH);
  gContainer.setLayout(layout);
  gContainer.setLayoutData(data);
  if (switchFlag) {
    tContainer=new Group(composite,SWT.NONE);
    tContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    tContainer.setLayout(new GridLayout(2,false));
    tContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    createExtDefault();
  }
  createDefault();
  getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
  initializeToolBar();
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new FillLayout());
  ScrolledComposite scomp=new ScrolledComposite(comp,SWT.H_SCROLL | SWT.V_SCROLL);
  scomp.setLayout(new FillLayout());
  Composite composite=new Composite(scomp,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  scomp.setExpandHorizontal(true);
  scomp.setExpandVertical(true);
  scomp.setMinWidth(400);
  scomp.setMinHeight(350);
  scomp.setContent(composite);
  gContainer=new Group(composite,SWT.NONE);
  gContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridLayout layout=new GridLayout(2,false);
  GridData data=new GridData(GridData.FILL_BOTH);
  gContainer.setLayout(layout);
  gContainer.setLayoutData(data);
  if (PluginChecker.isTDQLoaded()) {
    tContainer=new Group(composite,SWT.NONE);
    tContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    tContainer.setLayout(new GridLayout(2,false));
    tContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    createExtDefault();
  }
  createDefault();
  getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
  initializeToolBar();
}
Program: 139960
Project: 139960
Buggy source:
/** 
 * DOC qzhang RespositoryDetailView constructor comment.
 */
public RespositoryDetailView(){
  switchFlag=PluginChecker.isTDQLoaded();
}

Fixed version (ground truth):
/** 
 * DOC qzhang RespositoryDetailView constructor comment.
 */
public RespositoryDetailView(){
}
Program: 139962
Project: 139962
Buggy source:
public static boolean isFromSameConnection(List<Column> columns){
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isFromSameConnection".
 * @param columns
 * @return
 */
public static boolean isFromSameConnection(List<Column> columns){
}
Program: 139963
Project: 139963
Buggy source:
public static boolean isFromSameTable(List<Column> columns){
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isFromSameTable".
 * @param columns
 * @return
 */
public static boolean isFromSameTable(List<Column> columns){
}
Program: 139966
Project: 139966
Buggy source:
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  setDirty(true);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  if (oldInput != null && newInput != null) {
    if (!((List)newInput).isEmpty()) {
      setDirty(true);
    }
  }
}
Program: 139967
Project: 139967
Buggy source:
@Override protected void saveAnalysis() throws DataprofilerCoreException {
  List<ModelElement> analysedElements=new ArrayList<ModelElement>();
  setColumnABForMatchingIndicator(rowMatchingIndicatorA,columnListA,columnListB);
  setColumnABForMatchingIndicator(rowMatchingIndicatorB,columnListB,columnListA);
  for (int i=0; i < columnListA.size(); i++) {
    analysedElements.add(columnListA.get(i));
  }
  for (int i=0; i < columnListB.size(); i++) {
    analysedElements.add(columnListB.get(i));
  }
  if (analysedElements.size() > 0) {
    TdDataProvider tdDataProvider=EObjectHelper.getTdDataProvider((Column)analysedElements.get(0));
    analysis.getContext().setConnection(tdDataProvider);
  }
  AnalysisBuilder anaBuilder=new AnalysisBuilder();
  anaBuilder.setAnalysis(this.analysis);
  if (checkComputeButton.getSelection()) {
    analysis.getParameters().getDeactivatedIndicators().add(rowMatchingIndicatorB);
  }
 else {
    analysis.getParameters().getDeactivatedIndicators().clear();
  }
  anaBuilder.addElementsToAnalyze(analysedElements.toArray(new ModelElement[analysedElements.size()]),new Indicator[]{rowMatchingIndicatorA,rowMatchingIndicatorB});
  ReturnCode save=AnaResourceFileHelper.getInstance().save(analysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}

Fixed version (ground truth):
@Override protected void saveAnalysis() throws DataprofilerCoreException {
  List<ModelElement> analysedElements=new ArrayList<ModelElement>();
  setColumnABForMatchingIndicator(rowMatchingIndicatorA,columnListA,columnListB);
  setColumnABForMatchingIndicator(rowMatchingIndicatorB,columnListB,columnListA);
  for (int i=0; i < columnListA.size(); i++) {
    analysedElements.add(columnListA.get(i));
  }
  for (int i=0; i < columnListB.size(); i++) {
    analysedElements.add(columnListB.get(i));
  }
  if (analysedElements.size() > 0) {
    TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider((Column)analysedElements.get(0));
    analysis.getContext().setConnection(tdDataProvider);
  }
  AnalysisBuilder anaBuilder=new AnalysisBuilder();
  anaBuilder.setAnalysis(this.analysis);
  if (checkComputeButton.getSelection()) {
    analysis.getParameters().getDeactivatedIndicators().add(rowMatchingIndicatorB);
  }
 else {
    analysis.getParameters().getDeactivatedIndicators().clear();
  }
  anaBuilder.addElementsToAnalyze(analysedElements.toArray(new ModelElement[analysedElements.size()]),new Indicator[]{rowMatchingIndicatorA,rowMatchingIndicatorB});
  ReturnCode save=AnaResourceFileHelper.getInstance().save(analysis);
  if (save.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}
Program: 139972
Project: 139972
Buggy source:
@Override public void expansionStateChanged(ExpansionEvent e){
  composite.layout();
  composite.pack();
  form.reflow(true);
}

Fixed version (ground truth):
@Override public void expansionStateChanged(ExpansionEvent e){
  form.reflow(true);
}
Program: 139974
Project: 139974
Buggy source:
public static JFreeChart decorateCategoryPlot(JFreeChart chart){
}

Fixed version (ground truth):
public static JFreeChart decorateCategoryPlot(JFreeChart chart){
  if (chart == null) {
    return null;
  }
  Font font=null;
  CategoryPlot plot=chart.getCategoryPlot();
  CategoryItemRenderer render=plot.getRenderer();
  CategoryAxis domainAxis=plot.getDomainAxis();
  ValueAxis valueAxis=plot.getRangeAxis();
  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);
  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;
  return chart;
}
Program: 139975
Project: 139975
Buggy source:
public static JFreeChart decorateXYPlot(JFreeChart chart){
}

Fixed version (ground truth):
public static JFreeChart decorateXYPlot(JFreeChart chart){
  if (chart == null) {
    return null;
  }
  Font font=null;
  XYPlot plot=chart.getXYPlot();
  XYItemRenderer render=plot.getRenderer();
  ValueAxis domainAxis=plot.getDomainAxis();
  ValueAxis valueAxis=plot.getRangeAxis();
  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);
  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;
  return chart;
}
Program: 139976
Project: 139976
Buggy source:
/** 
 * Method "getExpressionType".
 * @param pattern
 * @return the expression type of the regular expression contained in the given pattern or null
 */
public static String getExpressionType(Pattern pattern){
  if (pattern != null) {
    PatternComponent component=pattern.getComponents().get(0);
    if (component == null) {
      return null;
    }
 else {
      RegularExpression regexp=DataqualitySwitchHelper.REGULAR_EXPR_SWITCH.doSwitch(component);
      if (regexp != null) {
        String expressionType=regexp.getExpressionType();
        if (StringUtils.isEmpty(expressionType)) {
          final Resource resource=regexp.eResource();
          if (resource != null) {
            if (resource.getURI().toFileString().contains(SQL_PATTERN_FOLDER)) {
              expressionType=ExpressionType.SQL_LIKE.getLiteral();
            }
 else             if (resource.getURI().toFileString().contains(PATTERN_FOLDER)) {
              expressionType=ExpressionType.REGEXP.getLiteral();
            }
          }
        }
        return expressionType;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method "getExpressionType".
 * @param pattern
 * @return the expression type of the regular expression contained in the given pattern or null
 */
public static String getExpressionType(Pattern pattern){
  if (pattern != null) {
    PatternComponent component=pattern.getComponents().get(0);
    if (component == null) {
      return null;
    }
 else {
      RegularExpression regexp=DataqualitySwitchHelper.REGULAR_EXPR_SWITCH.doSwitch(component);
      if (regexp != null) {
        String expressionType=regexp.getExpressionType();
        if (StringUtils.isEmpty(expressionType)) {
          final Resource resource=regexp.eResource();
          if (resource != null) {
            if (resource.getURI().toString().contains(SQL_PATTERN_FOLDER)) {
              expressionType=ExpressionType.SQL_LIKE.getLiteral();
            }
 else             if (resource.getURI().toString().contains(PATTERN_FOLDER)) {
              expressionType=ExpressionType.REGEXP.getLiteral();
            }
          }
        }
        return expressionType;
      }
    }
  }
  return null;
}
Program: 139977
Project: 139977
Buggy source:
/** 
 * Method "setReportType".MOD mzhao 2009-02-16
 * @param report the report object to update
 * @param reportType the report type to set
 * @param jrxmlFullPath the full path to the jxrxml file (can be null when the type of report is different from theUSER_DEFINED)
 * @return true if everything is set correctly, false otherwise.
 */
public static boolean setReportType(TdReport report,Analysis analysis,ReportType reportType,String jrxmlFullPath){
  boolean ok=true;
switch (reportType) {
case BASIC:
    report.setReportType(reportType.getLabel(),null,analysis);
  break;
case EVOLUTION:
report.setReportType(reportType.getLabel(),null,analysis);
break;
case USER_MADE:
report.setReportType(reportType.getLabel(),jrxmlFullPath,analysis);
if (StringUtils.isBlank(jrxmlFullPath)) {
ok=false;
}
break;
default :
ok=false;
break;
}
return ok;
}

Fixed version (ground truth):
/** 
 * Method "setReportType". MOD mzhao 2009-02-16
 * @param report the report object to update
 * @param reportType the report type to set
 * @param jrxmlFullPath the full path to the jxrxml file (can be null when the type of report is different from theUSER_DEFINED)
 * @return true if everything is set correctly, false otherwise.
 */
public static boolean setReportType(TdReport report,Analysis analysis,ReportType reportType,String jrxmlFullPath){
  boolean ok=true;
switch (reportType) {
case BASIC:
    report.setReportType(reportType.getLabel(),null,analysis);
  break;
case EVOLUTION:
report.setReportType(reportType.getLabel(),null,analysis);
break;
case USER_MADE:
report.setReportType(reportType.getLabel(),jrxmlFullPath,analysis);
if (StringUtils.isBlank(jrxmlFullPath)) {
ok=false;
}
break;
default :
ok=false;
break;
}
return ok;
}