nus-yam/ex-repair huggingface dataset:
Program: 139242
Project: 139242
Buggy source:
@Override public void processDelta(final IResourceDelta rootDelta){
  final List<IFile> added=new ArrayList<IFile>();
  final List<IFile> removed=new ArrayList<IFile>();
  IResourceDeltaVisitor visitor=new IResourceDeltaVisitor(){
    public boolean visit(    IResourceDelta delta){
      if (delta.getKind() == IResourceDelta.ADDED) {
        IResource resource=delta.getResource();
        if (resource.getType() == IResource.FILE && FactoriesUtil.isEmfFile(resource.getFileExtension())) {
          added.add((IFile)resource);
        }
      }
      if (delta.getKind() == IResourceDelta.REMOVED) {
        IResource resource=delta.getResource();
        if (resource.getType() == IResource.FILE && FactoriesUtil.isEmfFile(resource.getFileExtension())) {
          removed.add((IFile)resource);
        }
      }
      return true;
    }
  }
;
  try {
    rootDelta.accept(visitor);
  }
 catch (  CoreException e1) {
    log.error(e1);
  }
  List<Runnable> refreshedRannables=new ArrayList<Runnable>();
  for (  IFile file : removed) {
    try {
      refreshedRannables.add(getDeleteRunnable(file));
    }
 catch (    Exception e) {
      log.error(e);
    }
  }
  for (  IFile file : added) {
    Resource resource=null;
    try {
      resource=RepResourceFileHelper.getInstance().getFileResource(file);
      refreshedRannables.add(getRefreshRunnable(resource));
    }
 catch (    Exception e) {
      log.error(e);
      e.printStackTrace();
    }
  }
  if (refreshedRannables != null && refreshedRannables.size() > 0) {
    postEventExecute(refreshedRannables);
  }
}

Fixed version (ground truth):
@Override public void processDelta(final IResourceDelta rootDelta){
  final List<IFile> added=new ArrayList<IFile>();
  final List<IFile> removed=new ArrayList<IFile>();
  IResourceDeltaVisitor visitor=new IResourceDeltaVisitor(){
    public boolean visit(    IResourceDelta delta){
      IResource resource=delta.getResource();
      if (FactoriesUtil.isEmfFile(resource.getFileExtension())) {
        if (delta.getKind() == IResourceDelta.ADDED) {
          added.add((IFile)resource);
        }
        if (delta.getKind() == IResourceDelta.REMOVED) {
          removed.add((IFile)resource);
        }
      }
      return true;
    }
  }
;
  try {
    rootDelta.accept(visitor);
  }
 catch (  CoreException e1) {
    log.error(e1);
  }
  List<Runnable> refreshedRannables=new ArrayList<Runnable>();
  for (  IFile file : removed) {
    try {
      refreshedRannables.add(getDeleteRunnable(file));
    }
 catch (    Exception e) {
      log.error(e);
    }
  }
  for (  IFile file : added) {
    Resource resource=null;
    try {
      resource=RepResourceFileHelper.getInstance().getFileResource(file);
      refreshedRannables.add(getRefreshRunnable(resource));
    }
 catch (    Exception e) {
      log.error(e);
      e.printStackTrace();
    }
  }
  if (refreshedRannables != null && refreshedRannables.size() > 0) {
    postEventExecute(refreshedRannables);
  }
}
Program: 139243
Project: 139243
Buggy source:
public void run(){
  IFile propertyFile=getPropertyFile(resource);
  if (propertyFile != null) {
    Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
    updateProperty(resource,propertyResource);
    updateElement(resource,propertyResource);
    clear(propertyFile);
  }
}

