nus-yam/ex-repair huggingface dataset:
Program: 79008
Project: 79008
Buggy source:
public Chart getModel(String sSubType,Orientation orientation,String sDimension,Chart currentChart){
  DialChart newChart=null;
  if (currentChart != null) {
    newChart=(DialChart)getConvertedChart(currentChart,sSubType,sDimension);
    if (newChart != null) {
      return newChart;
    }
  }
  newChart=(DialChart)DialChartImpl.create();
  newChart.setType(TYPE_LITERAL);
  newChart.setSubType(sSubType);
  newChart.setDimension(getDimensionFor(sDimension));
  newChart.setUnits("String_Node_Str");
  newChart.setDialSuperimposition(sSubType.equals("String_Node_Str"));
  newChart.getTitle().getLabel().getCaption().setValue(Messages.getString("String_Node_Str"));
  newChart.getLegend().setItemType(LegendItemType.SERIES_LITERAL);
  SeriesDefinition sdX=SeriesDefinitionImpl.create();
  sdX.getSeriesPalette().update(0);
  Series categorySeries=SeriesImpl.create();
  sdX.getSeries().add(categorySeries);
  sdX.getQuery().setDefinition("String_Node_Str");
  SeriesDefinition sdY=SeriesDefinitionImpl.create();
  sdY.getSeriesPalette().update(0);
  DialSeries valueSeries=(DialSeries)DialSeriesImpl.create();
  valueSeries.setSeriesIdentifier("String_Node_Str");
  sdY.getSeries().add(valueSeries);
  sdX.getSeriesDefinitions().add(sdY);
  newChart.getSeriesDefinitions().add(sdX);
  addSampleData(newChart);
  return newChart;
}

Fixed version (ground truth):
public Chart getModel(String sSubType,Orientation orientation,String sDimension,Chart currentChart){
  DialChart newChart=null;
  if (currentChart != null) {
    newChart=(DialChart)getConvertedChart(currentChart,sSubType,sDimension);
    if (newChart != null) {
      return newChart;
    }
  }
  newChart=(DialChart)DialChartImpl.create();
  newChart.setType(TYPE_LITERAL);
  newChart.setSubType(sSubType);
  newChart.setDimension(getDimensionFor(sDimension));
  newChart.setUnits("String_Node_Str");
  newChart.setDialSuperimposition(sSubType.equals("String_Node_Str"));
  newChart.getLegend().setItemType(LegendItemType.SERIES_LITERAL);
  SeriesDefinition sdX=SeriesDefinitionImpl.create();
  sdX.getSeriesPalette().update(0);
  Series categorySeries=SeriesImpl.create();
  sdX.getSeries().add(categorySeries);
  sdX.getQuery().setDefinition("String_Node_Str");
  newChart.getTitle().getLabel().getCaption().setValue(CHART_TITLE);
  SeriesDefinition sdY=SeriesDefinitionImpl.create();
  sdY.getSeriesPalette().update(0);
  DialSeries valueSeries=(DialSeries)DialSeriesImpl.create();
  valueSeries.setSeriesIdentifier("String_Node_Str");
  sdY.getSeries().add(valueSeries);
  sdX.getSeriesDefinitions().add(sdY);
  newChart.getSeriesDefinitions().add(sdX);
  addSampleData(newChart);
  return newChart;
}
Program: 79010
Project: 79010
Buggy source:
public Chart getModel(String sSubType,Orientation orientation,String sDimension,Chart currentChart){
  ChartWithoutAxes newChart=null;
  if (currentChart != null) {
    newChart=(ChartWithoutAxes)getConvertedChart(currentChart,sSubType,sDimension);
    if (newChart != null) {
      return newChart;
    }
  }
  newChart=ChartWithoutAxesImpl.create();
  newChart.setType(TYPE_LITERAL);
  newChart.setSubType(sSubType);
  newChart.setDimension(getDimensionFor(sDimension));
  newChart.setUnits("String_Node_Str");
  if (newChart.getDimension().equals(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL)) {
    newChart.setSeriesThickness(15);
  }
  newChart.getTitle().getLabel().getCaption().setValue(Messages.getString("String_Node_Str"));
  SeriesDefinition sdX=SeriesDefinitionImpl.create();
  sdX.getSeriesPalette().update(0);
  Series categorySeries=SeriesImpl.create();
  sdX.getSeries().add(categorySeries);
  sdX.getQuery().setDefinition("String_Node_Str");
  SeriesDefinition sdY=SeriesDefinitionImpl.create();
  sdY.getSeriesPalette().update(0);
  Series valueSeries=PieSeriesImpl.create();
  valueSeries.getLabel().setVisible(true);
  valueSeries.setSeriesIdentifier("String_Node_Str");
  ((PieSeries)valueSeries).getTitle().getCaption().setValue("String_Node_Str");
  ((PieSeries)valueSeries).setStacked(false);
  ((PieSeries)valueSeries).setExplosion(0);
  sdY.getSeries().add(valueSeries);
  sdX.getSeriesDefinitions().add(sdY);
  newChart.getSeriesDefinitions().add(sdX);
  addSampleData(newChart);
  return newChart;
}

