nus-yam/ex-repair huggingface dataset:
Program: 140285
Project: 140285
Buggy source:
/** 
 * Create a new IndicatorUnit according to indicatorEnum and indicator, if the parameter indicator is null, will create a new indicator .
 * @param indicatorEnum
 * @param indicator
 * @return
 */
private IndicatorUnit createPlainIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  if (indicator == null) {
    IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
    indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    int sqlType=this.tdColumn.getJavaType();
    if (indicatorEnum == IndicatorEnum.FrequencyIndicatorEnum && Java2SqlType.isDateInSQL(sqlType)) {
      IndicatorParameters parameters=indicator.getParameters();
      if (parameters == null) {
        parameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
        indicator.setParameters(parameters);
      }
      DateParameters dateParameters=parameters.getDateParameters();
      if (dateParameters == null) {
        dateParameters=IndicatorsFactory.eINSTANCE.createDateParameters();
        parameters.setDateParameters(dateParameters);
      }
    }
  }
  IndicatorUnit indicatorUnit=new IndicatorUnit(indicatorEnum,indicator,this);
  this.plainIndicatorUnitMap.put(indicatorEnum,indicatorUnit);
  return indicatorUnit;
}

Fixed version (ground truth):
/** 
 * Create a new IndicatorUnit according to indicatorEnum and indicator, if the parameter indicator is null, will create a new indicator .
 * @param indicatorEnum
 * @param indicator
 * @return
 */
private IndicatorUnit createPlainIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  if (indicator == null) {
    IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
    indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator)) {
      log.error("String_Node_Str" + indicator.getName());
    }
    int sqlType=this.tdColumn.getJavaType();
    if (indicatorEnum == IndicatorEnum.FrequencyIndicatorEnum && Java2SqlType.isDateInSQL(sqlType)) {
      IndicatorParameters parameters=indicator.getParameters();
      if (parameters == null) {
        parameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
        indicator.setParameters(parameters);
      }
      DateParameters dateParameters=parameters.getDateParameters();
      if (dateParameters == null) {
        dateParameters=IndicatorsFactory.eINSTANCE.createDateParameters();
        parameters.setDateParameters(dateParameters);
      }
    }
  }
  IndicatorUnit indicatorUnit=new IndicatorUnit(indicatorEnum,indicator,this);
  this.plainIndicatorUnitMap.put(indicatorEnum,indicatorUnit);
  return indicatorUnit;
}
Program: 140286
Project: 140286
Buggy source:
protected void addCheckedListener(){
  getTreeViewer().addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      if (event.getChecked()) {
        getTreeViewer().setSubtreeChecked(event.getElement(),true);
        if (event.getElement() instanceof ColumnSet) {
          handleColumnsChecked((ColumnSet)event.getElement(),true);
        }
      }
 else {
        getTreeViewer().setSubtreeChecked(event.getElement(),false);
        if (event.getElement() instanceof ColumnSet) {
          handleColumnsChecked((ColumnSet)event.getElement(),false);
        }
      }
    }
  }
);
  getTableViewer().addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      if (event.getElement() instanceof TdColumn) {
        handleColumnChecked((TdColumn)event.getElement(),event.getChecked());
      }
    }
  }
);
}

Fixed version (ground truth):
protected void addCheckedListener(){
  getTreeViewer().addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      ColumnSelectionViewer columnViewer=(ColumnSelectionViewer)event.getSource();
      TreePath treePath=new TreePath(new Object[]{event.getElement()});
      columnViewer.setSelection(new TreeSelection(treePath));
      if (event.getChecked()) {
        getTreeViewer().setSubtreeChecked(event.getElement(),true);
        if (event.getElement() instanceof ColumnSet) {
          setOutput(event.getElement());
          handleColumnsChecked((ColumnSet)event.getElement(),true);
        }
      }
 else {
        getTreeViewer().setSubtreeChecked(event.getElement(),false);
        if (event.getElement() instanceof ColumnSet) {
          setOutput(event.getElement());
          handleColumnsChecked((ColumnSet)event.getElement(),false);
        }
      }
    }
  }
);
  getTableViewer().addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      if (event.getElement() instanceof TdColumn) {
        handleColumnChecked((TdColumn)event.getElement(),event.getChecked());
      }
    }
  }
);
}
Program: 140287
Project: 140287
Buggy source:
/** 
 * DOC scorreia Comment method "getTableComment".
 * @param tableName
 * @param tablesSet
 * @return
 * @throws SQLException
 */
