nus-yam/ex-repair huggingface dataset:
Program: 140754
Project: 140754
Buggy source:
public String getText(Object element){
  if (element instanceof TableFolderNode) {
    TableFolderNode node=(TableFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getTables(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ViewFolderNode) {
    ViewFolderNode node=(ViewFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getViews(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ColumnFolderNode) {
    ColumnFolderNode node=(ColumnFolderNode)element;
    if (node.isLoaded()) {
      ColumnSet table=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + ColumnSetHelper.getColumns(table).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof TableFolderNode) {
    TableFolderNode node=(TableFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getTables(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ViewFolderNode) {
    ViewFolderNode node=(ViewFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getViews(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ColumnFolderNode) {
    ColumnFolderNode node=(ColumnFolderNode)element;
    if (node.isLoaded()) {
      ColumnSet table=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + ColumnSetHelper.getColumns(table).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof Pattern) {
    Pattern pattern=(Pattern)element;
    RegularExpression patternComponent=(RegularExpression)pattern.getComponents().get(0);
    return patternComponent.getExpression().getBody();
  }
  return super.getText(element);
}
Program: 140755
Project: 140755
Buggy source:
@Override public Object[] getChildren(Object element){
  if (needSortContainers.contains(element)) {
    return sort(super.getChildren(element));
  }
  return super.getChildren(element);
}

Fixed version (ground truth):
@Override public Object[] getChildren(Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getName().endsWith(NewSourcePatternActionProvider.EXTENSION_PATTERN)) {
      Pattern pattern=PatternDNDFactory.getPattern(file);
      return new Object[]{pattern};
    }
  }
  if (needSortContainers.contains(element)) {
    return sort(super.getChildren(element));
  }
  return super.getChildren(element);
}
Program: 140756
Project: 140756
Buggy source:
@Override public void drop(DropTargetEvent event){
  super.drop(event);
  IFile fe=(IFile)((StructuredSelection)commonViewer.getSelection()).getFirstElement();
  Pattern pattern=getPattern(fe);
  TreeItem item=(TreeItem)event.item;
  ColumnIndicator data=(ColumnIndicator)item.getData(AnalysisColumnTreeViewer.COLUMN_INDICATOR_KEY);
  PatternMatchingIndicator patternMatchingIndicator=IndicatorsFactory.eINSTANCE.createPatternMatchingIndicator();
  IndicatorParameters indicParams=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  Domain validData=DomainFactory.eINSTANCE.createDomain();
  validData.getPatterns().add(pattern);
  indicParams.setDataValidDomain(validData);
  patternMatchingIndicator.setParameters(indicParams);
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  data.addIndicator(type,patternMatchingIndicator);
  AnalysisColumnTreeViewer viewer=(AnalysisColumnTreeViewer)item.getData(AnalysisColumnTreeViewer.VIEWER_KEY);
  viewer.createOneUnit(item,data.getIndicatorUnit(type));
  viewer.setDirty(true);
}

Fixed version (ground truth):
@Override public void drop(DropTargetEvent event){
  super.drop(event);
  IFile fe=(IFile)((StructuredSelection)commonViewer.getSelection()).getFirstElement();
  Pattern pattern=getPattern(fe);
  TreeItem item=(TreeItem)event.item;
  ColumnIndicator data=(ColumnIndicator)item.getData(AnalysisColumnTreeViewer.COLUMN_INDICATOR_KEY);
  PatternMatchingIndicator patternMatchingIndicator=IndicatorsFactory.eINSTANCE.createPatternMatchingIndicator();
  IndicatorParameters indicParams=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  Domain validData=DomainFactory.eINSTANCE.createDomain();
  validData.getPatterns().add(pattern);
  indicParams.setDataValidDomain(validData);
  patternMatchingIndicator.setParameters(indicParams);
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  data.addPatternIndicator(type,patternMatchingIndicator);
  AnalysisColumnTreeViewer viewer=(AnalysisColumnTreeViewer)item.getData(AnalysisColumnTreeViewer.VIEWER_KEY);
  viewer.createOneUnit(item,data.getIndicatorUnit(type));
  viewer.setDirty(true);
}
Program: 140757
Project: 140757
Buggy source:
@Override public void dragOperationChanged(DropTargetEvent event){
  super.dragOperationChanged(event);
  event.feedback=DND.FEEDBACK_EXPAND;
  doDropValidation(event);
}

Fixed version (ground truth):
@Override public void dragOperationChanged(DropTargetEvent event){
  super.dragOperationChanged(event);
  event.feedback=DND.FEEDBACK_EXPAND;
  doDropValidation(event,commonViewer);
}
Program: 140759
Project: 140759
Buggy source:
@Override public void dragEnter(DropTargetEvent event){
  super.dragEnter(event);
  event.feedback=DND.FEEDBACK_EXPAND;
  doDropValidation(event);
}

Fixed version (ground truth):
@Override public void dragEnter(DropTargetEvent event){
  super.dragEnter(event);
  event.feedback=DND.FEEDBACK_EXPAND;
  doDropValidation(event,commonViewer);
}
Program: 140760
Project: 140760
Buggy source:
@Override public void dropAccept(DropTargetEvent event){
  super.dropAccept(event);
  doDropValidation(event);
}

Fixed version (ground truth):
@Override public void dropAccept(DropTargetEvent event){
  super.dropAccept(event);
  doDropValidation(event,commonViewer);
}
Program: 140761
Project: 140761
Buggy source:
@Override public void dragOver(DropTargetEvent event){
  super.dragOver(event);
  doDropValidation(event);
}

Fixed version (ground truth):
@Override public void dragOver(DropTargetEvent event){
  super.dragOver(event);
  doDropValidation(event,commonViewer);
}
Program: 140762
Project: 140762
Buggy source:
/** 
 * DOC qzhang Comment method "doDropValidation".
 * @param event
 */
protected static void doDropValidation(DropTargetEvent event){
  if (event.detail != DND.DROP_NONE) {
    lastValidOperation=event.detail;
  }
  Object data=event.item.getData(AnalysisColumnTreeViewer.INDICATOR_UNIT_KEY);
  if (data != null) {
    event.detail=DND.DROP_NONE;
  }
 else {
    event.detail=lastValidOperation;
  }
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "doDropValidation".
 * @param event
 * @param commonViewer
 */
protected static void doDropValidation(DropTargetEvent event,CommonViewer commonViewer){
  if (event.detail != DND.DROP_NONE) {
    lastValidOperation=event.detail;
  }
  boolean is=true;
  Object firstElement=((StructuredSelection)commonViewer.getSelection()).getFirstElement();
  if (firstElement instanceof IFile) {
    IFile fe=(IFile)firstElement;
    if (NewSourcePatternActionProvider.EXTENSION_PATTERN.equals(fe.getFileExtension())) {
      Pattern pattern=getPattern(fe);
      if (pattern != null) {
        is=false;
      }
    }
  }
  if (event.item == null || is) {
    event.detail=DND.DROP_NONE;
  }
 else {
    Object data=event.item.getData(AnalysisColumnTreeViewer.INDICATOR_UNIT_KEY);
    if (data != null) {
      event.detail=DND.DROP_NONE;
    }
 else {
      event.detail=lastValidOperation;
    }
  }
}
Program: 140763
Project: 140763
Buggy source:
/** 
 * DOC xy Comment method "createResource".
 * @param absolutePath
 * @return
 */
protected Resource getPathResource(String absolutePath){
  Resource res=registedResourceMap.get(absolutePath);
  if (res != null) {
    return res;
  }
  EMFUtil util=new EMFUtil();
  URI uri=URI.createFileURI(absolutePath);
  ResourceSet rs=util.getResourceSet();
  Resource resource=rs.getResource(uri,true);
  this.registedResourceMap.put(absolutePath,resource);
  return resource;
}

Fixed version (ground truth):
/** 
 * DOC xy Comment method "createResource".
 * @param absolutePath
 * @return
 */
protected Resource getPathResource(String absolutePath){
  Resource res=registedResourceMap.get(absolutePath);
  if (res != null) {
    return res;
  }
  URI uri=URI.createFileURI(absolutePath);
  ResourceSet rs=EMFUtil.getInstance().getResourceSet();
  Resource resource=rs.getResource(uri,true);
  this.registedResourceMap.put(absolutePath,resource);
  return resource;
}
Program: 140764
Project: 140764
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=new EMFUtil();
  IPath location=folder.getLocation();
  location=location.append(name);
  location=location.addFileExtension(NewSourcePatternActionProvider.EXTENSION_PATTERN);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.save();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFUtil.getInstance();
  IPath location=folder.getLocation();
  location=location.append(name);
  location=location.addFileExtension(NewSourcePatternActionProvider.EXTENSION_PATTERN);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.save();
  return true;
}
Program: 140765
Project: 140765
Buggy source:
/** 
 * DOC qzhang Comment method "getPattern".
 * @param fe
 * @return
 */
protected static Pattern getPattern(IFile file){
  EMFUtil util=new EMFUtil();
  Resource resource=util.getResourceSet().getResource(URI.createPlatformResourceURI(file.getFullPath().toString()),true);
  Pattern pattern=(Pattern)EcoreUtil.getObjectByType(resource.getContents(),PatternPackage.eINSTANCE.getPattern());
  return pattern;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "getPattern".
 * @param fe
 * @return
 */
protected static Pattern getPattern(IFile file){
  EMFUtil util=EMFUtil.getInstance();
  Resource resource=util.getResourceSet().getResource(URI.createPlatformResourceURI(file.getFullPath().toString()),true);
  Pattern pattern=(Pattern)EcoreUtil.getObjectByType(resource.getContents(),PatternPackage.eINSTANCE.getPattern());
  return pattern;
}
Program: 140766
Project: 140766
Buggy source:
private void removeDependencys(IResource[] resources){
  for (  IResource selectedObj : resources) {
    IFile file=((IFile)selectedObj);
    ModelElement elementToDelete=null;
    if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PROV)) {
      TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().readFromFile(file);
      elementToDelete=returnValue.getObject();
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.ANA)) {
      elementToDelete=AnaResourceFileHelper.getInstance().findAnalysis(file);
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.REP)) {
      elementToDelete=RepResourceFileHelper.getInstance().findReport(file);
    }
    if (elementToDelete != null) {
      List<Resource> modifiedResources=DependenciesHandler.getInstance().clearDependencies(elementToDelete);
      EMFUtil util=new EMFUtil();
      util.getResourceSet().getResources().addAll(modifiedResources);
      if (!util.save()) {
        log.warn("String_Node_Str" + util.getLastErrorMessage());
      }
    }
  }
  CorePlugin.getDefault().refreshWorkSpace();
  DQRespositoryView findView=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  findView.getCommonViewer().refresh();
}

Fixed version (ground truth):
private void removeDependencys(IResource[] resources){
  for (  IResource selectedObj : resources) {
    IFile file=((IFile)selectedObj);
    ModelElement elementToDelete=null;
    if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PROV)) {
      TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().readFromFile(file);
      elementToDelete=returnValue.getObject();
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.ANA)) {
      elementToDelete=AnaResourceFileHelper.getInstance().findAnalysis(file);
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.REP)) {
      elementToDelete=RepResourceFileHelper.getInstance().findReport(file);
    }
    if (elementToDelete != null) {
      List<Resource> modifiedResources=DependenciesHandler.getInstance().clearDependencies(elementToDelete);
      EMFUtil util=EMFUtil.getInstance();
      util.getResourceSet().getResources().addAll(modifiedResources);
      if (!util.save()) {
        log.warn("String_Node_Str" + util.getLastErrorMessage());
      }
    }
  }
  CorePlugin.getDefault().refreshWorkSpace();
  DQRespositoryView findView=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  findView.getCommonViewer().refresh();
}
Program: 140768
Project: 140768
Buggy source:
public void addPatternIndicator(IndicatorEnum indicatorEnum,Indicator indicator){
  this.flatIndicatorEnumList.add(indicatorEnum);
  IndicatorUnit createIndicatorUnit=this.createIndicatorUnit(indicatorEnum,indicator);
  int size=currentindicatorUnits.length;
  IndicatorUnit[] newUnits=new IndicatorUnit[size + 1];
  System.arraycopy(currentindicatorUnits,0,newUnits,0,size);
  newUnits[size]=createIndicatorUnit;
  this.currentindicatorUnits=newUnits;
}

Fixed version (ground truth):
public void addPatternIndicator(IndicatorEnum indicatorEnum,Indicator indicator){
  this.flatIndicatorEnumList.add(indicatorEnum);
  IndicatorUnit createIndicatorUnit=this.createIndicatorUnit(indicatorEnum,indicator);
  int size=0;
  if (currentindicatorUnits != null) {
    size=currentindicatorUnits.length;
  }
  IndicatorUnit[] newUnits=new IndicatorUnit[size + 1];
  if (currentindicatorUnits != null) {
    System.arraycopy(currentindicatorUnits,0,newUnits,0,size);
  }
  newUnits[size]=createIndicatorUnit;
  this.currentindicatorUnits=newUnits;
}
Program: 140769
Project: 140769
Buggy source:
/** 
 * Method "saveSingleResource" saves the given resource only. This method is a helper for saving quickly a given resource. It does not saved the related resources. This could result in an exception when other related resources should be saved with this resource.
 * @param resource the resource to save
 * @return true if no problem
 */
public static boolean saveSingleResource(Resource resource){
  EMFUtil util=new EMFUtil();
  util.getResourceSet().getResources().add(resource);
  return util.save();
}

Fixed version (ground truth):
/** 
 * Method "saveSingleResource" saves the given resource only. This method is a helper for saving quickly a given resource. It does not saved the related resources. This could result in an exception when other related resources should be saved with this resource.
 * @param resource the resource to save
 * @return true if no problem
 */
public boolean saveSingleResource(Resource resource){
  EMFUtil util=new EMFUtil();
  util.getResourceSet().getResources().add(resource);
  return util.save();
}
Program: 140770
Project: 140770
Buggy source:
/** 
 * Changes the uri of the given resource. The new uri is formed with the name of the input resource's uri appended to the path outputUri.
 * @param res the input resource
 * @param destinationUri the destination directory
 * @return the new uri.
 */
public static URI changeUri(Resource res,URI destinationUri){
  URI uri=res.getURI();
  URI newUri=destinationUri.appendSegment(uri.lastSegment());
  res.setURI(newUri);
  return newUri;
}

Fixed version (ground truth):
/** 
 * Changes the uri of the given resource. The new uri is formed with the name of the input resource's uri appended to the path outputUri.
 * @param res the input resource
 * @param destinationUri the destination directory
 * @return the new uri.
 */
public URI changeUri(Resource res,URI destinationUri){
  URI uri=res.getURI();
  URI newUri=destinationUri.appendSegment(uri.lastSegment());
  res.setURI(newUri);
  return newUri;
}
Program: 140771
Project: 140771
Buggy source:
/** 
 * This CTOR initializes all packages and create a resource set.
 * @param fileExtensions the list of extensions (without the dot).
 */
public EMFUtil(){
  options=new HashMap<String,Object>();
  options.put(XMIResource.OPTION_DECLARE_XML,Boolean.TRUE);
  options.put(XMIResource.OPTION_ENCODING,ENCODING);
  resourceSet=new ResourceSetImpl();
}

Fixed version (ground truth):
/** 
 * This CTOR initializes all packages and create a resource set.
 * @param fileExtensions the list of extensions (without the dot).
 */
private EMFUtil(){
  initialize();
  options=new HashMap<String,Object>();
  options.put(XMIResource.OPTION_DECLARE_XML,Boolean.TRUE);
  options.put(XMIResource.OPTION_ENCODING,ENCODING);
  resourceSet=new ResourceSetImpl();
}
Program: 140772
Project: 140772
Buggy source:
/** 
 * Method "initialize" initializes EMF factories, packages and file extensions.
 */
private static void initialize(){
  FactoriesUtil.initializeAllFactories();
  FactoriesUtil.initializeAllPackages();
  Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  final Collection<String> fileExtensions=FactoriesUtil.getExtensions();
  Map<String,Object> m=reg.getExtensionToFactoryMap();
  for (  String extension : fileExtensions) {
    m.put(extension,new CwmResourceFactory());
  }
}

Fixed version (ground truth):
/** 
 * Method "initialize" initializes EMF factories, packages and file extensions.
 */
private void initialize(){
  FactoriesUtil.initializeAllFactories();
  FactoriesUtil.initializeAllPackages();
  Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  final Collection<String> fileExtensions=FactoriesUtil.getExtensions();
  Map<String,Object> m=reg.getExtensionToFactoryMap();
  for (  String extension : fileExtensions) {
    m.put(extension,new CwmResourceFactory());
  }
}
Program: 140773
Project: 140773
Buggy source:
/** 
 * Method "saveResource" saves the given resource. This method is a helper for saving quickly a given resource and all its related resources (if any).
 * @param resource the resource to save
 * @return true if no problem
 */
public static boolean saveResource(Resource resource){
  ResourceSet resourceSet=resource.getResourceSet();
  EMFUtil util=new EMFUtil();
  if (resourceSet != null) {
    util.setResourceSet(resourceSet);
    return util.save();
  }
  util.getResourceSet().getResources().add(resource);
  return util.save();
}

Fixed version (ground truth):
/** 
 * Method "saveResource" saves the given resource. This method is a helper for saving quickly a given resource and all its related resources (if any).
 * @param resource the resource to save
 * @return true if no problem
 */
public boolean saveResource(Resource resource){
  ResourceSet resourceSet=resource.getResourceSet();
  EMFUtil util=new EMFUtil();
  if (resourceSet != null) {
    util.setResourceSet(resourceSet);
    return util.save();
  }
  util.getResourceSet().getResources().add(resource);
  return util.save();
}
Program: 140774
Project: 140774
Buggy source:
protected String decorateText(String input,Object element){
  if (input.endsWith(PluginConstant.PRV_SUFFIX)) {
    IFile fileElement=(IFile)element;
    TypedReturnCode<TdDataProvider> rc=PrvResourceFileHelper.getInstance().getTdProvider(fileElement);
    String decorateText=PluginConstant.EMPTY_STRING;
    if (rc.isOk()) {
      decorateText=rc.getObject().getName();
    }
 else {
      log.warn(rc.getMessage());
    }
    return decorateText;
  }
 else   if (input.endsWith(PluginConstant.ANA_SUFFIX)) {
    IFile fileElement=(IFile)element;
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + (fileElement).getLocation());
    }
    Analysis analysis=AnaResourceFileHelper.getInstance().findAnalysis(fileElement);
    if (analysis != null) {
      Date executionDate=analysis.getResults().getResultMetadata().getExecutionDate();
      String executeInfo=executionDate == null ? "String_Node_Str" : PluginConstant.PARENTHESIS_LEFT + DateFormatUtils.getSimpleDateString(executionDate) + PluginConstant.PARENTHESIS_RIGHT;
      return analysis.getName() + PluginConstant.SPACE_STRING + executeInfo;
    }
  }
 else   if (input.endsWith(PluginConstant.REP_SUFFIX)) {
    IFile fileElement=(IFile)element;
    TdReport findReport=RepResourceFileHelper.getInstance().findReport(fileElement);
    return findReport.getName();
  }
  return super.decorateText(input,element);
}