Fixed version (ground truth):
public Chart getModel(String sSubType,Orientation orientation,String sDimension,Chart currentChart){
  ChartWithoutAxes newChart=null;
  if (currentChart != null) {
    newChart=(ChartWithoutAxes)getConvertedChart(currentChart,sSubType,sDimension);
    if (newChart != null) {
      return newChart;
    }
  }
  newChart=ChartWithoutAxesImpl.create();
  newChart.setType(TYPE_LITERAL);
  newChart.setSubType(sSubType);
  newChart.setDimension(getDimensionFor(sDimension));
  newChart.setUnits("String_Node_Str");
  if (newChart.getDimension().equals(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL)) {
    newChart.setSeriesThickness(15);
  }
  SeriesDefinition sdX=SeriesDefinitionImpl.create();
  sdX.getSeriesPalette().update(0);
  Series categorySeries=SeriesImpl.create();
  sdX.getSeries().add(categorySeries);
  sdX.getQuery().setDefinition("String_Node_Str");
  newChart.getTitle().getLabel().getCaption().setValue(CHART_TITLE);
  SeriesDefinition sdY=SeriesDefinitionImpl.create();
  sdY.getSeriesPalette().update(0);
  Series valueSeries=PieSeriesImpl.create();
  valueSeries.getLabel().setVisible(true);
  valueSeries.setSeriesIdentifier("String_Node_Str");
  ((PieSeries)valueSeries).getTitle().getCaption().setValue("String_Node_Str");
  ((PieSeries)valueSeries).setStacked(false);
  ((PieSeries)valueSeries).setExplosion(0);
  sdY.getSeries().add(valueSeries);
  sdX.getSeriesDefinitions().add(sdY);
  newChart.getSeriesDefinitions().add(sdX);
  addSampleData(newChart);
  return newChart;
}
Program: 79016
Project: 79016
Buggy source:
/** 
 * Returns the effective column span of the given cell.
 * @param cell the cell to find
 * @return the 1-based effective column span of the given cell. 0 means thecell is in the table element but it do not show in the layout.
 */
public static int getEffectiveColumnSpan(CellHandle cell){
  LayoutSlot layoutSlot=getLayoutSlotOfCell(cell);
  int rowId=cell.getContainer().getContainerSlotHandle().findPosn(cell.getContainer());
  LayoutRow layoutRow=(LayoutRow)layoutSlot.getLayoutRow(rowId);
  int columnPosn=layoutRow.findCellColumnPos((Cell)cell.getElement());
  if (columnPosn <= 0)   return 0;
  int effectiveColumnSpan=0;
  for (int i=columnPosn - 1; i < layoutRow.getColumnCount(); i++) {
    LayoutCell layoutCell=layoutRow.getLayoutCell(i);
    if (layoutCell.getContent() != cell.getElement())     break;
    effectiveColumnSpan++;
  }
  return effectiveColumnSpan;
}

Fixed version (ground truth):
/** 
 * Returns the effective column span of the given cell.
 * @param cell the cell to find
 * @return the 1-based effective column span of the given cell. 0 means thecell is in the table element but it do not show in the layout.
 */
public static int getEffectiveColumnSpan(CellHandle cell){
  LayoutSlot layoutSlot=getLayoutSlotOfCell(cell);
  if (layoutSlot == null)   return cell.getColumnSpan();
  int rowId=cell.getContainer().getContainerSlotHandle().findPosn(cell.getContainer());
  LayoutRow layoutRow=(LayoutRow)layoutSlot.getLayoutRow(rowId);
  int columnPosn=layoutRow.findCellColumnPos((Cell)cell.getElement());
  if (columnPosn <= 0)   return 0;
  int effectiveColumnSpan=0;
  for (int i=columnPosn - 1; i < layoutRow.getColumnCount(); i++) {
    LayoutCell layoutCell=layoutRow.getLayoutCell(i);
    if (layoutCell.getContent() != cell.getElement())     break;
    effectiveColumnSpan++;
  }
  return effectiveColumnSpan;
}
Program: 79017
Project: 79017
Buggy source:
/** 
 * Copied the structure of extended element to the element itself. Local properties will all be cleared.Please note that the containment relationship is kept while property values are not copied.
 * @return <code>true</code> if the refresh action is successful.<code>false</code> othersize.
 */
public boolean refreshStructureFromParent(){
}

Fixed version (ground truth):
/** 
 * Copied the structure of extended element to the element itself. Local properties will all be cleared.Please note that the containment relationship is kept while property values are not copied.
 * @param module the module
 * @return <code>true</code> if the refresh action is successful.<code>false</code> othersize.
 */
public boolean refreshStructureFromParent(Module module){
}
Program: 79018
Project: 79018
Buggy source:
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown) || e.getSource().equals(srTransparency)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp.equals(btnGradient) || cTmp.equals(btnCustom) || cTmp.equals(btnImage)|| (e.getSource().equals(cmpDropDown) && cTmp.equals(srTransparency))) {
      return;
    }
    if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
      bJustFocusLost=true;
    }
    cmpDropDown.getShell().dispose();
    return;
  }
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown) || e.getSource().equals(srTransparency)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp != null) {
      if (cTmp.equals(btnGradient) || cTmp.equals(btnCustom) || cTmp.equals(btnImage)|| (e.getSource().equals(cmpDropDown) && cTmp.equals(srTransparency))) {
        return;
      }
      if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
        bJustFocusLost=true;
      }
    }
    cmpDropDown.getShell().dispose();
    return;
  }
}
Program: 79019
Project: 79019
Buggy source:
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
      bJustFocusLost=true;
    }
    cmpDropDown.getShell().dispose();
  }
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp != null) {
      if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
        bJustFocusLost=true;
      }
    }
    cmpDropDown.getShell().dispose();
  }
}
Program: 79020
Project: 79020
Buggy source:
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
      bJustFocusLost=true;
    }
    cmpDropDown.getShell().dispose();
  }
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp != null) {
      if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
        bJustFocusLost=true;
      }
    }
    cmpDropDown.getShell().dispose();
  }
}
Program: 79021
Project: 79021
Buggy source:
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
      bJustFocusLost=true;
    }
    cmpDropDown.getShell().dispose();
  }
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  if (e.getSource().equals(cmpDropDown)) {
    Control cTmp=Display.getCurrent().getCursorControl();
    if (cTmp != null) {
      if (cTmp.equals(cnvSelection) || cTmp.equals(btnDown)) {
        bJustFocusLost=true;
      }
    }
    cmpDropDown.getShell().dispose();
  }
}
Program: 79022
Project: 79022
Buggy source:
/** 
 * Returns the embedded image name that this image refers, if the image source type is <code>IMAGE_REF_TYPE_EMBED</code>. This is not the same as   {@link DesignElementHandle#getName}of this image item.
 * @return the embedded image name, if the image source type is<code>IMAGE_REF_TYPE_EMBED</code>. Otherwise, return <code>null</code>.
 */