private String getTableComment(String tableName,ResultSet tablesSet) throws SQLException {
  String tableComment=tablesSet.getString(GetTable.REMARKS.name());
  if (tableComment == null) {
    String selectRemarkOnTable=dbms.getSelectRemarkOnTable(tableName);
    if (selectRemarkOnTable != null) {
      tableComment=executeGetCommentStatement(selectRemarkOnTable);
    }
  }
  return tableComment;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getTableComment".
 * @param tableName
 * @param tablesSet
 * @return
 * @throws SQLException
 */
private String getTableComment(String tableName,ResultSet tablesSet) throws SQLException {
  String tableComment=tablesSet.getString(GetTable.REMARKS.name());
  if (StringUtils.isBlank(tableComment)) {
    String selectRemarkOnTable=dbms.getSelectRemarkOnTable(tableName);
    if (selectRemarkOnTable != null) {
      tableComment=executeGetCommentStatement(selectRemarkOnTable);
    }
  }
  return tableComment;
}
Program: 140288
Project: 140288
Buggy source:
/** 
 * DOC scorreia Comment method "getOrderBy".
 * @param sqlStatement
 * @return
 */
public String getOrderBy(String sqlStatement){
  ZqlParser zqlParser=getZqlParser();
  zqlParser.initParser(new ByteArrayInputStream(sqlStatement.getBytes()));
  try {
    ZQuery zQuery=(ZQuery)zqlParser.readStatement();
    if (zQuery == null) {
      return null;
    }
    Vector orderBy=zQuery.getOrderBy();
    if (orderBy == null || orderBy.size() != 1) {
      return null;
    }
    return orderBy.get(0).toString();
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getOrderBy".
 * @param sqlStatement
 * @return
 */
@SuppressWarnings("String_Node_Str") public String getOrderBy(String sqlStatement){
  ZqlParser zqlParser=getZqlParser();
  zqlParser.initParser(new ByteArrayInputStream(sqlStatement.getBytes()));
  try {
    ZQuery zQuery=(ZQuery)zqlParser.readStatement();
    if (zQuery == null) {
      return null;
    }
    Vector orderBy=zQuery.getOrderBy();
    if (orderBy == null || orderBy.size() != 1) {
      return null;
    }
    return orderBy.get(0).toString();
  }
 catch (  ParseException e) {
    log.error(e,e);
  }
  return null;
}
Program: 140289
Project: 140289
Buggy source:
/** 
 * Method "finalizeQuery" must be called after parseQuery().
 * @param zQuery
 * @return the final query string
 * @deprecated use this{@link #finalizeQuery(String)} instead
 */
private String finalizeQuery(ZQuery zQuery){
  StringBuffer buf=new StringBuffer();
  buf.append(zQuery.toString());
  if (containsLimitClause) {
    buf.append("String_Node_Str" + withoutLimit[1]);
  }
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Method "finalizeQuery" must be called after prepareQuery().
 * @param query the query to finalize
 * @return the final query.
 */
public String finalizeQuery(String query){
  StringBuffer buf=new StringBuffer();
  buf.append(query.toString());
  if (containsLimitClause) {
    buf.append("String_Node_Str" + withoutLimit[1]);
  }
  containsLimitClause=false;
  return buf.toString();
}
Program: 140290
Project: 140290
Buggy source:
private void initializeIndicator(Indicator indicator,TdColumn column){
  indicator.setAnalyzedElement(column);
  boolean definitionSet=DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + indicator.getName() + "String_Node_Str"+ definitionSet);
  }
  if (indicator instanceof CompositeIndicator) {
    for (    Indicator child : ((CompositeIndicator)indicator).getChildIndicators()) {
      initializeIndicator(child,column);
    }
  }
}

Fixed version (ground truth):
private void initializeIndicator(Indicator indicator,TdColumn column){
  indicator.setAnalyzedElement(column);
  if (indicator.getIndicatorDefinition() == null) {
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
  }
  if (indicator instanceof CompositeIndicator) {
    for (    Indicator child : ((CompositeIndicator)indicator).getChildIndicators()) {
      initializeIndicator(child,column);
    }
  }
}
Program: 140292
Project: 140292
Buggy source:
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    Package packageValue=SwitchHelpers.Package_SWITCH.doSwitch(eObj);
    if (packageValue != null) {
      TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider(packageValue);
      IFile findCorrespondingFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdDataProvider);
      return findCorrespondingFile;
    }
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}

Fixed version (ground truth):
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    Package packageValue=SwitchHelpers.PACKAGE_SWITCH.doSwitch(eObj);
    if (packageValue != null) {
      TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider(packageValue);
      IFile findCorrespondingFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdDataProvider);
      return findCorrespondingFile;
    }
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}
Program: 140293
Project: 140293
Buggy source:
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    Package packageValue=SwitchHelpers.PACKAGE_SWITCH.doSwitch(eObj);
    if (packageValue != null) {
      TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider(packageValue);
      IFile findCorrespondingFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdDataProvider);
      return findCorrespondingFile;
    }
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}