Fixed version (ground truth):
protected String decorateText(String input,Object element){
  if (input.endsWith(PluginConstant.PRV_SUFFIX)) {
    IFile fileElement=(IFile)element;
    TypedReturnCode<TdDataProvider> rc=PrvResourceFileHelper.getInstance().getTdProvider(fileElement);
    String decorateText=PluginConstant.EMPTY_STRING;
    if (rc.isOk()) {
      decorateText=rc.getObject().getName();
    }
 else {
      log.warn(rc.getMessage());
    }
    return decorateText;
  }
 else   if (input.endsWith(PluginConstant.ANA_SUFFIX)) {
    IFile fileElement=(IFile)element;
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + (fileElement).getLocation());
    }
    Analysis analysis=AnaResourceFileHelper.getInstance().findAnalysis(fileElement);
    if (analysis != null) {
      Date executionDate=analysis.getResults().getResultMetadata().getExecutionDate();
      String executeInfo=executionDate == null ? "String_Node_Str" : PluginConstant.PARENTHESIS_LEFT + DateFormatUtils.getSimpleDateString(executionDate) + PluginConstant.PARENTHESIS_RIGHT;
      return analysis.getName() + PluginConstant.SPACE_STRING + executeInfo;
    }
  }
 else   if (input.endsWith(PluginConstant.REP_SUFFIX)) {
    IFile fileElement=(IFile)element;
    TdReport findReport=RepResourceFileHelper.getInstance().findReport(fileElement);
    return findReport.getName();
  }
 else   if (input.endsWith(NewSourcePatternActionProvider.EXTENSION_PATTERN)) {
    IPath path=new Path(input);
    path=path.removeFileExtension();
    return path.toString();
  }
  return super.decorateText(input,element);
}
Program: 140775
Project: 140775
Buggy source:
public void run(){
}