public String getImageName(){
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(getStringProperty(ImageItem.SOURCE_PROP))) {
    return getStringProperty(ImageItem.IMAGE_NAME_PROP);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the embedded image name that this image refers, if the image source type is <code>IMAGE_REF_TYPE_EMBED</code>. This is not the same as   {@link DesignElementHandle#getName}of this image item.
 * @return the embedded image name, if the image source type is<code>IMAGE_REF_TYPE_EMBED</code>. Otherwise, return <code>null</code>.
 */
public String getImageName(){
  if (DesignChoiceConstants.IMAGE_REF_TYPE_EMBED.equalsIgnoreCase(getStringProperty(ImageItem.SOURCE_PROP))) {
    if (getElement().getLocalProperty(getModule(),IImageItemModel.IMAGE_NAME_PROP) != null) {
      return ((StructRefValue)getElement().getLocalProperty(getModule(),IImageItemModel.IMAGE_NAME_PROP)).getName();
    }
    String name=getStringProperty(IImageItemModel.IMAGE_NAME_PROP);
    if (name == null)     return null;
    Module module=getModule();
    DesignElementHandle parent=getExtends();
    while (parent != null) {
      if (parent.getElement().getLocalProperty(parent.getModule(),IImageItemModel.IMAGE_NAME_PROP) != null) {
        module=(Module)parent.getRoot().getElement();
        break;
      }
      parent=parent.getExtends();
    }
    if (module instanceof Library) {
      String namespace=((Library)module).getNamespace();
      return StringUtil.buildQualifiedReference(namespace,name);
    }
    return name;
  }
  return null;
}
Program: 79023
Project: 79023
Buggy source:
/** 
 * Returns the data set name of the dynamic list for this parameter.
 * @return the data set name of the dynamic list
 */
public String getDataSetName(){
  return getStringProperty(ScalarParameter.DATASET_NAME_PROP);
}

Fixed version (ground truth):
/** 
 * Returns the data set name of the dynamic list for this parameter.
 * @return the data set name of the dynamic list
 */
public String getDataSetName(){
  if (getElement().getLocalProperty(getModule(),ScalarParameter.DATASET_NAME_PROP) != null) {
    return ((ElementRefValue)getElement().getLocalProperty(getModule(),ScalarParameter.DATASET_NAME_PROP)).getName();
  }
  String name=getStringProperty(ScalarParameter.DATASET_NAME_PROP);
  if (name == null)   return null;
  Module module=getModule();
  DesignElementHandle parent=getExtends();
  while (parent != null) {
    if (parent.getElement().getLocalProperty(parent.getModule(),ScalarParameter.DATASET_NAME_PROP) != null) {
      module=(Module)parent.getRoot().getElement();
      break;
    }
    parent=parent.getExtends();
  }
  if (module instanceof Library) {
    String namespace=((Library)module).getNamespace();
    return StringUtil.buildQualifiedReference(namespace,name);
  }
  return name;
}
Program: 79024
Project: 79024
Buggy source:
/** 
 * Set the value for the list limitation number. This property is used to limit the parameter display list. 
 * @param listLimit The limited number.
 * @throws SemanticException
 */
public void setListlimit(int listLimit) throws SemanticException {
  setIntProperty(IScalarParameterModel.LIST_LIMIT_PROP,listLimit);
}

Fixed version (ground truth):
/** 
 * Set the value for the list limitation number. This property is used to limit the parameter display list.
 * @param listLimit The limited number.
 * @throws SemanticException
 */
public void setListlimit(int listLimit) throws SemanticException {
  setIntProperty(IScalarParameterModel.LIST_LIMIT_PROP,listLimit);
}
Program: 79025
Project: 79025
Buggy source:
/** 
 * Validates the structure value.
 * @param module report design
 * @param targetDefn definition of target structure
 * @param target target structure
 * @return the resolved structure reference value
 * @throws PropertyValueException if the type of target structure is not that target definition.
 */
private StructRefValue validateStructValue(Module module,StructureDefn targetDefn,Structure target) throws PropertyValueException {
  if (targetDefn != target.getDefn())   throw new PropertyValueException(target.getReferencableProperty(),PropertyValueException.DESIGN_EXCEPTION_WRONG_ITEM_TYPE,PropertyType.STRUCT_REF_TYPE);
  return new StructRefValue(target);
}

Fixed version (ground truth):
/** 
 * Validates the structure value.
 * @param module report design
 * @param targetDefn definition of target structure
 * @param target target structure
 * @return the resolved structure reference value
 * @throws PropertyValueException if the type of target structure is not that target definition.
 */
private StructRefValue validateStructValue(Module module,StructureDefn targetDefn,Structure target) throws PropertyValueException {
  if (targetDefn != target.getDefn())   throw new PropertyValueException(target.getReferencableProperty(),PropertyValueException.DESIGN_EXCEPTION_WRONG_ITEM_TYPE,PropertyType.STRUCT_REF_TYPE);
  String namespace=null;
  if (module instanceof Library)   namespace=((Library)module).getNamespace();
  return new StructRefValue(namespace,target);
}
Program: 79026
Project: 79026
Buggy source:
/** 
 * Validates the structure name.
 * @param module report design
 * @param targetDefn definition of target structure
 * @param name structure name
 * @return the resolved structure reference value
 * @throws PropertyValueException if the type of target structure is not that target definition, or the structure with the given name is not found.
 */
private StructRefValue validateStringValue(Module module,StructureDefn targetDefn,String name) throws PropertyValueException {
  if (StringUtil.isBlank(name))   return null;
  Structure target=getStructure(module,targetDefn,name);
  if (target == null)   return new StructRefValue(name);
  if (targetDefn != target.getDefn())   throw new PropertyValueException(target.getReferencableProperty(),PropertyValueException.DESIGN_EXCEPTION_WRONG_ITEM_TYPE,PropertyType.STRUCT_REF_TYPE);
  return new StructRefValue(target);
}

Fixed version (ground truth):
/** 
 * Validates the structure name.
 * @param module report design
 * @param targetDefn definition of target structure
 * @param name structure name
 * @return the resolved structure reference value
 * @throws PropertyValueException if the type of target structure is not that target definition, or the structure with the given name is not found.
 */
private StructRefValue validateStringValue(Module module,StructureDefn targetDefn,String name) throws PropertyValueException {
  if (StringUtil.isBlank(name))   return null;
  Structure target=getStructure(module,targetDefn,name);
  String namespace=null;
  if (module instanceof Library)   namespace=((Library)module).getNamespace();
  if (target == null)   return new StructRefValue(namespace,name);
  if (targetDefn != target.getDefn())   throw new PropertyValueException(target.getReferencableProperty(),PropertyValueException.DESIGN_EXCEPTION_WRONG_ITEM_TYPE,PropertyType.STRUCT_REF_TYPE);
  return new StructRefValue(namespace,target);
}
Program: 79028
Project: 79028
Buggy source:
/** 
 * Returns the object can be deleted. If the parent can be deleted, the children will be skippedl
 * @param source single or multiple objects
 */
protected boolean canDrop(Object source){
  if (source == null) {
    return false;
  }
  if (source instanceof StructuredSelection) {
    return canDrop(((StructuredSelection)source).toArray());
  }
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    if (array.length == 0) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (DNDUtil.checkContainerExists(array[i],array))       continue;
      if (!canDrop(array[i]))       return false;
    }
    return true;
  }
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof SlotHandle) {
    SlotHandle slot=(SlotHandle)source;
    DesignElementHandle handle=slot.getElementHandle();
    return slot.getContents().size() > 0 && (handle instanceof ListHandle || handle instanceof ListGroupHandle);
  }
  if (source instanceof EmbeddedImageHandle) {
    return true;
  }
  if (source instanceof CellHandle) {
    return ((CellHandle)source).getContent().getContents().size() > 0;
  }
  return source instanceof ReportElementHandle && !(source instanceof MasterPageHandle);
}