Fixed version (ground truth):
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    Package packageValue=SwitchHelpers.PACKAGE_SWITCH.doSwitch(eObj);
    TdCatalog parentCatalog=CatalogHelper.getParentCatalog(packageValue);
    if (parentCatalog != null) {
      return parentCatalog;
    }
    if (packageValue != null) {
      TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider(packageValue);
      IFile findCorrespondingFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdDataProvider);
      return findCorrespondingFile;
    }
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}
Program: 140294
Project: 140294
Buggy source:
private IndicatorUnit createSpecialIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  if (indicator == null) {
    IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
    indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
  }
  if (!flatIndicatorEnumList.contains(indicatorEnum)) {
    this.flatIndicatorEnumList.add(indicatorEnum);
  }
  if (this.specialIndicatorUnitList == null) {
    this.specialIndicatorUnitList=new ArrayList<IndicatorUnit>();
  }
  IndicatorUnit indicatorUnit=new IndicatorUnit(indicatorEnum,indicator,this);
  specialIndicatorUnitList.add(indicatorUnit);
  return indicatorUnit;
}

Fixed version (ground truth):
private IndicatorUnit createSpecialIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  if (indicator == null) {
    IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
    indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator)) {
      log.error("String_Node_Str" + indicator.getName());
    }
  }
  if (!flatIndicatorEnumList.contains(indicatorEnum)) {
    this.flatIndicatorEnumList.add(indicatorEnum);
  }
  if (this.specialIndicatorUnitList == null) {
    this.specialIndicatorUnitList=new ArrayList<IndicatorUnit>();
  }
  IndicatorUnit indicatorUnit=new IndicatorUnit(indicatorEnum,indicator,this);
  specialIndicatorUnitList.add(indicatorUnit);
  return indicatorUnit;
}
Program: 140295
Project: 140295
Buggy source:
/** 
 * DOC qzhang Comment method "createIndicatorUnit".
 * @param pfile
 * @param columnIndicator
 * @param analysis
 * @return
 */
public static IndicatorUnit createIndicatorUnit(IFile pfile,ColumnIndicator columnIndicator,Analysis analysis){
  Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(pfile);
  RegularExpression expression=(RegularExpression)pattern.getComponents().get(0);
  PatternMatchingIndicator patternMatchingIndicator=PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
  if (ExpressionType.SQL_LIKE.getName().equals(expression.getExpressionType())) {
    patternMatchingIndicator=PatternIndicatorFactory.createSqlPatternMatchingIndicator(pattern);
  }
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  IndicatorUnit addIndicatorUnit=columnIndicator.addSpecialIndicator(type,patternMatchingIndicator);
  DependenciesHandler.getInstance().setUsageDependencyOn(analysis,pattern);
  return addIndicatorUnit;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "createIndicatorUnit".
 * @param pfile
 * @param columnIndicator
 * @param analysis
 * @return
 */
public static IndicatorUnit createIndicatorUnit(IFile pfile,ColumnIndicator columnIndicator,Analysis analysis){
  Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(pfile);
  RegularExpression expression=(RegularExpression)pattern.getComponents().get(0);
  PatternMatchingIndicator patternMatchingIndicator=(ExpressionType.SQL_LIKE.getName().equals(expression.getExpressionType())) ? PatternIndicatorFactory.createSqlPatternMatchingIndicator(pattern) : PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
  if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(patternMatchingIndicator)) {
    log.error("String_Node_Str" + patternMatchingIndicator.getName());
  }
  IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
  IndicatorUnit addIndicatorUnit=columnIndicator.addSpecialIndicator(type,patternMatchingIndicator);
  DependenciesHandler.getInstance().setUsageDependencyOn(analysis,pattern);
  return addIndicatorUnit;
}
Program: 140296
Project: 140296
Buggy source:
protected List<Indicator> addIndicator(List<Indicator> predefinedIndicators,IndicatorEnum indicatorEnum,TdColumn column){
  IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
  if (indicatorEnum.getChildren() != null) {
    for (    IndicatorEnum oneEnum : indicatorEnum.getChildren()) {
      if (ColumnIndicatorRule.patternRule(oneEnum,column)) {
        Indicator indicator=(Indicator)factory.create(oneEnum.getIndicatorType());
        predefinedIndicators.add(indicator);
      }
    }
  }
 else {
    Indicator indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    predefinedIndicators.add(indicator);
  }
  return predefinedIndicators;
}

Fixed version (ground truth):
protected List<Indicator> addIndicator(List<Indicator> predefinedIndicators,IndicatorEnum indicatorEnum,TdColumn column){
  IndicatorsFactory factory=IndicatorsFactory.eINSTANCE;
  if (indicatorEnum.getChildren() != null) {
    for (    IndicatorEnum oneEnum : indicatorEnum.getChildren()) {
      if (ColumnIndicatorRule.patternRule(oneEnum,column)) {
        Indicator indicator=(Indicator)factory.create(oneEnum.getIndicatorType());
        if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator)) {
          log.error("String_Node_Str" + indicator.getName());
        }
        predefinedIndicators.add(indicator);
      }
    }
  }
 else {
    Indicator indicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    predefinedIndicators.add(indicator);
  }
  return predefinedIndicators;
}
Program: 140297
Project: 140297
Buggy source:
/** 
 * Method "getParentCatalog" returns a Catalog if the element is directly owned by a catalog.
 * @param element (can be null)
 * @return the Catalog or null
 */