Fixed version (ground truth):
public void run(){
  IFile propertyFile=getPropertyFile(resource);
  if (propertyFile != null) {
    Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
    updateProperty(resource,propertyResource);
    updateElement(resource,propertyResource);
  }
}
Program: 139244
Project: 139244
Buggy source:
private Runnable getRefreshRunnable(final Resource resource){
  return new Runnable(){
    public void run(){
      IFile propertyFile=getPropertyFile(resource);
      if (propertyFile != null) {
        Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
        updateProperty(resource,propertyResource);
        updateElement(resource,propertyResource);
        clear(propertyFile);
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable getRefreshRunnable(final Resource resource){
  return new Runnable(){
    public void run(){
      IFile propertyFile=getPropertyFile(resource);
      if (propertyFile != null) {
        Resource propertyResource=RepResourceFileHelper.getInstance().getFileResource(propertyFile);
        updateProperty(resource,propertyResource);
        updateElement(resource,propertyResource);
      }
    }
  }
;
}
Program: 139245
Project: 139245
Buggy source:
public boolean visit(IResourceDelta delta){
  if (delta.getKind() == IResourceDelta.ADDED) {
    IResource resource=delta.getResource();
    if (resource.getType() == IResource.FILE && FactoriesUtil.isEmfFile(resource.getFileExtension())) {
      added.add((IFile)resource);
    }
  }
  if (delta.getKind() == IResourceDelta.REMOVED) {
    IResource resource=delta.getResource();
    if (resource.getType() == IResource.FILE && FactoriesUtil.isEmfFile(resource.getFileExtension())) {
      removed.add((IFile)resource);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean visit(IResourceDelta delta){
  IResource resource=delta.getResource();
  if (FactoriesUtil.isEmfFile(resource.getFileExtension())) {
    if (delta.getKind() == IResourceDelta.ADDED) {
      added.add((IFile)resource);
    }
    if (delta.getKind() == IResourceDelta.REMOVED) {
      removed.add((IFile)resource);
    }
  }
  return true;
}
Program: 139246
Project: 139246
Buggy source:
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=initProperty(element);
  TDQItem item=initItem(element,property);
  item.setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=initProperty(element);
  TDQItem item=initItem(element,property);
  item.setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
  String propertyPath=property.eResource().getURI().toPlatformString(true);
  MetadataHelper.setPropertyPath(propertyPath,element);
}
Program: 139247
Project: 139247
Buggy source:
/** 
 * DOC BZhou ColumnNominalWizard constructor comment.
 * @param parameter
 */
public ColumnNominalWizard(AnalysisParameter parameter){
  super(parameter);
}

Fixed version (ground truth):
/** 
 * DOC BZhou ColumnNominalWizard constructor comment.
 * @param parameter
 */
public ColumnNominalWizard(AnalysisParameter parameter){
  super(parameter);
  setIndicator(ColumnsetFactory.eINSTANCE.createWeakCorrelationIndicator());
}
Program: 139248
Project: 139248
Buggy source:
/** 
 * DOC BZhou ColumnNumbericWizard constructor comment.
 * @param parameter
 */
public ColumnNumbericWizard(AnalysisParameter parameter){
  super(parameter);
}

Fixed version (ground truth):
/** 
 * DOC BZhou ColumnNumbericWizard constructor comment.
 * @param parameter
 */
public ColumnNumbericWizard(AnalysisParameter parameter){
  super(parameter);
  setIndicator(ColumnsetFactory.eINSTANCE.createCountAvgNullIndicator());
}
Program: 139249
Project: 139249
Buggy source:
public ColumnSetWizard(AnalysisParameter parameter){
  super(parameter);
}

Fixed version (ground truth):
public ColumnSetWizard(AnalysisParameter parameter){
  super(parameter);
  setIndicator(ColumnsetFactory.eINSTANCE.createSimpleStatIndicator());
}
Program: 139250
Project: 139250
Buggy source:
public ColumnTimeWizard(AnalysisParameter parameter){
  super(parameter);
}

Fixed version (ground truth):
public ColumnTimeWizard(AnalysisParameter parameter){
  super(parameter);
  setIndicator(ColumnsetFactory.eINSTANCE.createMinMaxDateIndicator());
}
Program: 139251
Project: 139251
Buggy source:
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  Indicator indicator=getMatchedIndicator();
  if (indicator != null) {
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    analysis.getResults().getIndicators().add(indicator);
  }
  return analysis;
}

Fixed version (ground truth):
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  if (indicator != null) {
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    analysis.getResults().getIndicators().add(indicator);
  }
  return analysis;
}
Program: 139252
Project: 139252
Buggy source:
/** 
 * Method "getExpression".
 * @param patternComponent
 * @param language a language (see DbmsLanguage)
 * @return the expression for the given language or null
 */
public static Expression getExpression(PatternComponent patternComponent,String language){
  if (patternComponent != null && patternComponent.eClass().equals(PatternPackage.eINSTANCE.getRegularExpression())) {
    RegularExpression regExp=(RegularExpression)patternComponent;
    Expression expr=regExp.getExpression();
    if (language.equals(regExp.getExpression().getLanguage())) {
      return expr;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method "getExpression".
 * @param patternComponent
 * @param language a language (see DbmsLanguage)
 * @return the expression for the given language or null
 */
public static Expression getExpression(PatternComponent patternComponent,String language){
  if (patternComponent != null && patternComponent.eClass().equals(PatternPackage.eINSTANCE.getRegularExpression())) {
    RegularExpression regExp=(RegularExpression)patternComponent;
    Expression expr=regExp.getExpression();
    if (language.equalsIgnoreCase(regExp.getExpression().getLanguage())) {
      return expr;
    }
  }
  return null;
}
Program: 139253
Project: 139253
Buggy source:
@Override public void run(){
  if (files != null && files.length > 0) {
    for (    IFile file : files) {
      ModelElement oldObject=ModelElementFileFactory.getModelElement(file);
      if (oldObject != null) {
        ModelElement newObject=(ModelElement)EMFSharedResources.getInstance().copyEObject(oldObject);
        newObject=update(oldObject,newObject);
        IFile newFile=getNewFile(file);
        ElementWriterFactory.getInstance().create(newFile.getFileExtension()).save(newObject,newFile);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (files != null && files.length > 0) {
    for (    IFile file : files) {
      ModelElement oldObject=ModelElementFileFactory.getModelElement(file);
      if (oldObject != null) {
        ModelElement newObject=(ModelElement)EMFSharedResources.getInstance().copyEObject(oldObject);
        newObject=update(oldObject,newObject);
        IFile newFile=getNewFile(file);
        ElementWriterFactory.getInstance().create(newFile.getFileExtension()).save(newObject,newFile);
      }
    }
    CorePlugin.getDefault().refreshDQView();
  }
}
Program: 139254
Project: 139254
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    return !FilesUtils.isSVNFolder(folder) && !folder.getName().endsWith(XSD_FOLDER_NAME);
  }
  if (element instanceof IFile && isShowFile) {
    IFile file=(IFile)element;
    return !file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION);
  }
  return isShowFile;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    return !FilesUtils.isSVNFolder(folder) && !folder.getName().endsWith(XSD_FOLDER_NAME) && !folder.getName().endsWith(REPORTS_FOLDER_NAME);
  }
  if (element instanceof IFile && isShowFile) {
    IFile file=(IFile)element;
    return !file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION);
  }
  return isShowFile;
}
Program: 139255
Project: 139255
Buggy source:
/** 
 * Method "containsRowCount".
 * @param analysis
 * @return true if this analysis contains the row count indicator
 */
public static boolean containsRowCount(Analysis analysis){
  final AnalysisResult results=analysis.getResults();
  if (results == null) {
    return false;
  }
  final EList<Indicator> indicators=results.getIndicators();
  for (  Indicator indicator : indicators) {
    if (IndicatorsPackage.eINSTANCE.getRowCountIndicator().equals(indicator.eClass())) {
      return true;
    }
    if (IndicatorsPackage.eINSTANCE.getCountsIndicator().equals(indicator.eClass())) {
      CountsIndicator cInd=(CountsIndicator)indicator;
      if (cInd.getRowCountIndicator() != null) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Method "containsRowCount".
 * @param analysis
 * @return true if this analysis contains the row count indicator
 */
public static boolean containsRowCount(Analysis analysis){
  final AnalysisResult results=analysis.getResults();
  if (results == null) {
    return false;
  }
  final EList<Indicator> indicators=results.getIndicators();
  for (  Indicator indicator : indicators) {
    if (IndicatorsPackage.eINSTANCE.getRowCountIndicator().equals(indicator.eClass())) {
      return true;
    }
    if (IndicatorsPackage.eINSTANCE.getCountsIndicator().equals(indicator.eClass())) {
      CountsIndicator cInd=(CountsIndicator)indicator;
      if (cInd.getRowCountIndicator() != null) {
        return true;
      }
    }
    if (ColumnsetPackage.eINSTANCE.getSimpleStatIndicator().equals(indicator.eClass())) {
      return true;
    }
  }
  return false;
}
Program: 139256
Project: 139256
Buggy source:
/** 
 * DOC bZhou Comment method "getModelElement".
 * @param file
 * @return
 */
public static ModelElement getModelElement(IFile file){
  ModelElement modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().findProvider(file);
    modelElement=returnValue.getObject();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance().findReport(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return modelElement;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getModelElement".
 * @param file
 * @return
 */
public static ModelElement getModelElement(IFile file){
  ModelElement modelElement=null;
  String fileExtension=file.getFileExtension();
  if (FactoriesUtil.isProvFile(fileExtension)) {
    TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().findProvider(file);
    modelElement=returnValue.getObject();
  }
 else   if (FactoriesUtil.isAnalysisFile(fileExtension)) {
    modelElement=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
 else   if (FactoriesUtil.isReportFile(fileExtension)) {
    modelElement=RepResourceFileHelper.getInstance().findReport(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(fileExtension)) {
    modelElement=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
 else   if (FactoriesUtil.isPatternFile(fileExtension)) {
    modelElement=PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isUDIFile(fileExtension)) {
    modelElement=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return modelElement;
}
Program: 139257
Project: 139257
Buggy source:
/** 
 * DOC bZhou Comment method "getResourceFileMap".
 * @param file
 * @return
 */
public static ResourceFileMap getResourceFileMap(IFile file){
  ResourceFileMap modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    modelElement=PrvResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance();
  }
  return modelElement;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getResourceFileMap".
 * @param element
 * @return
 */
public static ResourceFileMap getResourceFileMap(ModelElement element){
  ResourceFileMap resourceMap=null;
  if (element instanceof TdDataProvider) {
    resourceMap=PrvResourceFileHelper.getInstance();
  }
 else   if (element instanceof Analysis) {
    resourceMap=AnaResourceFileHelper.getInstance();
  }
 else   if (element instanceof Report) {
    resourceMap=RepResourceFileHelper.getInstance();
  }
 else   if (element instanceof DQRule) {
    resourceMap=DQRuleResourceFileHelper.getInstance();
  }
 else   if (element instanceof Pattern) {
    resourceMap=PatternResourceFileHelper.getInstance();
  }
 else   if (element instanceof UserDefIndicator) {
    resourceMap=UDIResourceFileHelper.getInstance();
  }
  return resourceMap;
}
Program: 139258
Project: 139258
Buggy source:
public ReturnCode serialize(TDQItem item,URI uri){
  ReturnCode rc=new ReturnCode();
  URI itemURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.ITEM_EXTENSION);
  Resource itemResource=util.createResource(itemURI);
  String itemPath=itemURI.trimSegments(1).toPlatformString(true);
  itemPath=itemPath.substring(itemPath.indexOf(File.separatorChar,2) + 1);
  item.getState().setPath(itemPath);
  util.saveResource(itemResource);
  rc.setOk(true);
  return rc;
}

Fixed version (ground truth):
public ReturnCode serialize(Property property,URI uri){
  ReturnCode rc=new ReturnCode();
  URI propertiesURI=uri.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  Resource propertyResource=util.createResource(propertiesURI);
  propertyResource.getContents().add(property);
  propertyResource.getContents().add(property.getItem());
  propertyResource.getContents().add(property.getItem().getState());
  rc.setOk(util.saveResource(propertyResource));
  return rc;
}
Program: 139259
Project: 139259
Buggy source:
public ReturnCode save(ModelElement element){
  ReturnCode rc=new ReturnCode();
  addResourceContent(element);
  addDependencies(element);
  savePerperties(element);
  rc.setOk(util.saveResource(element.eResource()));
  if (rc.isOk()) {
    rc.setMessage("String_Node_Str" + element.getName() + "String_Node_Str");
    ProxyRepositoryManager.getInstance().save();
  }
 else {
    rc.setMessage(util.getLastErrorMessage());
  }
  return rc;
}

Fixed version (ground truth):
public ReturnCode save(ModelElement element){
  ReturnCode rc=new ReturnCode();
  addDependencies(element);
  addResourceContent(element);
  savePerperties(element);
  rc.setOk(util.saveResource(element.eResource()));
  if (rc.isOk()) {
    rc.setMessage("String_Node_Str" + element.getName() + "String_Node_Str");
    ProxyRepositoryManager.getInstance().save();
  }
 else {
    rc.setMessage(util.getLastErrorMessage());
  }
  return rc;
}
Program: 139260
Project: 139260
Buggy source:
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=initProperty(element);
  TDQItem item=initItem(element,property);
  item.setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
  String propertyPath=property.eResource().getURI().toPlatformString(true);
  TaggedValueHelper.setTaggedValue(element,TaggedValueHelper.PROPERTY_FILE,propertyPath);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "savePerperties".
 * @param element
 */
public void savePerperties(ModelElement element){
  Resource resource=element.eResource();
  String fileName=resource.getURI().lastSegment();
  Property property=initProperty(element);
  TDQItem item=initItem(element,property);
  item.setFilename(fileName);
  URI uri=element.eResource().getURI();
  serialize(property,uri);
}
Program: 139261
Project: 139261
Buggy source:
public Property initProperty(ModelElement element){
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  String author=MetadataHelper.getAuthor(element);
  String purpose=MetadataHelper.getPurpose(element);
  String description=MetadataHelper.getDescription(element);
  String version=MetadataHelper.getVersion(element);
  String status=MetadataHelper.getDevStatus(element);
  User user=null;
  RepositoryContext context=(RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
  if (context != null) {
    user=context.getUser();
    user.setLogin(author);
    property.setAuthor(user);
  }
 else {
  }
  property.setId(EcoreUtil.generateUUID());
  property.setLabel(element.getName());
  property.setPurpose(purpose);
  property.setDescription(description);
  property.setStatusCode(status);
  property.setVersion(version);
  property.setCreationDate(new Date());
  computePropertyMaxInformationLevel(property);
  return property;
}

Fixed version (ground truth):
public Property initProperty(ModelElement element){
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  String author=MetadataHelper.getAuthor(element);
  String purpose=MetadataHelper.getPurpose(element);
  String description=MetadataHelper.getDescription(element);
  String version=MetadataHelper.getVersion(element);
  String status=MetadataHelper.getDevStatus(element);
  RepositoryContext context=(RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
  if (context != null) {
    User user=context.getUser();
    user.setLogin(author);
    property.setAuthor(user);
  }
  property.setId(EcoreUtil.generateUUID());
  property.setLabel(element.getName());
  property.setPurpose(purpose);
  property.setDescription(description);
  property.setStatusCode(status);
  property.setVersion(version);
  property.setCreationDate(new Date());
  computePropertyMaxInformationLevel(property);
  return property;
}
Program: 139262
Project: 139262
Buggy source:
public ReturnCode serialize(TDQItem item,URI uri);

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "serialize".
 * @param property
 * @param uri
 * @return
 */
public ReturnCode serialize(Property property,URI uri);
Program: 139263
Project: 139263
Buggy source:
/** 
 * DOC scorreia Comment method "getEMFObject".
 * @param file
 * @param folderProperty
 * @return
 */
private ModelElement getModelElement(IFile file){
  if (FactoriesUtil.isPatternFile(file)) {
    return PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    return DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
  log.error("String_Node_Str" + file.getFullPath().toOSString());
  return null;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getEMFObject".
 * @param file
 * @param folderProperty
 * @return
 */
private ModelElement getModelElement(IFile file){
  String fileExtension=file.getFileExtension();
  if (FactoriesUtil.isPatternFile(fileExtension)) {
    return PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(fileExtension)) {
    return DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
  log.error("String_Node_Str" + file.getFullPath().toOSString());
  return null;
}
Program: 139266
Project: 139266
Buggy source:
/** 
 * DOC yyi Comment method "getJavaRegexp".
 * @param pattern
 * @return
 */
public static String getJavaRegexp(Pattern pattern){
  EList<PatternComponent> components=pattern.getComponents();
  for (  PatternComponent patternComponent : components) {
    if (patternComponent != null) {
      Expression expression=getExpression(patternComponent,"String_Node_Str");
      if (expression != null) {
        return expression.getBody();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "getJavaRegexp".
 * @param pattern
 * @return
 */
public static String getJavaRegexp(Pattern pattern){
  return getRegexp(pattern,"String_Node_Str");
}
Program: 139267
Project: 139267
Buggy source:
/** 
 * Method "getRegexp".
 * @param pattern a pattern
 * @return the body of the regular expression applicable to this dbms or null
 */
public static String getSQLRegexp(Pattern pattern){
  EList<PatternComponent> components=pattern.getComponents();
  for (  PatternComponent patternComponent : components) {
    if (patternComponent != null) {
      Expression expression=getExpression(patternComponent,"String_Node_Str");
      if (expression != null) {
        return expression.getBody();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method "getRegexp".
 * @param pattern a pattern
 * @return the body of the regular expression applicable to this dbms or null
 */
public static String getSQLRegexp(Pattern pattern){
  return getRegexp(pattern,"String_Node_Str");
}
Program: 139268
Project: 139268
Buggy source:
/** 
 * DOC yyi Comment method "runTableAnalysis".
 * @param tableName
 */
protected void runTableAnalysis(String tableName){
  Package parentPack=(Package)currentSelectionSchemaIndicator.getAnalyzedElement();
  TdCatalog catalogObj=SwitchHelpers.CATALOG_SWITCH.doSwitch(parentPack);
  try {
    List<TdTable> tdTables=DqRepositoryViewService.getTables(tdDataProvider,catalogObj,tableName,true);
    if (!tdTables.isEmpty()) {
      TdTable table=tdTables.get(0);
      if (!CatalogHelper.getTables(catalogObj).contains(table)) {
        CatalogHelper.addTables(tdTables,catalogObj);
      }
      List<TdColumn> columns=DqRepositoryViewService.getColumns(tdDataProvider,table,null,true);
      new AnalyzeColumnSetAction(columns.toArray(new TdColumn[columns.size()])).run();
    }
 else {
      MessageUI.openWarning("String_Node_Str" + tableName + "String_Node_Str");
    }
  }
 catch (  TalendException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "runTableAnalysis".
 * @param tableName
 */
protected void runTableAnalysis(String tableName){
  Package parentPack=(Package)currentSelectionSchemaIndicator.getAnalyzedElement();
  TdTable tdTable=getTable(parentPack,tableName);
  if (null == tdTable) {
    FolderNodeHelper.getTableFolderNode(parentPack).loadChildren();
    tdTable=getTable(parentPack,tableName);
  }
  try {
    List<TdColumn> columns=0 == ColumnSetHelper.getColumns(tdTable).size() ? DqRepositoryViewService.getColumns(tdDataProvider,tdTable,null,true) : ColumnSetHelper.getColumns(tdTable);
    new AnalyzeColumnSetAction(columns.toArray(new TdColumn[columns.size()])).run();
  }
 catch (  TalendException e) {
    log.error(e.getMessage());
    e.printStackTrace();
  }
}
Program: 139269
Project: 139269
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.masterPage.chageExecuteLanguageToJava();
    }
    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();
  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: 139270
Project: 139270
Buggy source:
public boolean hasChildren(Object element){
  if (element instanceof TdView || element instanceof TdTable) {
    return false;
  }
  return !super.hasChildren(element);
}

Fixed version (ground truth):
public boolean hasChildren(Object element){
  if (element instanceof TdView || element instanceof TdTable) {
    return false;
  }
  return superHasChildren(element);
}
Program: 139271
Project: 139271
Buggy source:
private void initCheckedModelElement(List<? extends ModelElement> modelElementList){
  List<ModelElement> containerList=new ArrayList<ModelElement>();
  for (int i=0; i < modelElementList.size(); i++) {
    ModelElement modelElement=modelElementList.get(i);
    mdmFlag=mdmFlag || modelElement instanceof TdXMLElement;
    ModelElement container=ModelElementHelper.getContainer(modelElement);
    if (!containerList.contains(container)) {
      containerList.add(container);
    }
    ModelElementKey modelElementKey=new ModelElementKeyImpl(container);
    ModelElementCheckedMap meCheckedMap=modelElementCheckedMap.get(modelElementKey);
    if (meCheckedMap == null) {
      meCheckedMap=new ModelElementCheckedMapImpl();
      this.modelElementCheckedMap.put(modelElementKey,meCheckedMap);
    }
    meCheckedMap.putModelElementChecked(modelElement,Boolean.TRUE);
  }
  this.setInitialElementSelections(containerList);
}

Fixed version (ground truth):
private void initCheckedModelElement(List<? extends ModelElement> modelElementList){
  List<ModelElement> containerList=new ArrayList<ModelElement>();
  for (int i=0; i < modelElementList.size(); i++) {
    ModelElement modelElement=modelElementList.get(i);
    ModelElement container=ModelElementHelper.getContainer(modelElement);
    if (!containerList.contains(container)) {
      containerList.add(container);
    }
    ModelElementKey modelElementKey=new ModelElementKeyImpl(container);
    ModelElementCheckedMap meCheckedMap=modelElementCheckedMap.get(modelElementKey);
    if (meCheckedMap == null) {
      meCheckedMap=new ModelElementCheckedMapImpl();
      this.modelElementCheckedMap.put(modelElementKey,meCheckedMap);
    }
    meCheckedMap.putModelElementChecked(modelElement,Boolean.TRUE);
  }
  this.setInitialElementSelections(containerList);
}
Program: 139273
Project: 139273
Buggy source:
/** 
 * DOC scorreia Comment method "getSqlExpression".
 * @param indicatorDefinition
 * @param defaultLanguage
 * @return
 */
private static Expression getSqlExpression(IndicatorDefinition indicatorDefinition,String language,EList<Expression> sqlGenericExpression){
  for (  Expression sqlGenExpr : sqlGenericExpression) {
    if (DbmsLanguageFactory.compareDbmsLanguage(language,sqlGenExpr.getLanguage())) {
      return sqlGenExpr;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getSqlExpression". ADD xqliu 2010-02-25 feature 11201
 * @param indicatorDefinition
 * @param language
 * @param sqlGenericExpression
 * @param dbVersion
 * @return
 */
private static Expression getSqlExpression(IndicatorDefinition indicatorDefinition,String language,EList<Expression> sqlGenericExpression,ProductVersion dbVersion){
  List<Expression> tempExpressions=new ArrayList<Expression>();
  for (  Expression sqlGenExpr : sqlGenericExpression) {
    if (DbmsLanguageFactory.compareDbmsLanguage(language,sqlGenExpr.getLanguage())) {
      tempExpressions.add(sqlGenExpr);
    }
  }
  Expression defaultExpression=null;
  for (  Expression exp : tempExpressions) {
    if (exp.getVersion() == null || "String_Node_Str".equals(exp.getVersion())) {
      defaultExpression=exp;
    }
 else {
      if (dbVersion.toString().startsWith(exp.getVersion()) || exp.getVersion().startsWith(dbVersion.toString())) {
        return exp;
      }
    }
  }
  return defaultExpression;
}
Program: 139274
Project: 139274
Buggy source:
private List<String> getFunctions(IndicatorDefinition indicatorDefinition,final EList<Expression> functions){
  Expression sqlGenExpr=getSqlExpression(indicatorDefinition,this.dbmsName,functions);
  if (sqlGenExpr != null) {
    final String body=sqlGenExpr.getBody();
    final String[] fonc=body.split("String_Node_Str");
    return Arrays.asList(fonc);
  }
  sqlGenExpr=getSqlExpression(indicatorDefinition,getDefaultLanguage(),functions);
  if (sqlGenExpr != null) {
    final String body=sqlGenExpr.getBody();
    final String[] fonc=body.split("String_Node_Str");
    return Arrays.asList(fonc);
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
private List<String> getFunctions(IndicatorDefinition indicatorDefinition,final EList<Expression> functions){
  Expression sqlGenExpr=MATCH_DB_VERSION ? getSqlExpression(indicatorDefinition,this.dbmsName,functions,this.getDbVersion()) : getSqlExpression(indicatorDefinition,this.dbmsName,functions);
  if (sqlGenExpr != null) {
    final String body=sqlGenExpr.getBody();
    final String[] fonc=body.split("String_Node_Str");
    return Arrays.asList(fonc);
  }
  sqlGenExpr=MATCH_DB_VERSION ? getSqlExpression(indicatorDefinition,getDefaultLanguage(),functions,this.getDbVersion()) : getSqlExpression(indicatorDefinition,getDefaultLanguage(),functions);
  if (sqlGenExpr != null) {
    final String body=sqlGenExpr.getBody();
    final String[] fonc=body.split("String_Node_Str");
    return Arrays.asList(fonc);
  }
  return Collections.emptyList();
}
Program: 139277
Project: 139277
Buggy source:
private void buildJoinClause(StringBuilder builder,String tableA,String tableAliasA,String columnAName,boolean hasTableAliasA,String tableB,String tableAliasB,String columnBName,boolean hasTableAliasB,String operator){
  boolean hasAlreadyOneJoin=builder.toString().contains(this.join());
  if (hasTableAliasA && !hasAlreadyOneJoin) {
    builder.append(surroundWithSpaces(tableAliasA));
  }
  join(builder,quote(tableA),tableAliasA,quote(columnAName),hasTableAliasA,quote(tableB),tableAliasB,quote(columnBName),hasTableAliasB,operator);
}

Fixed version (ground truth):
private void buildJoinClause(StringBuilder builder,String tableA,String tableAliasA,String columnAName,boolean hasTableAliasA,String tableB,String tableAliasB,String columnBName,boolean hasTableAliasB,String operator){
  boolean hasAlreadyOneJoin=builder.toString().contains(this.join());
  if (hasTableAliasA && !hasAlreadyOneJoin) {
    builder.append(surroundWithSpaces(tableAliasA));
  }
  join(builder,quote(tableA),tableAliasA,quote(columnAName),hasTableAliasA,tableB,tableAliasB,quote(columnBName),hasTableAliasB,operator);
}
Program: 139278
Project: 139278
Buggy source:
public String createJoinConditionAsString(ModelElement leftTable,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);
    boolean hasTableAliasA=!StringUtils.isEmpty(tableAliasA);
    ModelElement colB=joinElement.getColB();
    String tableB=getTableName(colB);
    String tableAliasB=joinElement.getTableAliasB();
    String columnBName=getColumnName(colB);
    boolean hasTableAliasB=!StringUtils.isEmpty(tableAliasB);
    String operator=joinElement.getOperator();
    if (joinClauseStartsWithWrongTable(leftTable,getTable(colB)) && !hasTableAliasA && !hasTableAliasB) {
      buildJoinClause(builder,tableB,tableAliasB,columnBName,hasTableAliasB,tableA,tableAliasA,columnAName,hasTableAliasA,operator);
    }
 else {
      buildJoinClause(builder,tableA,tableAliasA,columnAName,hasTableAliasA,tableB,tableAliasB,columnBName,hasTableAliasB,operator);
    }
  }
  return builder.toString();
}

Fixed version (ground truth):
public String createJoinConditionAsString(ModelElement leftTable,List<JoinElement> joinElements,String catalogName,String schemaName){
  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);
    boolean hasTableAliasA=!StringUtils.isEmpty(tableAliasA);
    ModelElement colB=joinElement.getColB();
    String tableB=getTableName(colB);
    String tableAliasB=joinElement.getTableAliasB();
    String columnBName=getColumnName(colB);
    boolean hasTableAliasB=!StringUtils.isEmpty(tableAliasB);
    String operator=joinElement.getOperator();
    if (joinClauseStartsWithWrongTable(leftTable,getTable(colB)) && !hasTableAliasA && !hasTableAliasB) {
      tableA=toQualifiedName(catalogName,schemaName,tableA);
      buildJoinClause(builder,tableB,tableAliasB,columnBName,hasTableAliasB,tableA,tableAliasA,columnAName,hasTableAliasA,operator);
    }
 else {
      tableB=toQualifiedName(catalogName,schemaName,tableB);
      buildJoinClause(builder,tableA,tableAliasA,columnAName,hasTableAliasA,tableB,tableAliasB,columnBName,hasTableAliasB,operator);
    }
  }
  return builder.toString();
}
Program: 139279
Project: 139279
Buggy source:
public String getVersion(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getVersion(){
  return DatabaseConstant.MDM_VERSION;
}
Program: 139280
Project: 139280
Buggy source:
public boolean execute(){
  IFile talendDefinitionFile=DefinitionHandler.getTalendDefinitionFile();
  if (talendDefinitionFile.exists()) {
    try {
      talendDefinitionFile.delete(true,null);
      IFolder librariesFolder=ResourceManager.getLibrariesFolder();
      DefinitionHandler.getInstance().copyDefinitionsIntoFolder(librariesFolder);
    }
 catch (    Exception e) {
      log.error(e,e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  IFile talendDefinitionFile=DefinitionHandler.getTalendDefinitionFile();
  if (talendDefinitionFile.exists()) {
    try {
      talendDefinitionFile.delete(true,null);
      DefinitionHandler.getInstance();
    }
 catch (    Exception e) {
      log.error(e,e);
      return false;
    }
  }
  return true;
}
Program: 139281
Project: 139281
Buggy source:
/** 
 * DOC bZhou Comment method "copyDefinitionsIntoFolder".
 * @param ifolder
 * @return
 */
public Resource copyDefinitionsIntoFolder(IFolder ifolder){
  File folder=new File(ifolder.getLocationURI());
  return copyDefinitionsIntoFolder(folder);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "copyDefinitionsIntoFolder".
 * @param destinationUri
 * @return
 */
public Resource copyDefinitionsIntoFolder(URI destinationUri){
  Resource resource=getIndicatorsDefinitions().eResource();
  EMFUtil.changeUri(resource,destinationUri);
  if (EMFUtil.saveResource(resource)) {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + resource.getURI());
    }
  }
 else {
    log.error("String_Node_Str" + resource.getURI());
  }
  return resource;
}
Program: 139282
Project: 139282
Buggy source:
public static Boolean hasChildren(TdXMLElement element){
  XMLSchemaBuilder xmlScheBuilder=XMLSchemaBuilder.getSchemaBuilder(element.getOwnedDocument());
  return !xmlScheBuilder.isLeafNode(element).isOk();
}

Fixed version (ground truth):
public static Boolean hasChildren(TdXMLElement element){
  XMLSchemaBuilder xmlScheBuilder=XMLSchemaBuilder.getSchemaBuilder(element.getOwnedDocument());
  return xmlScheBuilder.isLeafNode(element).isOk();
}
Program: 139283
Project: 139283
Buggy source:
public boolean hasChildren(Object element){
  if (element instanceof TdView || element instanceof TdTable) {
    return false;
  }
  return super.hasChildren(element);
}

Fixed version (ground truth):
public boolean hasChildren(Object element){
  if (element instanceof TdView || element instanceof TdTable) {
    return false;
  }
  return !super.hasChildren(element);
}
Program: 139284
Project: 139284
Buggy source:
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators,ExecutionLanguage language){
  super(parentShell);
  this.title=title;
  this.modelElementIndicators=modelElementIndicators;
  this.language=language;
  int shellStyle=getShellStyle();
  setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
}

Fixed version (ground truth):
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  super(parentShell);
  this.title=title;
  this.modelElementIndicators=modelElementIndicators;
  int shellStyle=getShellStyle();
  setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
}
Program: 139285
Project: 139285
Buggy source:
@Override protected Indicator getMatchedIndicator(){
  return ColumnsetFactory.eINSTANCE.createSimpleStatIndicator();
}

Fixed version (ground truth):
@Override protected Indicator getMatchedIndicator(){
  SimpleStatIndicator ssIndicator=ColumnsetFactory.eINSTANCE.createSimpleStatIndicator();
  ssIndicator.setRowCountIndicator(IndicatorsFactory.eINSTANCE.createRowCountIndicator());
  ssIndicator.setDistinctCountIndicator(IndicatorsFactory.eINSTANCE.createDistinctCountIndicator());
  ssIndicator.setDuplicateCountIndicator(IndicatorsFactory.eINSTANCE.createDuplicateCountIndicator());
  ssIndicator.setUniqueCountIndicator(IndicatorsFactory.eINSTANCE.createUniqueCountIndicator());
  return ssIndicator;
}
Program: 139286
Project: 139286
Buggy source:
private static AnalysisCategories loadFromFile(){
  EMFUtil util=new EMFUtil();
  String pathName="String_Node_Str";
  URI uri=URI.createPlatformPluginURI(pathName,false);
  Resource catFile=null;
  try {
    catFile=util.getResourceSet().getResource(uri,true);
  }
 catch (  RuntimeException e) {
    log.error(e.getMessage());
  }
  if (catFile == null) {
    catFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + pathName),true);
  }
  if (catFile == null) {
    log.error("String_Node_Str" + pathName + "String_Node_Str"+ uri);
    return null;
  }
  EList<EObject> contents=catFile.getContents();
  if (contents == null) {
    log.error("String_Node_Str" + uri);
    return null;
  }
  CategorySwitch<AnalysisCategories> catSwitch=new CategorySwitch<AnalysisCategories>(){
    @Override public AnalysisCategories caseAnalysisCategories(    AnalysisCategories object){
      return object;
    }
  }
;
  return catSwitch.doSwitch(contents.get(0));
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "loadFromFile".
 * @return
 */
private static AnalysisCategories loadFromFile(){
  EMFUtil util=new EMFUtil();
  String pathName="String_Node_Str";
  URI uri=URI.createPlatformPluginURI(pathName,false);
  Resource catFile=null;
  try {
    catFile=util.getResourceSet().getResource(uri,true);
  }
 catch (  RuntimeException e) {
    log.error(e.getMessage());
  }
  if (catFile == null) {
    catFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + pathName),true);
  }
  if (catFile == null) {
    log.error("String_Node_Str" + pathName + "String_Node_Str"+ uri);
    return null;
  }
  EList<EObject> contents=catFile.getContents();
  if (contents == null) {
    log.error("String_Node_Str" + uri);
    return null;
  }
  CategorySwitch<AnalysisCategories> catSwitch=new CategorySwitch<AnalysisCategories>(){
    @Override public AnalysisCategories caseAnalysisCategories(    AnalysisCategories object){
      return object;
    }
  }
;
  return catSwitch.doSwitch(contents.get(0));
}
Program: 139287
Project: 139287
Buggy source:
@Override public void loadChildren(){
  if (getCategoriesIDMaps() != null) {
    setChildren(getCategoriesIDMaps().keySet().toArray(new IndicatorCategory[getCategoriesIDMaps().keySet().size()]));
  }
}

Fixed version (ground truth):
@Override public void loadChildren(){
  Map<IndicatorCategory,List<IndicatorDefinition>> categoriesIDMaps=CategoryHandler.getCategoriesIDMaps();
  if (categoriesIDMaps != null) {
    setChildren(categoriesIDMaps.keySet().toArray(new IndicatorCategory[categoriesIDMaps.keySet().size()]));
  }
}
Program: 139288
Project: 139288
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage != null && masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (masterPage != null && masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(masterPage.getIntactElemenetName());
  }
  super.doSave(monitor);
}
Program: 139289
Project: 139289
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(((ConnectionInfoPage)masterPage).getIntactElemenetName());
  }
  super.doSave(monitor);
}
Program: 139290
Project: 139290
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(((DQRuleMasterDetailsPage)masterPage).getIntactElemenetName());
  }
  super.doSave(monitor);
}
Program: 139291
Project: 139291
Buggy source:
@Override public void doSave(IProgressMonitor monitor){
  masterPage.doSave(monitor);
  super.doSave(monitor);
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  masterPage.doSave(monitor);
  setPartName(masterPage.getIntactElemenetName());
  super.doSave(monitor);
}
Program: 139292
Project: 139292
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(((PatternMasterDetailsPage)masterPage).getIntactElemenetName());
  }
  super.doSave(monitor);
}