Fixed version (ground truth):
/** 
 * Returns the object can be deleted. If the parent can be deleted, the children will be skippedl
 * @param source single or multiple objects
 */
protected boolean canDrop(Object source){
  if (source == null) {
    return false;
  }
  if (source instanceof StructuredSelection) {
    return canDrop(((StructuredSelection)source).toArray());
  }
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    if (array.length == 0) {
      return false;
    }
    for (int i=0; i < array.length; i++) {
      if (DNDUtil.checkContainerExists(array[i],array))       continue;
      if (canDrop(array[i]))       return true;
    }
    return false;
  }
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof SlotHandle) {
    SlotHandle slot=(SlotHandle)source;
    DesignElementHandle handle=slot.getElementHandle();
    return slot.getContents().size() > 0 && (handle instanceof ListHandle || handle instanceof ListGroupHandle);
  }
  if (source instanceof EmbeddedImageHandle) {
    return true;
  }
  if (source instanceof CellHandle) {
    return ((CellHandle)source).getContent().getContents().size() > 0;
  }
  return source instanceof ReportElementHandle && !(source instanceof MasterPageHandle);
}
Program: 79030
Project: 79030
Buggy source:
protected void populateAvailableDbObjects(){
  if ((cachedSearchTxt == searchTxt.getText() || (cachedSearchTxt != null && cachedSearchTxt.equals(searchTxt.getText()))) && (cachedDbType == getSelectedDbType() || (cachedDbType != null && cachedDbType.equals(getSelectedDbType())))) {
    if (schemaList != null && schemaList.size() > 0) {
      if (cachedSchemaComboIndex == schemaCombo.getSelectionIndex()) {
        return;
      }
    }
 else     return;
  }
  RemoveAllAvailableDbObjects();
  setRootElement();
  setRefreshInfo();
  if (isSchemaSupported) {
    getAvailableSchema();
    if (schemaCombo.getItemCount() < 1) {
      schemaCombo.add(JdbcPlugin.getResourceString("String_Node_Str"));
      schemaCombo.select(0);
      if (schemaList != null) {
        Iterator it=schemaList.iterator();
        while (it.hasNext())         schemaCombo.add(it.next().toString());
      }
    }
    populateTableList();
  }
 else {
    populateTableList();
  }
  if (rootNode != null) {
    selectNode(rootNode);
  }
}