public static TdCatalog getParentCatalog(ModelElement element){
  if (element == null) {
    return null;
  }
  return SwitchHelpers.CATALOG_SWITCH.doSwitch(element.getNamespace());
}

Fixed version (ground truth):
/** 
 * Method "getParentCatalog" returns a Catalog if the element is directly owned by a catalog.
 * @param element (can be null)
 * @return the Catalog or null
 */
public static TdCatalog getParentCatalog(ModelElement element){
  Namespace namespace=element.getNamespace();
  if (element == null || namespace == null) {
    return null;
  }
  return SwitchHelpers.CATALOG_SWITCH.doSwitch(namespace);
}
Program: 140298
Project: 140298
Buggy source:
private boolean savePattern(){
  this.pattern.getComponents().clear();
  this.pattern.getComponents().addAll(tempPatternComponents);
  TaggedValueHelper.setValidStatus(true,pattern);
  EList<PatternComponent> components=this.pattern.getComponents();
  List<String> existLanguage=new ArrayList<String>();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    String language=regularExpress.getExpression().getLanguage();
    if ((regularExpress.getExpression().getBody() == null) || (!regularExpress.getExpression().getBody().matches("String_Node_Str"))) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      return false;
    }
    if (existLanguage.contains(language)) {
      MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + language);
      return false;
    }
 else {
      existLanguage.add(language);
    }
  }
  EMFUtil.saveSingleResource(pattern.eResource());
  return true;
}

Fixed version (ground truth):
private boolean savePattern(){
  if (tempPatternComponents.size() == 0) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + pattern.getName() + "String_Node_Str");
    return false;
  }
  this.pattern.getComponents().clear();
  this.pattern.getComponents().addAll(tempPatternComponents);
  TaggedValueHelper.setValidStatus(true,pattern);
  EList<PatternComponent> components=this.pattern.getComponents();
  List<String> existLanguage=new ArrayList<String>();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    String language=regularExpress.getExpression().getLanguage();
    if ((regularExpress.getExpression().getBody() == null) || (!regularExpress.getExpression().getBody().matches("String_Node_Str"))) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      return false;
    }
    if (existLanguage.contains(language)) {
      MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + language);
      return false;
    }
 else {
      existLanguage.add(language);
    }
  }
  EMFUtil.saveSingleResource(pattern.eResource());
  return true;
}
Program: 140299
Project: 140299
Buggy source:
public void widgetSelected(SelectionEvent e){
  IIndicatorNode indicatorNode=((IIndicatorNode)e.item.getData(INDICATORITEM));
  if (indicatorNode == null) {
    purposeLabel.setText(PURPOSE + ((TreeItem)e.item).getText());
    descriptionLabel.setText(DESCRIPTION + ((TreeItem)e.item).getText());
    return;
  }
  Indicator indicator=indicatorNode.getIndicatorInstance();
  IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
  purposeLabel.setText(PURPOSE + TaggedValueHelper.getPurpose(indicatorDefinition));
  String description=DESCRIPTION + TaggedValueHelper.getDescription(indicatorDefinition);
  description=splitLongString(description);
  descriptionLabel.setText(description);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  IIndicatorNode indicatorNode=((IIndicatorNode)e.item.getData(INDICATORITEM));
  if (indicatorNode == null) {
    purposeLabel.setText(PURPOSE + ((TreeItem)e.item).getText());
    descriptionLabel.setText(DESCRIPTION + ((TreeItem)e.item).getText());
    return;
  }
  Indicator indicator=indicatorNode.getIndicatorInstance();
  IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
  purposeLabel.setText(PURPOSE + TaggedValueHelper.getPurpose(indicatorDefinition));
  String description=DESCRIPTION + TaggedValueHelper.getDescription(indicatorDefinition);
  description=splitLongString(description);
  descriptionLabel.setText(description);
}
Program: 140301
Project: 140301
Buggy source:
@Override public void shellActivated(ShellEvent e){
  Point point=e.widget.getDisplay().getCursorLocation();
  IContext context=HelpSystem.getContext(HelpPlugin.PLUGIN_ID + HelpPlugin.INDICATOR_SELECTOR_HELP_ID);
  PlatformUI.getWorkbench().getHelpSystem().displayContext(context,point.x + 15,point.y);
}