Fixed version (ground truth):
public void run(){
  CorePlugin.getDefault().openEditor(currentSelection,ConnectionEditor.class.getName());
}
Program: 140776
Project: 140776
Buggy source:
@Override public void run(){
  new CreateNewAnalysisAction().run(null,null);
  AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null) {
    ColumnMasterDetailsPage page=(ColumnMasterDetailsPage)editor.getMasterPage();
    if (allColumns.size() != 0) {
      page.getTreeViewer().setInput(allColumns.toArray());
      this.allColumns.clear();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  new CreateNewAnalysisAction().run(null,null);
  AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null) {
    ColumnMasterDetailsPage page=(ColumnMasterDetailsPage)editor.getMasterPage();
    if (!this.selection.isEmpty()) {
      TdColumn[] columns=new TdColumn[selection.size()];
      Iterator it=this.selection.iterator();
      int i=0;
      while (it.hasNext()) {
        columns[i]=(TdColumn)it.next();
        i++;
      }
      page.getTreeViewer().setInput(columns);
    }
  }
}
Program: 140777
Project: 140777
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void fillContextMenu(IMenuManager menu){
  TreeSelection currentSelection=((TreeSelection)this.getContext().getSelection());
  Iterator iterator=currentSelection.iterator();
  while (iterator.hasNext()) {
    TdColumn column=(TdColumn)iterator.next();
    analyzeColumnAction.addColumn(column);
  }
  menu.add(analyzeColumnAction);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void fillContextMenu(IMenuManager menu){
  TreeSelection currentSelection=((TreeSelection)this.getContext().getSelection());
  analyzeColumnAction.setColumnSelection(currentSelection);
  menu.add(analyzeColumnAction);
}
Program: 140779
Project: 140779
Buggy source:
public void shellActivated(ShellEvent e){
  if (activeCount < 2) {
    Point point=e.widget.getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    activeCount++;
  }
}

Fixed version (ground truth):
public void shellActivated(ShellEvent e){
  if (activeCount < 2) {
    Point point=e.widget.getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    activeCount++;
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      IHelpResource[] relatedTopics=context.getRelatedTopics();
      String href=relatedTopics[0].getHref();
      lastActiveInstance.showURL(href);
    }
  }
}
Program: 140780
Project: 140780
Buggy source:
public static ImageDescriptor createBarChart(String titile,CategoryDataset dataset){
  JFreeChart chart=ChartFactory.createBarChart(null,titile,"String_Node_Str",dataset,PlotOrientation.HORIZONTAL,false,false,false);
  CategoryPlot plot=chart.getCategoryPlot();
  plot.setForegroundAlpha(0.50f);
  try {
    return ChartUtils.convertToImage(chart,CHART_WIDTH,CHART_HEIGHT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static ImageDescriptor createBarChart(String titile,CategoryDataset dataset){
  JFreeChart chart=ChartFactory.createBarChart(null,titile,"String_Node_Str",dataset,PlotOrientation.HORIZONTAL,false,false,false);
  CategoryPlot plot=chart.getCategoryPlot();
  try {
    return ChartUtils.convertToImage(chart,CHART_WIDTH,CHART_HEIGHT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 140782
Project: 140782
Buggy source:
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",label);
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",label);
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",String.valueOf(label + i));
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",String.valueOf(label + i));
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}
Program: 140783
Project: 140783
Buggy source:
@Override public void run(){
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder);
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard);
  fileWizard.setWindowTitle(getText());
  if (WizardDialog.OK == dialog.open()) {
    try {
      folder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder){
    public void dispose(){
      activeCount=0;
      super.dispose();
    }
  }
;
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard){
    public void openTray(    DialogTray tray) throws IllegalStateException, UnsupportedOperationException {
      super.openTray(tray);
      if (tray instanceof HelpTray) {
        HelpTray helpTray=(HelpTray)tray;
        ReusableHelpPart helpPart=helpTray.getHelpPart();
        helpPart.getForm().getForm().notifyListeners(SWT.Activate,new Event());
      }
    }
    @Override protected void nextPressed(){
      super.nextPressed();
      ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
      if (lastActiveInstance != null) {
        IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
        IHelpResource[] relatedTopics=context.getRelatedTopics();
        String href=relatedTopics[0].getHref();
        lastActiveInstance.showURL(href);
      }
    }
  }
;
  fileWizard.setWindowTitle(getText());
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    public void shellActivated(    ShellEvent e){
      if (activeCount < 2) {
        Point point=e.widget.getDisplay().getCursorLocation();
        IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
        IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
        helpSystem.displayContext(context,point.x + 15,point.y);
        activeCount++;
      }
    }
  }
);
  if (WizardDialog.OK == dialog.open()) {
    try {
      folder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}
Program: 140785
Project: 140785
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  GridData data;
  Label nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  nameText=new Text(container,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  nameText.setLayoutData(new GridData(GridData.FILL_BOTH));
  setControl(container);
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setPageComplete(true);
    }
  }
);
}

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);
  GridData data;
  Label nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  nameText=new Text(container,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  nameText.setLayoutData(new GridData(GridData.FILL_BOTH));
  setControl(container);
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setPageComplete(true);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 140786
Project: 140786
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  new CreateNewAnalysisAction().run(null,null);
  AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null) {
    ColumnMasterDetailsPage page=(ColumnMasterDetailsPage)editor.getMasterPage();
    if (!this.selection.isEmpty()) {
      TdColumn[] columns=new TdColumn[selection.size()];
      Iterator it=this.selection.iterator();
      int i=0;
      while (it.hasNext()) {
        columns[i]=(TdColumn)it.next();
        i++;
      }
      page.getTreeViewer().setInput(columns);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  if (openStandardAnalysisDialog(true,AnalysisType.MULTIPLE_COLUMN) == Window.OK) {
    AnalysisEditor editor=(AnalysisEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor != null) {
      ColumnMasterDetailsPage page=(ColumnMasterDetailsPage)editor.getMasterPage();
      if (!this.selection.isEmpty()) {
        TdColumn[] columns=new TdColumn[selection.size()];
        Iterator it=this.selection.iterator();
        int i=0;
        while (it.hasNext()) {
          columns[i]=(TdColumn)it.next();
          i++;
        }
        page.getTreeViewer().setInput(columns);
      }
    }
  }
}
Program: 140787
Project: 140787
Buggy source:
/** 
 * Method "getBigDecimal" converts object into big decimal.
 * @param javaType
 * @param object
 * @return
 */
private Double getRealValue(int javaType,String object){
  if (Java2SqlType.isDateInSQL(javaType)) {
    Date date=java.sql.Date.valueOf(object);
    return Double.valueOf(date.getTime());
  }
  return Double.valueOf(object);
}

Fixed version (ground truth):
/** 
 * Method "getRealValue" converts object into double.
 * @param javaType
 * @param object
 * @return
 */
private Double getRealValue(int javaType,String object){
  if (Java2SqlType.isDateInSQL(javaType)) {
    Date date=null;
switch (javaType) {
case Types.TIMESTAMP:
      date=java.sql.Timestamp.valueOf(object);
    break;
case Types.DATE:
  date=java.sql.Date.valueOf(object);
break;
case Types.TIME:
date=java.sql.Time.valueOf(object);
break;
default :
break;
}
return date != null ? Double.valueOf(date.getTime()) : Double.NaN;
}
return Double.valueOf(object);
}
Program: 140788
Project: 140788
Buggy source:
/** 
 * This method will get IndicatorUnit from indicatorUnitMap, if can't get exist object, it will be create a new IndicatorUnit.
 * @param indicatorEnum
 * @return
 */
private IndicatorUnit getIndicatorUnit(IndicatorEnum indicatorEnum){
  IndicatorUnit indicatorUnit=this.indicatorUnitMap.get(indicatorEnum);
  if (indicatorUnit == null) {
    indicatorUnit=createIndicatorUnit(indicatorEnum,null);
  }
  return indicatorUnit;
}

Fixed version (ground truth):
/** 
 * This method will get IndicatorUnit from indicatorUnitMap, if can't get exist object, it will be create a new IndicatorUnit.
 * @param indicatorEnum
 * @return
 */
public IndicatorUnit getIndicatorUnit(IndicatorEnum indicatorEnum){
  IndicatorUnit indicatorUnit=this.indicatorUnitMap.get(indicatorEnum);
  if (indicatorUnit == null) {
    indicatorUnit=createIndicatorUnit(indicatorEnum,null);
  }
  return indicatorUnit;
}
Program: 140789
Project: 140789
Buggy source:
@Override public void drop(DropTargetEvent event){
  super.drop(event);
  IFile fe=(IFile)((StructuredSelection)commonViewer.getSelection()).getFirstElement();
  Pattern pattern=getPattern(fe);
  TreeItem item=(TreeItem)event.item;
  ColumnIndicator data=(ColumnIndicator)item.getData(AnalysisColumnTreeViewer.COLUMN_INDICATOR_KEY);
  PatternMatchingIndicator patternMatchingIndicator=IndicatorsFactory.eINSTANCE.createPatternMatchingIndicator();
  IndicatorParameters indicParams=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  Domain validData=DomainFactory.eINSTANCE.createDomain();
  validData.getPatterns().add(pattern);
  indicParams.setDataValidDomain(validData);
  patternMatchingIndicator.setParameters(indicParams);
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  data.addIndicator(type,patternMatchingIndicator);
  IndicatorUnit indicatorUnit=new IndicatorUnit(type,patternMatchingIndicator,data);
  AnalysisColumnTreeViewer viewer=(AnalysisColumnTreeViewer)item.getData(AnalysisColumnTreeViewer.VIEWER_KEY);
  viewer.createOneUnit(item,indicatorUnit);
  viewer.setDirty(true);
}

Fixed version (ground truth):
@Override public void drop(DropTargetEvent event){
  super.drop(event);
  IFile fe=(IFile)((StructuredSelection)commonViewer.getSelection()).getFirstElement();
  Pattern pattern=getPattern(fe);
  TreeItem item=(TreeItem)event.item;
  ColumnIndicator data=(ColumnIndicator)item.getData(AnalysisColumnTreeViewer.COLUMN_INDICATOR_KEY);
  PatternMatchingIndicator patternMatchingIndicator=IndicatorsFactory.eINSTANCE.createPatternMatchingIndicator();
  IndicatorParameters indicParams=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  Domain validData=DomainFactory.eINSTANCE.createDomain();
  validData.getPatterns().add(pattern);
  indicParams.setDataValidDomain(validData);
  patternMatchingIndicator.setParameters(indicParams);
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  data.addIndicator(type,patternMatchingIndicator);
  AnalysisColumnTreeViewer viewer=(AnalysisColumnTreeViewer)item.getData(AnalysisColumnTreeViewer.VIEWER_KEY);
  viewer.createOneUnit(item,data.getIndicatorUnit(type));
  viewer.setDirty(true);
}
Program: 140791
Project: 140791
Buggy source:
/** 
 * Remove the selected elements(eg:TdColumn or Indicator) from tree.
 * @param newTree
 */
private void removeSelectedElements(final Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  for (  TreeItem item : selection) {
    IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_VALUE);
    if (indicatorUnit != null) {
      deleteIndicatorItems((ColumnIndicator)item.getData(COLUMN_INDICATOR_VALUE),indicatorUnit);
    }
 else {
      deleteColumnItems((ColumnIndicator)item.getData(COLUMN_INDICATOR_VALUE));
    }
  }
  setElements(columnIndicators);
}