Fixed version (ground truth):
protected void populateAvailableDbObjects(){
  OdaDataSourceHandle curDataSourceHandle=(OdaDataSourceHandle)((OdaDataSetHandle)getContainer().getModel()).getDataSource();
  if (curDataSourceHandle == prevDataSourceHandle) {
    if ((cachedSearchTxt == searchTxt.getText() || (cachedSearchTxt != null && cachedSearchTxt.equals(searchTxt.getText()))) && (cachedDbType == getSelectedDbType() || (cachedDbType != null && cachedDbType.equals(getSelectedDbType())))) {
      if (schemaList != null && schemaList.size() > 0) {
        if (cachedSchemaComboIndex == schemaCombo.getSelectionIndex()) {
          return;
        }
      }
 else       return;
    }
  }
  RemoveAllAvailableDbObjects();
  setRootElement();
  setRefreshInfo();
  if (isSchemaSupported) {
    getAvailableSchema();
    if (schemaCombo.getItemCount() < 1) {
      schemaCombo.add(JdbcPlugin.getResourceString("String_Node_Str"));
      schemaCombo.select(0);
      if (schemaList != null) {
        Iterator it=schemaList.iterator();
        while (it.hasNext())         schemaCombo.add(it.next().toString());
      }
    }
    populateTableList();
  }
 else {
    populateTableList();
  }
  if (rootNode != null) {
    selectNode(rootNode);
  }
}
Program: 79031
Project: 79031
Buggy source:
private void refreshPage(){
  OdaDataSourceHandle curDataSourceHandle=(OdaDataSourceHandle)((OdaDataSetHandle)getContainer().getModel()).getDataSource();
  if (curDataSourceHandle != prevDataSourceHandle) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceHandle);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceHandle);
    prevDataSourceHandle=curDataSourceHandle;
    populateAvailableDbObjects();
  }
}

Fixed version (ground truth):
private void refreshPage(){
  OdaDataSourceHandle curDataSourceHandle=(OdaDataSourceHandle)((OdaDataSetHandle)getContainer().getModel()).getDataSource();
  if (curDataSourceHandle != prevDataSourceHandle) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceHandle);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceHandle);
    populateAvailableDbObjects();
    prevDataSourceHandle=curDataSourceHandle;
  }
}
Program: 79032
Project: 79032
Buggy source:
/** 
 * UnGroups the svg drawing instructions that represents this primitive events. 
 * @param pre primitive render event
 */
protected void ungroupPrimitive(PrimitiveRenderEvent pre){
  SVGGraphics2D svg_g2d=(SVGGraphics2D)_g2d;
  final StructureSource src=isSeries((StructureSource)pre.getSource());
  if (src != null) {
    svg_g2d.popParent();
  }
}

Fixed version (ground truth):
/** 
 * UnGroups the svg drawing instructions that represents this primitive events. 
 * @param pre primitive render event
 */
protected void ungroupPrimitive(PrimitiveRenderEvent pre){
  SVGGraphics2D svg_g2d=(SVGGraphics2D)_g2d;
  if (pre.getSource() instanceof StructureSource) {
    final StructureSource src=isSeries((StructureSource)pre.getSource());
    if (src != null) {
      svg_g2d.popParent();
    }
  }
}
Program: 79033
Project: 79033
Buggy source:
/** 
 * Groups the svg drawing instructions that represents this primitive events.  Each group is  assigned an id that identifies the source object of the primitive event
 * @param pre primitive render event
 */
protected void groupPrimitive(PrimitiveRenderEvent pre){
  SVGGraphics2D svg_g2d=(SVGGraphics2D)_g2d;
  final StructureSource src=isSeries((StructureSource)pre.getSource());
  if (src != null) {
    try {
      Series seDT=findDesignTimeSeries((Series)src.getSource());
      String id=Integer.toString(pre.hashCode());
      List components=(List)componentPrimitives.get(seDT);
      if (components == null) {
        components=new ArrayList();
        componentPrimitives.put(seDT,components);
      }
      String idTemp=id;
      int counter=1;
      while (components.contains(idTemp)) {
        idTemp=id + "String_Node_Str" + counter;
        counter++;
      }
      components.add(idTemp);
      Element primGroup=svg_g2d.createElement("String_Node_Str");
      svg_g2d.pushParent(primGroup);
      primGroup.setAttribute("String_Node_Str",seDT.hashCode() + "String_Node_Str" + idTemp);
      primGroup.setAttribute("String_Node_Str","String_Node_Str");
    }
 catch (    ChartException e) {
      logger.log(e);
      return;
    }
  }
}

Fixed version (ground truth):
/** 
 * Groups the svg drawing instructions that represents this primitive events.  Each group is  assigned an id that identifies the source object of the primitive event
 * @param pre primitive render event
 */
protected void groupPrimitive(PrimitiveRenderEvent pre){
  SVGGraphics2D svg_g2d=(SVGGraphics2D)_g2d;
  if (pre.getSource() instanceof StructureSource) {
    final StructureSource src=isSeries((StructureSource)pre.getSource());
    if (src != null) {
      try {
        Series seDT=findDesignTimeSeries((Series)src.getSource());
        String id=Integer.toString(pre.hashCode());
        List components=(List)componentPrimitives.get(seDT);
        if (components == null) {
          components=new ArrayList();
          componentPrimitives.put(seDT,components);
        }
        String idTemp=id;
        int counter=1;
        while (components.contains(idTemp)) {
          idTemp=id + "String_Node_Str" + counter;
          counter++;
        }
        components.add(idTemp);
        Element primGroup=svg_g2d.createElement("String_Node_Str");
        svg_g2d.pushParent(primGroup);
        primGroup.setAttribute("String_Node_Str",seDT.hashCode() + "String_Node_Str" + idTemp);
        primGroup.setAttribute("String_Node_Str","String_Node_Str");
      }
 catch (      ChartException e) {
        logger.log(e);
        return;
      }
    }
  }
}
Program: 79036
Project: 79036
Buggy source:
public String getDisplayText(Object element){
  if (element instanceof Object[]) {
    if (element instanceof Operator[]) {
      if (element == OPERATORS_ASSIGNMENT) {
        return DISPLAY_TEXT_ASSIGNMENT;
      }
 else       if (element == OPERATORS_COMPARISON) {
        return DISPLAY_TEXT_COMPARISON;
      }
 else       if (element == OPERATORS_COMPUTATIONAL) {
        return DISPLAY_TEXT_COMPUTATIONAL;
      }
 else       if (element == OPERATORS_LOGICAL) {
        return DISPLAY_TEXT_LOGICAL;
      }
    }
 else     if (element instanceof ILocalizableInfo[]) {
      ILocalizableInfo info=((ILocalizableInfo[])element)[1];
      StringBuffer displayText=new StringBuffer(info.getName());
      if (info instanceof IMethodInfo) {
        IMethodInfo method=(IMethodInfo)info;
        displayText.append("String_Node_Str");
        displayText.append("String_Node_Str");
        displayText.append(method.getReturnType());
      }
      return displayText.toString();
    }
    return ALL;
  }
 else   if (element instanceof String) {
    return (String)element;
  }
 else   if (element instanceof Operator) {
    return ((Operator)element).symbol;
  }
 else   if (element instanceof ParameterHandle) {
    return ((ParameterHandle)element).getName();
  }
 else   if (element instanceof DataSetHandle) {
    return ((DataSetHandle)element).getName();
  }
 else   if (element instanceof DataSetItemModel) {
    return ((DataSetItemModel)element).getName();
  }
  return element.toString();
}