Fixed version (ground truth):
@Override public void shellActivated(ShellEvent e){
  dialog.getShell().setFocus();
  IContext context=HelpSystem.getContext(HelpPlugin.INDICATOR_SELECTOR_HELP_ID);
  PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
}
Program: 140302
Project: 140302
Buggy source:
public void openIndicatorSelectDialog(Shell shell){
  IndicatorSelectDialog dialog=new IndicatorSelectDialog(shell,"String_Node_Str",columnIndicators);
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    @Override public void shellActivated(    ShellEvent e){
      Point point=e.widget.getDisplay().getCursorLocation();
      IContext context=HelpSystem.getContext(HelpPlugin.PLUGIN_ID + HelpPlugin.INDICATOR_SELECTOR_HELP_ID);
      PlatformUI.getWorkbench().getHelpSystem().displayContext(context,point.x + 15,point.y);
    }
  }
);
  if (dialog.open() == Window.OK) {
    ColumnIndicator[] result=dialog.getResult();
    for (    ColumnIndicator columnIndicator : result) {
      columnIndicator.storeTempIndicator();
    }
    this.setElements(result);
    return;
  }
}

Fixed version (ground truth):
public void openIndicatorSelectDialog(Shell shell){
  final IndicatorSelectDialog dialog=new IndicatorSelectDialog(shell,"String_Node_Str",columnIndicators);
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    @Override public void shellActivated(    ShellEvent e){
      dialog.getShell().setFocus();
      IContext context=HelpSystem.getContext(HelpPlugin.INDICATOR_SELECTOR_HELP_ID);
      PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
    }
  }
);
  if (dialog.open() == Window.OK) {
    ColumnIndicator[] result=dialog.getResult();
    for (    ColumnIndicator columnIndicator : result) {
      columnIndicator.storeTempIndicator();
    }
    this.setElements(result);
    return;
  }
}
Program: 140303
Project: 140303
Buggy source:
public void showHelp(){
  String href=getFormEnum().getHelpHref();
  if (href != null && href.endsWith("String_Node_Str")) {
    Point point=getShell().getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IHelpResource[] relatedTopics=context.getRelatedTopics();
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      lastActiveInstance.showURL(href);
    }
  }
}

Fixed version (ground truth):
public void showHelp(){
  String href=getFormEnum().getHelpHref();
  ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
  if (lastActiveInstance != null) {
    lastActiveInstance.showURL(href);
  }
}
Program: 140304
Project: 140304
Buggy source:
private void showHelp(){
  if (activeCount < 2 && href != null && href.endsWith("String_Node_Str")) {
    Point point=getShell().getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IHelpResource[] relatedTopics=context.getRelatedTopics();
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    activeCount++;
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      lastActiveInstance.showURL(href);
    }
  }
}

Fixed version (ground truth):
private void showHelp(){
  getShell().setFocus();
  IContext context=HelpSystem.getContext(HelpPlugin.INDICATOR_OPTION_HELP_ID);
  IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
  helpSystem.displayHelp(context);
  ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
  if (lastActiveInstance != null) {
    lastActiveInstance.showURL(href);
  }
}
Program: 140305
Project: 140305
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FillLayout());
  tabFolder=new TabFolder(container,SWT.FLAT);
  tabFolder.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Object formObject=e.item.getData();
      if (formObject != null) {
        AbstractIndicatorForm form=(AbstractIndicatorForm)formObject;
        form.showHelp();
      }
    }
  }
);
  FormEnum[] forms=FormEnum.getForms(this.indicatorUnit);
  if (forms != null) {
    setControl(createView(FormFactory.createForm(tabFolder,listener,forms,paramMap)));
  }
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PLUGIN_ID + HelpPlugin.INDICATOR_OPTION_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FillLayout());
  tabFolder=new TabFolder(container,SWT.FLAT);
  tabFolder.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Object formObject=e.item.getData();
      if (formObject != null) {
        AbstractIndicatorForm form=(AbstractIndicatorForm)formObject;
        form.showHelp();
      }
    }
  }
);
  FormEnum[] forms=FormEnum.getForms(this.indicatorUnit);
  if (forms != null) {
    setControl(createView(FormFactory.createForm(tabFolder,listener,forms,paramMap)));
  }
}
Program: 140306
Project: 140306
Buggy source:
/** 
 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
 */