Fixed version (ground truth):
/** 
 * Remove the selected elements(eg:TdColumn or Indicator) from tree.
 * @param newTree
 */
private void removeSelectedElements(final Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  boolean branchIndicatorExist=false;
  for (  TreeItem item : selection) {
    IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    if (indicatorUnit != null) {
      deleteIndicatorItems((ColumnIndicator)item.getData(COLUMN_INDICATOR_KEY),indicatorUnit);
    }
 else {
      deleteColumnItems((ColumnIndicator)item.getData(COLUMN_INDICATOR_KEY));
    }
    if (item.getParentItem() != null && item.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
      branchIndicatorExist=true;
      continue;
    }
 else {
      removeItemBranch(item);
    }
  }
  if (branchIndicatorExist) {
    setElements(columnIndicators);
  }
}
Program: 140793
Project: 140793
Buggy source:
@Override public void mouseDown(MouseEvent e){
  ColumnIndicator columnIndicator=(ColumnIndicator)treeItem.getData(COLUMN_INDICATOR_VALUE);
  deleteIndicatorItems(columnIndicator,typeMapping);
  setElements(columnIndicators);
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  ColumnIndicator columnIndicator=(ColumnIndicator)treeItem.getData(COLUMN_INDICATOR_KEY);
  deleteIndicatorItems(columnIndicator,unit);
  if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
    setElements(columnIndicators);
  }
 else {
    removeItemBranch(indicatorItem);
  }
}
Program: 140795
Project: 140795
Buggy source:
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  List<IndicatorEnum> currentCountsChildren=new ArrayList<IndicatorEnum>();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (countsEnumChildren.contains(indEnum)) {
      currentCountsChildren.add(indEnum);
      continue;
    }
    if ((indEnum != IndicatorEnum.CountsIndicatorEnum) && indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  if (currentCountsChildren.size() == countsEnumChildren.size()) {
    categoryEnumList.removeAll(currentCountsChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
  }
  currentindicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}

Fixed version (ground truth):
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  List<IndicatorEnum> currentCountsChildren=new ArrayList<IndicatorEnum>();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (countsEnumChildren.contains(indEnum)) {
      currentCountsChildren.add(indEnum);
      continue;
    }
    if ((indEnum != IndicatorEnum.CountsIndicatorEnum) && indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  if (currentCountsChildren.size() == countsEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.CountsIndicatorEnum)) {
    categoryEnumList.removeAll(currentCountsChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
  }
  currentindicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}
Program: 140798
Project: 140798
Buggy source:
@Override protected void fireTextChange(){
  this.tdDataProvider.setName(nameText.getText());
  TaggedValueHelper.setPurpose(purposeText.getText(),this.tdDataProvider);
  TaggedValueHelper.setDescription(descriptionText.getText(),this.tdDataProvider);
  TaggedValueHelper.setAuthor(this.tdDataProvider,authorText.getText());
  TaggedValueHelper.setDevStatus(this.tdDataProvider,DevelopmentStatus.get(statusCombo.getText()));
  TaggedValueHelper.setTaggedValue(tdDataProvider,USER_TAG,loginText.getText());
  TaggedValueHelper.setTaggedValue(tdDataProvider,PASSWORD_TAG,passwordText.getText());
}

Fixed version (ground truth):
@Override protected void fireTextChange(){
  this.tdDataProvider.setName(nameText.getText());
  TaggedValueHelper.setPurpose(purposeText.getText(),this.tdDataProvider);
  TaggedValueHelper.setDescription(descriptionText.getText(),this.tdDataProvider);
  TaggedValueHelper.setAuthor(this.tdDataProvider,authorText.getText());
  TaggedValueHelper.setDevStatus(this.tdDataProvider,DevelopmentStatus.get(statusCombo.getText()));
  TdProviderConnection connection=DataProviderHelper.getTdProviderConnection(tdDataProvider).getObject();
  TaggedValueHelper.setTaggedValue(connection,USER_TAG,loginText.getText());
  TaggedValueHelper.setTaggedValue(connection,PASSWORD_TAG,passwordText.getText());
}
Program: 140799
Project: 140799
Buggy source:
public String getText(Object element){
  if (element instanceof TableFolderNode) {
    TableFolderNode node=(TableFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getTables(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ViewFolderNode) {
    ViewFolderNode node=(ViewFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getViews(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ColumnFolderNode) {
    ColumnFolderNode node=(ColumnFolderNode)element;
    if (node.isLoaded()) {
      TdTable table=SwitchHelpers.TABLE_SWITCH.doSwitch(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + TableHelper.getColumns(table).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getText(Object element){
  if (element instanceof TableFolderNode) {
    TableFolderNode node=(TableFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getTables(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ViewFolderNode) {
    ViewFolderNode node=(ViewFolderNode)element;
    if (node.isLoaded()) {
      Package catalogOrSchema=PackageHelper.getCatalogOrSchema(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + PackageHelper.getViews(catalogOrSchema).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  if (element instanceof ColumnFolderNode) {
    ColumnFolderNode node=(ColumnFolderNode)element;
    if (node.isLoaded()) {
      ColumnSet table=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(node.getParent());
      return ((IFolderNode)element).getName() + "String_Node_Str" + ColumnSetHelper.getColumns(table).size()+ "String_Node_Str";
    }
 else {
      return ((IFolderNode)element).getName();
    }
  }
  return super.getText(element);
}