Fixed version (ground truth):
public String getDisplayText(Object element){
  if (element instanceof Object[]) {
    if (element instanceof Operator[]) {
      if (element == OPERATORS_ASSIGNMENT) {
        return DISPLAY_TEXT_ASSIGNMENT;
      }
 else       if (element == OPERATORS_COMPARISON) {
        return DISPLAY_TEXT_COMPARISON;
      }
 else       if (element == OPERATORS_COMPUTATIONAL) {
        return DISPLAY_TEXT_COMPUTATIONAL;
      }
 else       if (element == OPERATORS_LOGICAL) {
        return DISPLAY_TEXT_LOGICAL;
      }
    }
 else     if (element instanceof ILocalizableInfo[]) {
      ILocalizableInfo info=((ILocalizableInfo[])element)[1];
      StringBuffer displayText=new StringBuffer(info.getName());
      if (info instanceof IMethodInfo) {
        IMethodInfo method=(IMethodInfo)info;
        displayText.append("String_Node_Str");
        displayText.append("String_Node_Str");
        displayText.append(method.getReturnType());
      }
      return displayText.toString();
    }
    return ALL;
  }
 else   if (element instanceof String) {
    return (String)element;
  }
 else   if (element instanceof Operator) {
    return ((Operator)element).symbol;
  }
 else   if (element instanceof DesignElementHandle) {
    return ((DesignElementHandle)element).getName();
  }
 else   if (element instanceof DataSetItemModel) {
    return ((DataSetItemModel)element).getName();
  }
  return element.toString();
}
Program: 79037
Project: 79037
Buggy source:
public Image getImage(Object element){
  if (element instanceof Operator) {
    return IMAGE_OPERATOR;
  }
 else   if (element instanceof ILocalizableInfo[]) {
    ILocalizableInfo info=((ILocalizableInfo[])element)[1];
    if (info instanceof IMethodInfo) {
      if (((IMethodInfo)info).isStatic()) {
        return IMAGE_STATIC_METHOD;
      }
      return IMAGE_METHOD;
    }
    if (info instanceof IMemberInfo) {
      if (((IMemberInfo)info).isStatic()) {
        return IMAGE_STATIC_MEMBER;
      }
      return IMAGE_MEMBER;
    }
  }
 else   if (element instanceof DataSetItemModel) {
    return IMAGE_COLUMN;
  }
 else   if (element instanceof ParameterHandle) {
    return ReportPlatformUIImages.getImage(element);
  }
  return null;
}

Fixed version (ground truth):
public Image getImage(Object element){
  if (element instanceof Operator) {
    return IMAGE_OPERATOR;
  }
 else   if (element instanceof ILocalizableInfo[]) {
    ILocalizableInfo info=((ILocalizableInfo[])element)[1];
    if (info instanceof IMethodInfo) {
      if (((IMethodInfo)info).isStatic()) {
        return IMAGE_STATIC_METHOD;
      }
      return IMAGE_METHOD;
    }
    if (info instanceof IMemberInfo) {
      if (((IMemberInfo)info).isStatic()) {
        return IMAGE_STATIC_MEMBER;
      }
      return IMAGE_MEMBER;
    }
  }
 else   if (element instanceof DataSetItemModel) {
    return IMAGE_COLUMN;
  }
 else   if (element instanceof DesignElementHandle) {
    return ReportPlatformUIImages.getImage(element);
  }
  return null;
}
Program: 79038
Project: 79038
Buggy source:
public void switchTo(String sTaskID){
  if (sCurrentActiveTask != null) {
    this.context=((ITask)availableTasks.get(sCurrentActiveTask)).getContext();
    String[] sErrors=((ITask)availableTasks.get(sCurrentActiveTask)).getErrors();
    new ErrorDialog("String_Node_Str","String_Node_Str",sErrors,new String[]{});
  }
  if (shellPopup != null && !shellPopup.isDisposed()) {
    shellPopup.close();
  }
  if (errorHints != null) {
    ((ITask)availableTasks.get(sTaskID)).setErrorHints(errorHints);
  }
  ((ITask)availableTasks.get(sTaskID)).setContext(context);
  errorHints=null;
  Control c=((ITask)availableTasks.get(sTaskID)).getUI(cmpTaskContainer);
  slTaskContainer.topControl=c;
  cmpTaskContainer.layout();
  tasklist.setActive((String)vTaskLabels.get(vTaskIDs.indexOf(sTaskID)));
  sCurrentActiveTask=sTaskID;
}