public void createControl(Composite parent){
  ((GridData)parent.getLayoutData()).widthHint=520;
  ((GridData)parent.getLayoutData()).heightHint=280;
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(1,false);
  container.setLayout(layout);
  Label subTitleLabel=new Label(container,SWT.NONE);
  subTitleLabel.setText("String_Node_Str");
  clufText=new Text(container,SWT.MULTI | SWT.WRAP | SWT.V_SCROLL| SWT.H_SCROLL| SWT.LEFT| SWT.BORDER);
  clufText.setBackground(new Color(null,255,255,255));
  clufText.setEditable(false);
  String license=getLicense();
  clufText.setText(license);
  GridData data=new GridData(GridData.FILL_BOTH);
  clufText.setLayoutData(data);
  setControl(container);
  setPageComplete(true);
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
 */
public void createControl(Composite parent){
  ((GridData)parent.getLayoutData()).widthHint=520;
  ((GridData)parent.getLayoutData()).heightHint=280;
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(1,false);
  container.setLayout(layout);
  Label subTitleLabel=new Label(container,SWT.NONE);
  subTitleLabel.setText("String_Node_Str");
  clufText=new Text(container,SWT.MULTI | SWT.WRAP | SWT.V_SCROLL| SWT.H_SCROLL| SWT.LEFT| SWT.BORDER);
  Color color=new Color(null,255,255,255);
  clufText.setBackground(color);
  color.dispose();
  clufText.setEditable(false);
  String license=getLicense();
  clufText.setText(license);
  GridData data=new GridData(GridData.FILL_BOTH);
  clufText.setLayoutData(data);
  setControl(container);
  setPageComplete(true);
}
Program: 140307
Project: 140307
Buggy source:
public static IComparisonLevel creatComparisonLevel(Object selectedObject){
  IComparisonLevel comparisonLevel=null;
  if (selectedObject instanceof AbstractDatabaseFolderNode) {
    AbstractDatabaseFolderNode dbFolderNode=(AbstractDatabaseFolderNode)selectedObject;
    EObject theEObject=dbFolderNode.getParent();
    TdCatalog ctatlogSwtich=SwitchHelpers.CATALOG_SWITCH.doSwitch(theEObject);
    if (ctatlogSwtich != null) {
      comparisonLevel=new CatalogSchemaComparisonLevel(ctatlogSwtich);
    }
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(theEObject);
    if (columnSet != null) {
      comparisonLevel=new TableViewComparisonLevel(columnSet);
    }
  }
 else   if (selectedObject instanceof IFile) {
    comparisonLevel=new DataProviderComparisonLevel(selectedObject);
  }
 else {
    comparisonLevel=null;
  }
  return comparisonLevel;
}

Fixed version (ground truth):
public static IComparisonLevel creatComparisonLevel(Object selectedObject){
  IComparisonLevel comparisonLevel=null;
  if (selectedObject instanceof AbstractDatabaseFolderNode) {
    AbstractDatabaseFolderNode dbFolderNode=(AbstractDatabaseFolderNode)selectedObject;
    EObject theEObject=dbFolderNode.getParent();
    Package ctatlogSwtich=SwitchHelpers.PACKAGE_SWITCH.doSwitch(theEObject);
    if (ctatlogSwtich != null) {
      comparisonLevel=new CatalogSchemaComparisonLevel(ctatlogSwtich);
    }
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(theEObject);
    if (columnSet != null) {
      comparisonLevel=new TableViewComparisonLevel(columnSet);
    }
  }
 else   if (selectedObject instanceof IFile) {
    comparisonLevel=new DataProviderComparisonLevel(selectedObject);
  }
 else {
    comparisonLevel=null;
  }
  return comparisonLevel;
}
Program: 140308
Project: 140308
Buggy source:
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  ColumnSet removeColumnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumnSet == null) {
    return;
  }
  popRemoveElementConfirm();
  PackageHelper.removeColumnSet(removeColumnSet,(TdCatalog)selectedObj);
}

Fixed version (ground truth):
@Override protected void handleRemoveElement(RemoveModelElement removeElement){
  ColumnSet removeColumnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(removeElement.getLeftElement());
  if (removeColumnSet == null) {
    return;
  }
  popRemoveElementConfirm();
  PackageHelper.removeColumnSet(removeColumnSet,(Package)selectedObj);
}
Program: 140309
Project: 140309
Buggy source:
@Override protected void handleAddElement(AddModelElement addElement){
  EObject rightElement=addElement.getRightElement();
  ColumnSet columnSetSwitch=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    TdCatalog catalog=(TdCatalog)selectedObj;
    PackageHelper.addColumnSet(columnSetSwitch,catalog);
  }
}

Fixed version (ground truth):
@Override protected void handleAddElement(AddModelElement addElement){
  EObject rightElement=addElement.getRightElement();
  ColumnSet columnSetSwitch=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(rightElement);
  if (columnSetSwitch != null) {
    Package catalog=(Package)selectedObj;
    PackageHelper.addColumnSet(columnSetSwitch,catalog);
  }
}
Program: 140311
Project: 140311
Buggy source:
/** 
 * Method "saveInFiles". Calling this method without having called this.  {@link #storeInResourceSet(EObject,String)}will do nothing. If objects are dependent on each other, each object must be stored in a resource set first before trying to save them in a file.
 * @return true if CWM objects have been saved in file.
 */
public boolean saveInFiles(){
  return emfUtil.save();
}

Fixed version (ground truth):
/** 
 * Method "saveInFiles". Calling this method without having called this.  {@link #storeInResourceSet(EObject,String)}will do nothing. If objects are dependent on each other, each object must be stored in a resource set first before trying to save them in a file.
 * @return true if CWM objects have been saved in file.
 */