Fixed version (ground truth):
public void switchTo(String sTaskID){
  if (sCurrentActiveTask != null) {
    this.context=((ITask)availableTasks.get(sCurrentActiveTask)).getContext();
    String[] sErrors=((ITask)availableTasks.get(sCurrentActiveTask)).getErrors();
    if (sErrors != null && sErrors.length > 0) {
      new ErrorDialog("String_Node_Str","String_Node_Str",sErrors,new String[]{});
    }
  }
  if (shellPopup != null && !shellPopup.isDisposed()) {
    shellPopup.close();
  }
  if (errorHints != null) {
    ((ITask)availableTasks.get(sTaskID)).setErrorHints(errorHints);
  }
  ((ITask)availableTasks.get(sTaskID)).setContext(context);
  errorHints=null;
  Control c=((ITask)availableTasks.get(sTaskID)).getUI(cmpTaskContainer);
  slTaskContainer.topControl=c;
  cmpTaskContainer.layout();
  tasklist.setActive((String)vTaskLabels.get(vTaskIDs.indexOf(sTaskID)));
  sCurrentActiveTask=sTaskID;
}
Program: 79039
Project: 79039
Buggy source:
/** 
 * Displays the errors in a common Error Display UI mechanism. Also displayed are possible solutions to the problems. The user can also be given the option of switching to a different task where the fix needs to be made. (This is not implemented yet).
 * @param sErrors Array of error strings
 * @param sFixes Array of strings listing possible solutions to above errors
 * @param sTaskIDs Array of task IDs which the user can switch to. The appropriate task labels should be indicated in the solutions toallow users to make the connection 
 * @param context Updated IWizardContext instance...this instance will include the erroneous settings
 * @param errorHints Object array that will be passed to the target task...which can be used to indicate specific problems or to customizebehavior of the task UI
 */
public void displayError(String[] sErrors,String[] sFixes,String[] sTaskIDs,IWizardContext currentContext,Object[] hints){
  this.errorHints=hints;
  ErrorDialog dlg=new ErrorDialog("String_Node_Str","String_Node_Str",sErrors,sFixes);
  if (dlg.getOption() == ErrorDialog.OPTION_ACCEPT) {
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Displays the errors in a common Error Display UI mechanism. Also displayed are possible solutions to the problems. The user can also be given the option of switching to a different task where the fix needs to be made. (This is not implemented yet).
 * @param sErrors Array of error strings
 * @param sFixes Array of strings listing possible solutions to above errors
 * @param sTaskIDs Array of task IDs which the user can switch to. The appropriate task labels should be indicated in the solutions toallow users to make the connection 
 * @param context Updated IWizardContext instance...this instance will include the erroneous settings
 * @param errorHints Object array that will be passed to the target task...which can be used to indicate specific problems or to customizebehavior of the task UI
 */
public void displayError(String[] sErrors,String[] sFixes,String[] sTaskIDs,IWizardContext currentContext,Object[] hints){
  if (sErrors != null && sErrors.length > 0) {
    this.errorHints=hints;
    ErrorDialog dlg=new ErrorDialog("String_Node_Str","String_Node_Str",sErrors,sFixes);
    if (dlg.getOption() == ErrorDialog.OPTION_ACCEPT) {
    }
 else {
    }
  }
}
Program: 79041
Project: 79041
Buggy source:
/** 
 * Loads library with the given library file name. This file name can be absolute or relative. If the library doesn't exist or fatal error occurs when opening library, one invalid library will be added into the library list of this module.
 * @param libraryFileName library file name
 * @param namespace library namespace
 * @return the loaded library
 * @throws DesignFileException if the library file has fatal error.
 */
public Library loadLibrary(String libraryFileName,String namespace) throws DesignFileException {
  if (libraries == null)   libraries=new ArrayList();
  URL url=findResource(libraryFileName,IResourceLocator.LIBRARY);
  if (url == null) {
    DesignParserException ex=new DesignParserException(new String[]{libraryFileName},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(libraryFileName,exceptionList);
  }
  try {
    Library library=LibraryReader.getInstance().read(session,this,url.toString(),namespace,url.openStream());
    library.setNamespace(namespace);
    return library;
  }
 catch (  IOException e) {
    DesignParserException ex=new DesignParserException(new String[]{libraryFileName},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(libraryFileName,exceptionList);
  }
}

Fixed version (ground truth):
/** 
 * Loads library with the given library file name. This file name can be absolute or relative. If the library doesn't exist or fatal error occurs when opening library, one invalid library will be added into the library list of this module.
 * @param libraryFileName library file name
 * @param namespace library namespace
 * @return the loaded library
 * @throws DesignFileException if the library file has fatal error.
 */
public Library loadLibrary(String libraryFileName,String namespace) throws DesignFileException {
  if (libraries == null)   libraries=new ArrayList();
  URL url=findResource(libraryFileName,IResourceLocator.LIBRARY);
  if (url == null) {
    DesignParserException ex=new DesignParserException(new String[]{libraryFileName},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(libraryFileName,exceptionList);
  }
  try {
    Library library=LibraryReader.getInstance().read(session,this,url.toString(),namespace,url.openStream());
    if (StringUtil.isBlank(namespace)) {
      library.setNamespace(StringUtil.extractFileName(libraryFileName));
    }
    return library;
  }
 catch (  IOException e) {
    DesignParserException ex=new DesignParserException(new String[]{libraryFileName},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(libraryFileName,exceptionList);
  }
}
Program: 79042
Project: 79042
Buggy source:
/** 
 * Implementation of adding a symbol to a name space. Adds the name only if it is not null and it has container. This means that we can modify the element name as will if it's not attached on other elements, and the name is saved in name space only after the element is added to a slot of the container.
 */
private void addSymbol(){
  if (element.getName() == null)   return;
  if (element.getContainer() != null) {
    int ns=((ElementDefn)element.getDefn()).getNameSpaceID();
    getActivityStack().execute(new NameSpaceRecord(getModule(),ns,element,true));
  }
}

Fixed version (ground truth):
/** 
 * Implementation of adding a symbol to a name space. Adds the name only if it is not null and it has container. This means that we can modify the element name as will if it's not attached on other elements, and the name is saved in name space only after the element is added to a slot of the container.
 */
private void addSymbol(){
  if (element.getName() == null)   return;
  if (element instanceof StyleElement && element.getContainer() instanceof Theme)   return;
  if (element.getContainer() != null) {
    int ns=((ElementDefn)element.getDefn()).getNameSpaceID();
    DesignElement existedElement=getModule().getNameSpace(ns).getElement(element.getName());
    if (existedElement != element)     getActivityStack().execute(new NameSpaceRecord(getModule(),ns,element,true));
  }
}
Program: 79043
Project: 79043
Buggy source:
/** 
 * Checks that the given name is legal for the element.
 * @param name the name to check.
 * @throws NameException if the element name is not allowed to change.
 */
private void checkName(String name) throws NameException {
  ElementDefn metaData=(ElementDefn)element.getDefn();
  if (name == null) {
    if (element.hasDerived() || element.hasReferences())     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_HAS_REFERENCES);
    if (metaData.getNameOption() == MetaDataConstants.REQUIRED_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_REQUIRED);
  }
 else {
    if (metaData.getNameOption() == MetaDataConstants.NO_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN);
    int ns=metaData.getNameSpaceID();
    if (!getModule().getModuleNameSpace(ns).canContain(name))     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
  }
}

Fixed version (ground truth):
/** 
 * Checks the current element name. Done when adding a newly created element where the element name is already set on the new element.
 * @param name the name to check.
 * @throws NameException if the element name is not allowed to change.
 */
public void checkName(String name) throws NameException {
  ElementDefn metaData=(ElementDefn)element.getDefn();
  if (name == null) {
    if (element.hasDerived() || element.hasReferences())     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_HAS_REFERENCES);
    if (metaData.getNameOption() == MetaDataConstants.REQUIRED_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_REQUIRED);
  }
 else {
    if (metaData.getNameOption() == MetaDataConstants.NO_NAME)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_NAME_FORBIDDEN);
    int ns=metaData.getNameSpaceID();
    if (ns == Module.STYLE_NAME_SPACE && element instanceof StyleElement && getModule() instanceof Library) {
      return;
    }
    DesignElement existedElement=getModule().getNameSpace(ns).getElement(name);
    if (existedElement != null && existedElement != element)     throw new NameException(element,name,NameException.DESIGN_EXCEPTION_DUPLICATE);
  }
}
Program: 79044
Project: 79044
Buggy source:
/** 
 * Opens a design given a stream to the design and the the file name of the design.
 * @param systemId the uri where to find the relative sources for the library. This url is treated as an absolute directory.
 * @param is the input stream to read the design
 * @return the opened report design
 * @throws DesignFileException If the file is not found, or the file contains fatal errors.
 */
public ReportDesign openDesign(URL systemId,InputStream is) throws DesignFileException {
  ReportDesign design=DesignReader.getInstance().read(this,systemId,is);
  designs.add(design);
  return design;
}

Fixed version (ground truth):
/** 
 * Opens a design given a stream to the design and the the file name of the design.
 * @param systemId the uri where to find the relative sources for the library. This url is treated as an absolute directory.
 * @param is the input stream to read the design
 * @return the opened report design
 * @throws DesignFileException If the file is not found, or the file contains fatal errors.
 */
public ReportDesign openDesign(URL systemId,InputStream is) throws DesignFileException {
  if (is == null)   throw new IllegalArgumentException("String_Node_Str");
  ReportDesign design=DesignReader.getInstance().read(this,systemId,is);
  designs.add(design);
  return design;
}
Program: 79045
Project: 79045
Buggy source:
/** 
 * Opens a library with the given library file name.
 * @param systemId the uri where to find the relative sources for the library. This url is treated as an absolute directory.
 * @param is the input stream
 * @return the opened library
 * @throws DesignFileException If the file is not found, or the file contains fatal errors.
 */
public Library openLibrary(URL systemId,InputStream is) throws DesignFileException {
  Library library=LibraryReader.getInstance().read(this,systemId,is);
  libraries.add(library);
  return library;
}

Fixed version (ground truth):
/** 
 * Opens a library with the given library file name.
 * @param systemId the uri where to find the relative sources for the library. This url is treated as an absolute directory.
 * @param is the input stream
 * @return the opened library
 * @throws DesignFileException If the file is not found, or the file contains fatal errors.
 */
public Library openLibrary(URL systemId,InputStream is) throws DesignFileException {
  if (is == null)   throw new IllegalArgumentException("String_Node_Str");
  Library library=LibraryReader.getInstance().read(this,systemId,is);
  libraries.add(library);
  return library;
}
Program: 79047
Project: 79047
Buggy source:
/** 
 * @param groupKeyValues
 * @param columnNames
 * @param i
 * @return
 * @throws DataException
 */
private boolean groupKeyValuesEqual(Object[] groupKeyValues,String[] columnNames,int i) throws DataException {
  return (odiResult.getCurrentResult().getFieldValue(columnNames[i]) == null && groupKeyValues[i] == null) || (odiResult.getCurrentResult().getFieldValue(columnNames[i]).equals(groupKeyValues[i]));
}

Fixed version (ground truth):
/** 
 * @param groupKeyValues
 * @param columnNames
 * @param i
 * @return
 * @throws DataException
 */
private boolean groupKeyValuesEqual(Object[] groupKeyValues,String[] columnNames,int i) throws DataException {
  Object fieldValue=odiResult.getCurrentResult().getFieldValue(columnNames[i]);
  return (fieldValue == null && groupKeyValues[i] == null) || ((fieldValue != null && groupKeyValues[i] != null) && (fieldValue.equals(groupKeyValues[i])));
}