boolean saveInFiles(){
  return emfUtil.save();
}
Program: 140312
Project: 140312
Buggy source:
public String toQualifiedName(String catalog,String schema,String table){
  if (is(MSSQL)) {
    schema="String_Node_Str";
  }
  if (is(SYBASE_ASE)) {
    schema="String_Node_Str";
  }
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.length() > 0) {
    qualName.append(catalog);
    qualName.append(DOT);
  }
  if (schema != null && schema.length() > 0) {
    qualName.append(schema);
    qualName.append(DOT);
  }
  qualName.append(table);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}

Fixed version (ground truth):
public String toQualifiedName(String catalog,String schema,String table){
  if (is(MSSQL)) {
    catalog="String_Node_Str";
  }
  if (is(SYBASE_ASE)) {
    catalog="String_Node_Str";
  }
  StringBuffer qualName=new StringBuffer();
  if (catalog != null && catalog.length() > 0) {
    qualName.append(catalog);
    qualName.append(DOT);
  }
  if (schema != null && schema.length() > 0) {
    qualName.append(schema);
    qualName.append(DOT);
  }
  qualName.append(table);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",catalog,schema,table,qualName));
  }
  return qualName.toString();
}
Program: 140314
Project: 140314
Buggy source:
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      boolean con=false;
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setFocus();
      }
      if (e.item instanceof TreeItem) {
        TreeItem item=(TreeItem)e.item;
        if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
          tree.setMenu(null);
          return;
        }
 else         if (item.getData(INDICATOR_UNIT_KEY) != null) {
          IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
          IndicatorEnum type=indicatorUnit.getType();
          con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
        }
      }
      createTreeMenu(tree,con);
    }
  }
);
  tree.addTreeListener(new TreeAdapter(){
    @Override public void treeCollapsed(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(false);
      }
      masterPage.getForm().reflow(true);
    }
    @Override public void treeExpanded(    TreeEvent e){
      if (getTheSuitedComposite(e) != null) {
        getTheSuitedComposite(e).setExpanded(true);
      }
      masterPage.getForm().reflow(true);
    }
  }
);
}

Fixed version (ground truth):
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      boolean con=false;
      if (e.item instanceof TreeItem) {
        TreeItem item=(TreeItem)e.item;
        if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
          tree.setMenu(null);
          return;
        }
 else         if (item.getData(INDICATOR_UNIT_KEY) != null) {
          IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
          IndicatorEnum type=indicatorUnit.getType();
          con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
        }
      }
      createTreeMenu(tree,con);
    }
  }
);
  tree.addTreeListener(new TreeAdapter(){
    @Override public void treeCollapsed(    TreeEvent e){
      ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
      ScrolledForm form=masterPage.getForm();
      Composite comp=masterPage.getChartComposite();
      if (theSuitedComposite != null && theSuitedComposite.isExpanded()) {
        getTheSuitedComposite(e).setExpanded(false);
      }
      comp.layout();
      form.reflow(true);
    }
    @Override public void treeExpanded(    TreeEvent e){
      ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
      ScrolledForm form=masterPage.getForm();
      Composite comp=masterPage.getChartComposite();
      if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
        theSuitedComposite.setExpanded(true);
      }
      comp.layout();
      form.reflow(true);
    }
  }
);
}
Program: 140315
Project: 140315
Buggy source:
@Override public void treeExpanded(TreeEvent e){
  if (getTheSuitedComposite(e) != null) {
    getTheSuitedComposite(e).setExpanded(true);
  }
  masterPage.getForm().reflow(true);
}

Fixed version (ground truth):
@Override public void treeExpanded(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && !theSuitedComposite.isExpanded()) {
    theSuitedComposite.setExpanded(true);
  }
  comp.layout();
  form.reflow(true);
}
Program: 140316
Project: 140316
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  boolean con=false;
  if (getTheSuitedComposite(e) != null) {
    getTheSuitedComposite(e).setFocus();
  }
  if (e.item instanceof TreeItem) {
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
 else     if (item.getData(INDICATOR_UNIT_KEY) != null) {
      IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
      IndicatorEnum type=indicatorUnit.getType();
      con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
    }
  }
  createTreeMenu(tree,con);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  boolean con=false;
  if (e.item instanceof TreeItem) {
    TreeItem item=(TreeItem)e.item;
    if (DATA_PARAM.equals(item.getData(DATA_PARAM))) {
      tree.setMenu(null);
      return;
    }
 else     if (item.getData(INDICATOR_UNIT_KEY) != null) {
      IndicatorUnit indicatorUnit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
      IndicatorEnum type=indicatorUnit.getType();
      con=IndicatorEnum.RegexpMatchingIndicatorEnum.compareTo(type) == 0 || IndicatorEnum.SqlPatternMatchingIndicatorEnum.compareTo(type) == 0;
    }
  }
  createTreeMenu(tree,con);
}
Program: 140317
Project: 140317
Buggy source:
@Override public void treeCollapsed(TreeEvent e){
  if (getTheSuitedComposite(e) != null) {
    getTheSuitedComposite(e).setExpanded(false);
  }
  masterPage.getForm().reflow(true);
}

Fixed version (ground truth):
@Override public void treeCollapsed(TreeEvent e){
  ExpandableComposite theSuitedComposite=getTheSuitedComposite(e);
  ScrolledForm form=masterPage.getForm();
  Composite comp=masterPage.getChartComposite();
  if (theSuitedComposite != null && theSuitedComposite.isExpanded()) {
    getTheSuitedComposite(e).setExpanded(false);
  }
  comp.layout();
  form.reflow(true);
}
Program: 140318
Project: 140318
Buggy source:
private Analysis readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  Analysis analysis=retireAnalysis(fileResource);
  if (analysis != null) {
    AnalysisEntity entity=new AnalysisEntity(analysis);
    allAnalysisMap.put(file,entity);
  }
  return analysis;
}

Fixed version (ground truth):
private Analysis readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  Iterator<IFile> fileIterator=allAnalysisMap.keySet().iterator();
  while (fileIterator.hasNext()) {
    IFile key=fileIterator.next();
    AnalysisEntity entity=allAnalysisMap.get(key);
    Resource resourceObj=entity.getAnalysis().eResource();
    if (resourceObj == fileResource) {
      registedResourceMap.remove(key);
      allAnalysisMap.remove(key);
      break;
    }
  }
  Analysis analysis=retireAnalysis(fileResource);
  if (analysis != null) {
    AnalysisEntity entity=new AnalysisEntity(analysis);
    allAnalysisMap.put(file,entity);
  }
  return analysis;
}
Program: 140319
Project: 140319
Buggy source:
/** 
 * DOC rli Comment method "readFromFile".
 * @param file
 * @return
 */
private TypedReturnCode<TdDataProvider> readFromFile(IFile file){
  TypedReturnCode<TdDataProvider> rc;
  this.remove(file);
  rc=new TypedReturnCode<TdDataProvider>();
  Resource resource=getFileResource(file);
  findTdProvider(file,rc,resource);
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC rli Comment method "readFromFile".
 * @param file
 * @return
 */
private TypedReturnCode<TdDataProvider> readFromFile(IFile file){
  TypedReturnCode<TdDataProvider> rc;
  this.remove(file);
  rc=new TypedReturnCode<TdDataProvider>();
  Resource resource=getFileResource(file);
  Iterator<IFile> fileIterator=providerMap.keySet().iterator();
  while (fileIterator.hasNext()) {
    IFile key=fileIterator.next();
    TypedReturnCode<TdDataProvider> returnValue=providerMap.get(key);
    Resource resourceObj=returnValue.getObject().eResource();
    if (resourceObj == resource) {
      registedResourceMap.remove(key);
      providerMap.remove(key);
      break;
    }
  }
  retireTdProvider(file,rc,resource);
  return rc;
}
Program: 140320
Project: 140320
Buggy source:
private TdReport readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  TdReport report=retireReport(fileResource);
  if (report != null) {
    allRepMap.put(file,report);
  }
  return report;
}

Fixed version (ground truth):
private TdReport readFromFile(IFile file){
  this.remove(file);
  Resource fileResource=getFileResource(file);
  Iterator<IFile> fileIterator=allRepMap.keySet().iterator();
  while (fileIterator.hasNext()) {
    IFile key=fileIterator.next();
    TdReport rePort=allRepMap.get(key);
    Resource resourceObj=rePort.eResource();
    if (resourceObj == fileResource) {
      registedResourceMap.remove(key);
      allRepMap.remove(key);
      break;
    }
  }
  TdReport report=retireReport(fileResource);
  if (report != null) {
    allRepMap.put(file,report);
  }
  return report;
}
Program: 140321
Project: 140321
Buggy source:
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    URI uri=eObj.eResource().getURI();
    Path path=new Path(uri.path());
    String fileName=path.lastSegment();
    IFolder connectionsFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.METADATA).getFolder(DQStructureManager.DB_CONNECTIONS);
    IFile resourceFile=connectionsFolder.getFile(fileName);
    return resourceFile;
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}

Fixed version (ground truth):
public Object getParent(Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(eObj);
    if (columnSet != null) {
      IFolderNode folderNode=FolderNodeHelper.getFolderNode(EObjectHelper.getParent((ColumnSet)element),columnSet);
      return folderNode;
    }
    Package packageValue=SwitchHelpers.Package_SWITCH.doSwitch(eObj);
    if (packageValue != null) {
      TdDataProvider tdDataProvider=DataProviderHelper.getTdDataProvider(packageValue);
      IFile findCorrespondingFile=PrvResourceFileHelper.getInstance().findCorrespondingFile(tdDataProvider);
      return findCorrespondingFile;
    }
  }
 else   if (element instanceof IFolderNode) {
    return ((IFolderNode)element).getParent();
  }
 else   if (element instanceof IResource) {
    return ((IResource)element).getParent();
  }
  return super.getParent(element);
}