nus-yam/ex-repair huggingface dataset:
Program: 77446
Project: 77446
Buggy source:
/** 
 * @throws SemanticException
 */
public void test_137129() throws SemanticException {
  SessionHandle session=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.ENGLISH);
  designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  DataItemHandle data=factory.newDataItem("String_Node_Str");
  designHandle.getBody().add(data);
  ComputedColumn column1=StructureFactory.newComputedColumn(data,"String_Node_Str");
  column1.setExpression("String_Node_Str");
  data.addColumnBinding(column1,true);
  ComputedColumn column2=StructureFactory.newComputedColumn(data,"String_Node_Str");
  column2.setExpression("String_Node_Str");
  try {
    data.addColumnBinding(column2,true);
    fail();
  }
 catch (  SemanticException e) {
    assertEquals(NameException.DESIGN_EXCEPTION_DUPLICATE,e.getErrorCode());
  }
}

Fixed version (ground truth):
/** 
 * @throws SemanticException
 */
public void test_137129() throws SemanticException {
  SessionHandle session=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.ENGLISH);
  designHandle=session.createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  DataItemHandle data=factory.newDataItem("String_Node_Str");
  designHandle.getBody().add(data);
  ComputedColumn column1=StructureFactory.newComputedColumn(data,"String_Node_Str");
  column1.setExpression("String_Node_Str");
  data.addColumnBinding(column1,true);
  ComputedColumn column2=StructureFactory.newComputedColumn(data,"String_Node_Str");
  column2.setExpression("String_Node_Str");
  assertEquals("String_Node_Str",column2.getName());
  try {
    column2.setName("String_Node_Str");
    data.addColumnBinding(column2,true);
    fail();
  }
 catch (  SemanticException e) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_VALUE_EXISTS,e.getErrorCode());
  }
}
Program: 77447
Project: 77447
Buggy source:
/** 
 * @throws DesignFileException
 * @throws SemanticException
 */
public void test_142432() throws DesignFileException, SemanticException {
  openLibrary(libraryname);
  MasterPageHandle masterpage=libraryHandle.findMasterPage("String_Node_Str");
  openDesign(filename);
  designHandle.includeLibrary(libraryname,"String_Node_Str");
  MasterPageHandle mp=(MasterPageHandle)designHandle.getElementFactory().newElementFrom(masterpage,"String_Node_Str");
  designHandle.getMasterPages().add(mp);
  assertFalse(mp.hasLocalProperties());
  mp.setOrientation(DesignChoiceConstants.PAGE_ORIENTATION_LANDSCAPE);
  assertTrue(mp.hasLocalProperties());
  List pages=new ArrayList();
  pages.add(mp);
  GroupElementHandle group=new SimpleGroupElementHandle(designHandle,pages);
  assertFalse(group.hasLocalPropertiesForExtendedElements());
}

Fixed version (ground truth):
/** 
 * @throws DesignFileException
 * @throws SemanticException
 */
public void test_142432() throws DesignFileException, SemanticException {
  openLibrary(libraryname);
  MasterPageHandle masterpage=libraryHandle.findMasterPage("String_Node_Str");
  openDesign(filename);
  designHandle.includeLibrary(libraryname,"String_Node_Str");
  MasterPageHandle mp=(MasterPageHandle)designHandle.getElementFactory().newElementFrom(masterpage,"String_Node_Str");
  designHandle.getMasterPages().add(mp);
  assertFalse(mp.hasLocalProperties());
  mp.setOrientation(DesignChoiceConstants.PAGE_ORIENTATION_LANDSCAPE);
  assertTrue(mp.hasLocalProperties());
  List pages=new ArrayList();
  pages.add(mp);
  GroupElementHandle group=new SimpleGroupElementHandle(designHandle,pages);
  assertTrue(group.hasLocalPropertiesForExtendedElements());
}
Program: 77448
Project: 77448
Buggy source:
private List doQueryCascadeParameterSelectionList(String paramName,IViewerReportDesignHandle design,String groupName,Object[] groupKeys,InputOptions options,ViewerAttributeBean attrBean) throws RemoteException, ReportServiceException {
  List selectionList=new ArrayList();
  Collection list=getReportService().getSelectionListForCascadingGroup(design,groupName,groupKeys,options);
  if (list != null && list.size() > 0) {
    ScalarParameterHandle parameterHandle=(ScalarParameterHandle)attrBean.findParameter(paramName);
    Iterator iList=list.iterator();
    int index=0;
    while (iList != null && iList.hasNext()) {
      ParameterSelectionChoice item=(ParameterSelectionChoice)iList.next();
      if (item != null && item.getValue() != null) {
        SelectItemChoice selectItemChoice=new SelectItemChoice();
        Object value=item.getValue();
        String label=item.getLabel();
        if (value == null)         continue;
        if (label == null || label.length() <= 0) {
          label=ParameterValidationUtil.getDisplayValue(null,parameterHandle.getPattern(),value,attrBean.getLocale());
        }
        if (label != null) {
          selectItemChoice.setLabel(label);
          selectItemChoice.setValue(ParameterValidationUtil.getDisplayValue(value));
          selectionList.add(index++,selectItemChoice);
        }
      }
    }
  }
  return selectionList;
}

Fixed version (ground truth):
private List doQueryCascadeParameterSelectionList(String paramName,IViewerReportDesignHandle design,String groupName,Object[] groupKeys,InputOptions options,ViewerAttributeBean attrBean) throws RemoteException, ReportServiceException {
  List selectionList=new ArrayList();
  Collection list=getReportService().getSelectionListForCascadingGroup(design,groupName,groupKeys,options);
  if (list != null && list.size() > 0) {
    ScalarParameterHandle parameterHandle=(ScalarParameterHandle)attrBean.findParameter(paramName);
    Iterator iList=list.iterator();
    int index=0;
    while (iList != null && iList.hasNext()) {
      ParameterSelectionChoice item=(ParameterSelectionChoice)iList.next();
      if (item != null && item.getValue() != null) {
        SelectItemChoice selectItemChoice=new SelectItemChoice();
        Object value=item.getValue();
        String label=item.getLabel();
        if (value == null)         continue;
        if (label == null || label.length() <= 0) {
          label=ParameterValidationUtil.getDisplayValue(null,parameterHandle.getPattern(),value,attrBean.getLocale());
        }
 else {
          label=ParameterValidationUtil.getDisplayValue(null,parameterHandle.getPattern(),label,attrBean.getLocale());
        }
        if (label != null) {
          selectItemChoice.setLabel(label);
          selectItemChoice.setValue(ParameterValidationUtil.getDisplayValue(value));
          selectionList.add(index++,selectItemChoice);
        }
      }
    }
  }
  return selectionList;
}
Program: 77449
Project: 77449
Buggy source:
public boolean onBroughtToTop(IReportEditorPage page){
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage page){
  GraphicalViewer view=getGraphicalViewer();
  if (view != null) {
    UIUtil.resetViewSelection(view,true);
  }
  return true;
}
Program: 77450
Project: 77450
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  boolean isDisplay=false;
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (isDirtyModel()) {
    doSave(null);
  }
  if (prePage.isDirty()) {
    prePage.doSave(null);
  }
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          editor.setActivePage(prePage.getId());
          return false;
        }
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  boolean isDisplay=false;
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (isDirtyModel()) {
    doSave(null);
  }
  if (prePage.isDirty()) {
    prePage.doSave(null);
  }
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          editor.setActivePage(prePage.getId());
          return false;
        }
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  ReportRequest request=new ReportRequest(ReportPreviewFormPage.this);
  List list=new ArrayList();
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  return true;
}
Program: 77451
Project: 77451
Buggy source:
public void deactivate(){
  if (!isActive())   return;
  removeGuideFeedBack();
  super.deactivate();
  HandleAdapterFactory.getInstance().remove(getModel());
}

Fixed version (ground truth):
public void deactivate(){
  if (!isActive())   return;
  removeGuideFeedBack();
  super.deactivate();
  if (isDelete()) {
    HandleAdapterFactory.getInstance().remove(getModel());
  }
}
Program: 77453
Project: 77453
Buggy source:
/** 
 * Adapts a Model data type (string) to Data Engine data type constant (integer)
 */
public static int adaptModelDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  return DataType.UNKNOWN_TYPE;
}

Fixed version (ground truth):
/** 
 * Adapts a Model data type (string) to Data Engine data type constant (integer) on column
 */
public static int adaptModelDataType(String modelDataType){
  if (modelDataType == null)   return DataType.UNKNOWN_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY))   return DataType.ANY_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER))   return DataType.INTEGER_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING))   return DataType.STRING_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME))   return DataType.DATE_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL))   return DataType.DECIMAL_TYPE;
  if (modelDataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT))   return DataType.DOUBLE_TYPE;
  return DataType.UNKNOWN_TYPE;
}
Program: 77454
Project: 77454
Buggy source:
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  setType(ModelAdapter.adaptModelDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  setDefaultInputValue(modelParam.getDefaultValue());
}

Fixed version (ground truth):
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  setType(ModelAdapter.adaptModelParamDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  setDefaultInputValue(modelParam.getDefaultValue());
}
Program: 77455
Project: 77455
Buggy source:
/** 
 * Creates a new DtE API IParameterDefinition from a model's DataSetParameterHandle.
 */
IParameterDefinition newParam(DataSetParameterHandle modelParam){
  ParameterDefinition dteParam=new ParameterDefinition();
  dteParam.setName(modelParam.getName());
  if (modelParam.getPosition() != null)   dteParam.setPosition(modelParam.getPosition().intValue());
  dteParam.setType(toDteDataType(modelParam.getDataType()));
  dteParam.setInputMode(modelParam.isInput());
  dteParam.setOutputMode(modelParam.isOutput());
  dteParam.setNullable(modelParam.allowNull());
  dteParam.setInputOptional(modelParam.isOptional());
  dteParam.setDefaultInputValue(modelParam.getDefaultValue());
  return dteParam;
}

Fixed version (ground truth):
/** 
 * Creates a new DtE API IParameterDefinition from a model's DataSetParameterHandle.
 */
IParameterDefinition newParam(DataSetParameterHandle modelParam){
  ParameterDefinition dteParam=new ParameterDefinition();
  dteParam.setName(modelParam.getName());
  if (modelParam.getPosition() != null)   dteParam.setPosition(modelParam.getPosition().intValue());
  dteParam.setType(adaptModelParamDataType(modelParam.getDataType()));
  dteParam.setInputMode(modelParam.isInput());
  dteParam.setOutputMode(modelParam.isOutput());
  dteParam.setNullable(modelParam.allowNull());
  dteParam.setInputOptional(modelParam.isOptional());
  dteParam.setDefaultInputValue(modelParam.getDefaultValue());
  return dteParam;
}
Program: 77458
Project: 77458
Buggy source:
protected boolean isHidden(){
  if (content != null) {
    IStyle style=content.getComputedStyle();
    String formats=style.getVisibleFormat();
    String format=context.getFormat();
    if (CSSConstants.CSS_NONE_VALUE.equalsIgnoreCase(style.getDisplay()) || (formats != null && formats.length() > 0 && (formats.indexOf(format) >= 0 || formats.indexOf(BIRTConstants.BIRT_ALL_VALUE.toUpperCase()) >= 0))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean isHidden(){
  if (content != null) {
    IStyle style=content.getComputedStyle();
    String formats=style.getVisibleFormat();
    String format=context.getFormat();
    if (CSSConstants.CSS_NONE_VALUE.equalsIgnoreCase(style.getDisplay()) || (formats != null && formats.length() > 0 && (formats.indexOf(format) >= 0 || formats.toUpperCase().indexOf(BIRTConstants.BIRT_ALL_VALUE.toUpperCase()) >= 0))) {
      return true;
    }
  }
  return false;
}
Program: 77461
Project: 77461
Buggy source:
/** 
 * Inserts a copied column to the given column index.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return a list containing post-parsing errors. Each element in the listis <code>ErrorDetail</code>.
 * @throws SemanticException if layouts of slots are different.
 */
protected List insertColumnBand(int columnIndex,int insertFlag) throws SemanticException {
  boolean canDone=canInsert(columnIndex,insertFlag);
  if (!canDone)   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_INSERT_FORBIDDEN);
  TableColumn column=new TableColumn();
  adapter.getModule().getActivityStack().startTrans();
  try {
    pasteColumn(column,targetColumnIndex,true);
    insertCells(targetColumnIndex);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
/** 
 * Inserts a copied column to the given column index.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return a list containing post-parsing errors. Each element in the listis <code>ErrorDetail</code>.
 * @throws SemanticException if layouts of slots are different.
 */
protected List insertColumnBand(int columnIndex,int insertFlag) throws SemanticException {
  boolean canDone=canInsert(columnIndex,insertFlag);
  if (!canDone)   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_INSERT_FORBIDDEN);
  TableColumn column=new TableColumn();
  adapter.getModule().getActivityStack().startSilentTrans();
  try {
    pasteColumn(column,targetColumnIndex,true);
    insertCells(targetColumnIndex);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
  return Collections.EMPTY_LIST;
}
Program: 77462
Project: 77462
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(int columnIndex,int insertFlag){
  int columnCount=adapter.getColumnCount();
  targetColumnIndex=columnIndex;
  if (insertFlag == INSERT_BEFORE)   targetColumnIndex=targetColumnIndex - 1;
  if (targetColumnIndex > columnCount)   targetColumnIndex=columnCount;
  if (targetColumnIndex >= columnCount || targetColumnIndex < 1) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex,false));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param insertFlag The column insert sign. 1 insert after position. -1 insert before position
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(int columnIndex,int insertFlag){
  if (adapter.hasParent())   return false;
  int columnCount=adapter.getColumnCount();
  targetColumnIndex=columnIndex;
  if (insertFlag == INSERT_BEFORE)   targetColumnIndex=targetColumnIndex - 1;
  if (targetColumnIndex > columnCount)   targetColumnIndex=columnCount;
  if (targetColumnIndex >= columnCount || targetColumnIndex < 1) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex,false));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  return true;
}
Program: 77463
Project: 77463
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param data the copied column band data
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(int columnIndex,ColumnBandData data){
  int columnCount=adapter.getColumnCount();
  int targetColumnIndex=columnIndex + 1;
  List originalCells=null;
  if (targetColumnIndex > columnCount) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  List cells=data.getCells();
  try {
    isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param data the copied column band data
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(int columnIndex,ColumnBandData data){
  if (adapter.hasParent())   return false;
  int columnCount=adapter.getColumnCount();
  int targetColumnIndex=columnIndex + 1;
  List originalCells=null;
  if (targetColumnIndex > columnCount) {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(1));
  }
 else {
    originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(targetColumnIndex));
    if (!isValidInsertAndPasteArea(originalCells))     return false;
  }
  List cells=data.getCells();
  try {
    isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}
Program: 77464
Project: 77464
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @param data the copied column band data
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canPaste(int columnIndex,boolean inForce,ColumnBandData data){
  List cells=data.getCells();
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(columnIndex));
  if (!isRectangleArea(originalCells,1))   return false;
  boolean isSameLayout=false;
  try {
    isSameLayout=isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  if (!inForce && !isSameLayout)   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param columnIndex the column index
 * @param inForce <code>true</code> indicates to paste the column regardless of the different layout of cells. <code>false</code> indicates not.
 * @param data the copied column band data
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canPaste(int columnIndex,boolean inForce,ColumnBandData data){
  if (adapter.hasParent())   return false;
  List cells=data.getCells();
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(columnIndex));
  if (!isRectangleArea(originalCells,1))   return false;
  boolean isSameLayout=false;
  try {
    isSameLayout=isSameLayout(cells,originalCells);
  }
 catch (  SemanticException e) {
    return false;
  }
  if (!inForce && !isSameLayout)   return false;
  return true;
}
Program: 77465
Project: 77465
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param sourceColumn the source column to shift
 * @param destColumn the target column to shift
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean checkTargetColumn(int sourceColumn,int destColumn){
  int newPosn=adjustDestPosn(sourceColumn,destColumn);
  if (newPosn == -1)   return true;
  int columnCount=adapter.getColumnCount();
  if (newPosn == 0 || newPosn == columnCount)   return true;
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(newPosn));
  if (!isRectangleArea(originalCells,1))   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param sourceColumn the source column to shift
 * @param destColumn the target column to shift
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean checkTargetColumn(int sourceColumn,int destColumn){
  if (adapter.hasParent())   return false;
  int newPosn=adjustDestPosn(sourceColumn,destColumn);
  if (newPosn == -1)   return true;
  int columnCount=adapter.getColumnCount();
  if (newPosn == 0 || newPosn == columnCount)   return true;
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(newPosn));
  if (!isRectangleArea(originalCells,1))   return false;
  return true;
}
Program: 77466
Project: 77466
Buggy source:
/** 
 * Checks whether the insert operation can be done with the given slot id , group id , index and the operation flag.
 * @param copiedRow source copied table row
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the insert operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(RowOperationParameters parameters){
  int destIndex=parameters.getDestIndex();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex > slotHandle.getCount())   return false;
  if (destIndex == 0)   return true;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex - 1);
  if (!containsRowSpan(destHandle) && isRectangleArea(destHandle))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the insert operation can be done with the given slot id , group id , index and the operation flag.
 * @param copiedRow source copied table row
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the insert operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsert(RowOperationParameters parameters){
  if (adapter.hasParent())   return false;
  int destIndex=parameters.getDestIndex();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex > slotHandle.getCount())   return false;
  if (destIndex == 0)   return true;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex - 1);
  if (!containsRowSpan(destHandle) && isRectangleArea(destHandle))   return true;
  return false;
}
Program: 77467
Project: 77467
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param clonedRow the copied table row.
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(TableRow clonedRow,RowOperationParameters parameters){
  int destIndex=parameters.getDestIndex();
  int desColumnCount=adapter.getColumnCount();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex >= slotHandle.getCount())   return false;
  int count=adapter.computeRowCount(clonedRow);
  if (count != desColumnCount)   return false;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  if (isRectangleArea(destHandle) && !containsRowSpan(destHandle))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param clonedRow the copied table row.
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canInsertAndPaste(TableRow clonedRow,RowOperationParameters parameters){
  if (adapter.hasParent())   return false;
  int destIndex=parameters.getDestIndex();
  int desColumnCount=adapter.getColumnCount();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex >= slotHandle.getCount())   return false;
  int count=adapter.computeRowCount(clonedRow);
  if (count != desColumnCount)   return false;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  if (isRectangleArea(destHandle) && !containsRowSpan(destHandle))   return true;
  return false;
}
Program: 77468
Project: 77468
Buggy source:
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param clonedRow the copied table row.
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canPaste(TableRow clonedRow,RowOperationParameters parameters){
  int destIndex=parameters.getDestIndex();
  int desColumnCount=adapter.getColumnCount();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex >= slotHandle.getCount())   return false;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  int count=adapter.computeRowCount(clonedRow);
  if ((count == desColumnCount) && isRectangleArea(destHandle) && !containsRowSpan(destHandle))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the paste operation can be done with the given copied column band data, the column index and the operation flag.
 * @param clonedRow the copied table row.
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the paste operation can be done.Otherwise <code>false</code>.
 */
protected boolean canPaste(TableRow clonedRow,RowOperationParameters parameters){
  if (adapter.hasParent())   return false;
  int destIndex=parameters.getDestIndex();
  int desColumnCount=adapter.getColumnCount();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (destIndex < 0 || destIndex >= slotHandle.getCount())   return false;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  int count=adapter.computeRowCount(clonedRow);
  if ((count == desColumnCount) && isRectangleArea(destHandle) && !containsRowSpan(destHandle))   return true;
  return false;
}
Program: 77469
Project: 77469
Buggy source:
/** 
 * Checks whether the shift operation can be done with the given parameters
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the shift operation can be done.Otherwise <code>false</code>.
 */
protected boolean canShift(RowOperationParameters parameters){
  int destIndex=parameters.getDestIndex();
  int sourceIndex=parameters.getSourceIndex();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (sourceIndex < 0 || sourceIndex >= slotHandle.getCount())   return false;
  if (destIndex < 0 || destIndex > slotHandle.getCount())   return false;
  if (sourceIndex == destIndex)   return false;
  RowHandle sourceHandle=(RowHandle)slotHandle.get(sourceIndex);
  if (destIndex > 0)   --destIndex;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  if (isRectangleArea(sourceHandle) && isRectangleArea(destHandle) && !containsRowSpan(sourceHandle)&& !containsRowSpan(destHandle)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the shift operation can be done with the given parameters
 * @param parameters parameters needed by insert operation.
 * @return <code>true</code> indicates the shift operation can be done.Otherwise <code>false</code>.
 */
protected boolean canShift(RowOperationParameters parameters){
  if (adapter.hasParent())   return false;
  int destIndex=parameters.getDestIndex();
  int sourceIndex=parameters.getSourceIndex();
  SlotHandle slotHandle=getSlotHandle(parameters);
  if (slotHandle == null)   return false;
  if (sourceIndex < 0 || sourceIndex >= slotHandle.getCount())   return false;
  if (destIndex < 0 || destIndex > slotHandle.getCount())   return false;
  if (sourceIndex == destIndex)   return false;
  RowHandle sourceHandle=(RowHandle)slotHandle.get(sourceIndex);
  if (destIndex > 0)   --destIndex;
  RowHandle destHandle=(RowHandle)slotHandle.get(destIndex);
  if (isRectangleArea(sourceHandle) && isRectangleArea(destHandle) && !containsRowSpan(sourceHandle)&& !containsRowSpan(destHandle)) {
    return true;
  }
  return false;
}
Program: 77470
Project: 77470
Buggy source:
protected void contentChange(Map info){
  int intValue=((Integer)info.get(GraphicsViewModelEventProcessor.CONTENT_EVENTTYPE)).intValue();
  if (intValue == ContentEvent.REMOVE) {
    List list=(List)info.get(GraphicsViewModelEventProcessor.EVENT_CONTENTS);
    int size=list.size();
    for (int i=0; i < size; i++) {
      Object obj=list.get(i);
      if (obj instanceof DesignElementHandle) {
        getListHandleAdapt().remove(obj);
      }
    }
  }
  super.contentChange(info);
}

Fixed version (ground truth):
protected void contentChange(Map info){
  Object action=info.get(GraphicsViewModelEventProcessor.CONTENT_EVENTTYPE);
  if (action instanceof Integer) {
    int intValue=((Integer)action).intValue();
    if (intValue == ContentEvent.REMOVE) {
      List list=(List)info.get(GraphicsViewModelEventProcessor.EVENT_CONTENTS);
      int size=list.size();
      for (int i=0; i < size; i++) {
        Object obj=list.get(i);
        if (obj instanceof DesignElementHandle) {
          getListHandleAdapt().remove(obj);
        }
      }
    }
  }
  super.contentChange(info);
}
Program: 77473
Project: 77473
Buggy source:
protected void writeFields(DataOutputStream out) throws IOException {
  super.writeFields(out);
  if (rawType != null) {
    IOUtil.writeInt(out,FIELD_ROW_TYPE);
    IOUtil.writeString(out,rawType);
  }
  if (rawValue != null) {
    IOUtil.writeInt(out,FIELD_ROWVALUE);
    IOUtil.writeObject(out,rawValue);
  }
  if (altText != null) {
    IOUtil.writeInt(out,FIELD_ALTTEXT);
    IOUtil.writeString(out,altText);
  }
  if (altTextKey != null) {
    IOUtil.writeInt(out,FIELD_ALTTEXTKEY);
    IOUtil.writeString(out,altTextKey);
  }
}

Fixed version (ground truth):
protected void writeFields(DataOutputStream out) throws IOException {
  super.writeFields(out);
  if (rawType != null) {
    IOUtil.writeInt(out,FIELD_ROW_TYPE);
    IOUtil.writeString(out,rawType);
  }
  if (rawValue != null) {
    IOUtil.writeInt(out,FIELD_ROWVALUE);
    IOUtil.writeObject(out,rawValue);
  }
  if (altText != null) {
    IOUtil.writeInt(out,FIELD_ALTTEXT);
    IOUtil.writeString(out,altText);
  }
  if (altTextKey != null) {
    IOUtil.writeInt(out,FIELD_ALTTEXTKEY);
    IOUtil.writeString(out,altTextKey);
  }
  if (rawKey != null) {
    IOUtil.writeInt(out,FIELD_RAWKEY);
    IOUtil.writeString(out,rawKey);
  }
}
Program: 77474
Project: 77474
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_ROW_TYPE:
    rawType=IOUtil.readString(in);
  break;
case FIELD_ROWVALUE:
rawValue=IOUtil.readObject(in);
break;
case FIELD_ALTTEXT:
altText=IOUtil.readString(in);
break;
case FIELD_ALTTEXTKEY:
altTextKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_ROW_TYPE:
    rawType=IOUtil.readString(in);
  break;
case FIELD_ROWVALUE:
rawValue=IOUtil.readObject(in);
break;
case FIELD_ALTTEXT:
altText=IOUtil.readString(in);
break;
case FIELD_ALTTEXTKEY:
altTextKey=IOUtil.readString(in);
break;
case FIELD_RAWKEY:
rawKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in);
}
}
Program: 77477
Project: 77477
Buggy source:
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type) || DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
  previewLable.setText(formatStr);
}

Fixed version (ground truth):
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_INTEGER_NUMBER);
  }
  previewLable.setText(formatStr);
}
Program: 77482
Project: 77482
Buggy source:
/** 
 * @param p the scalar parameter
 * @param expr the default value expression
 */
protected Object stringToObject(int type,String value) throws BirtException {
  if (value == null) {
    return null;
  }
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
    return DataTypeUtil.toBoolean(value);
case IScalarParameterDefn.TYPE_DATE_TIME:
  return DataTypeUtil.toDate(value);
case IScalarParameterDefn.TYPE_DECIMAL:
return DataTypeUtil.toBigDecimal(value);
case IScalarParameterDefn.TYPE_FLOAT:
return DataTypeUtil.toDouble(value);
case IScalarParameterDefn.TYPE_STRING:
return DataTypeUtil.toString(value);
}
return null;
}

Fixed version (ground truth):
/** 
 * @param p the scalar parameter
 * @param expr the default value expression
 */
protected Object stringToObject(int type,String value) throws BirtException {
  if (value == null) {
    return null;
  }
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
    return DataTypeUtil.toBoolean(value);
case IScalarParameterDefn.TYPE_DATE_TIME:
  return DataTypeUtil.toDate(value);
case IScalarParameterDefn.TYPE_DECIMAL:
return DataTypeUtil.toBigDecimal(value);
case IScalarParameterDefn.TYPE_FLOAT:
return DataTypeUtil.toDouble(value);
case IScalarParameterDefn.TYPE_STRING:
return DataTypeUtil.toString(value);
case IScalarParameterDefn.TYPE_INTEGER:
return DataTypeUtil.toInteger(value);
}
return null;
}
Program: 77483
Project: 77483
Buggy source:
/** 
 * set parameter choice value. The string value is in English locale, and needs to be parsed back into object value based on the data type. 
 * @param value the string value for the object
 * @param type the parameter data type
 */
public void setValue(String value,int type){
  try {
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
      this.value=DataTypeUtil.toBoolean(value);
    break;
case IScalarParameterDefn.TYPE_DATE_TIME:
  this.value=DataTypeUtil.toDate(value);
break;
case IScalarParameterDefn.TYPE_DECIMAL:
this.value=DataTypeUtil.toBigDecimal(value);
break;
case IScalarParameterDefn.TYPE_FLOAT:
this.value=DataTypeUtil.toDouble(value);
break;
case IScalarParameterDefn.TYPE_STRING:
default :
this.value=DataTypeUtil.toString(value);
break;
}
}
 catch (BirtException e) {
log.log(Level.SEVERE,e.getLocalizedMessage(),e);
this.value=null;
}
}

Fixed version (ground truth):
/** 
 * set parameter choice value. The string value is in English locale, and needs to be parsed back into object value based on the data type. 
 * @param value the string value for the object
 * @param type the parameter data type
 */
public void setValue(String value,int type){
  try {
switch (type) {
case IScalarParameterDefn.TYPE_BOOLEAN:
      this.value=DataTypeUtil.toBoolean(value);
    break;
case IScalarParameterDefn.TYPE_DATE_TIME:
  this.value=DataTypeUtil.toDate(value);
break;
case IScalarParameterDefn.TYPE_DECIMAL:
this.value=DataTypeUtil.toBigDecimal(value);
break;
case IScalarParameterDefn.TYPE_FLOAT:
this.value=DataTypeUtil.toDouble(value);
break;
case IScalarParameterDefn.TYPE_INTEGER:
this.value=DataTypeUtil.toInteger(value);
break;
case IScalarParameterDefn.TYPE_STRING:
default :
this.value=DataTypeUtil.toString(value);
break;
}
}
 catch (BirtException e) {
log.log(Level.SEVERE,e.getLocalizedMessage(),e);
this.value=null;
}
}
Program: 77485
Project: 77485
Buggy source:
/** 
 * Parameter typer convertion.
 * @param type
 * @return
 */
public static final int getEngineDataType(String type){
  if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
    return IScalarParameterDefn.TYPE_BOOLEAN;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    return IScalarParameterDefn.TYPE_DATE_TIME;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
    return IScalarParameterDefn.TYPE_DECIMAL;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    return IScalarParameterDefn.TYPE_FLOAT;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    return IScalarParameterDefn.TYPE_STRING;
  }
  return IScalarParameterDefn.TYPE_ANY;
}

Fixed version (ground truth):
/** 
 * Parameter typer convertion.
 * @param type
 * @return
 */
public static final int getEngineDataType(String type){
  if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type)) {
    return IScalarParameterDefn.TYPE_BOOLEAN;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    return IScalarParameterDefn.TYPE_DATE_TIME;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type)) {
    return IScalarParameterDefn.TYPE_DECIMAL;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    return IScalarParameterDefn.TYPE_FLOAT;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    return IScalarParameterDefn.TYPE_STRING;
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    return IScalarParameterDefn.TYPE_INTEGER;
  }
  return IScalarParameterDefn.TYPE_ANY;
}
Program: 77487
Project: 77487
Buggy source:
/** 
 * Constructor
 */
public HTMLTextParser(){
  try {
    Properties props=new Properties();
    props.load(getClass().getResourceAsStream("String_Node_Str"));
    tidy.setConfigurationFromProps(props);
    supportAllTags=true;
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public HTMLTextParser(){
  tidy.setConfigurationFromProps(props);
  supportAllTags=true;
}
Program: 77488
Project: 77488
Buggy source:
protected void initializeGraphicalViewer(){
  super.initializeGraphicalViewer();
  GraphicalViewer viewer=getGraphicalViewer();
  if (getModel() != null) {
    getGraphicalViewer().setContents(getModel());
    hookModelEventManager(getModel());
  }
  viewer.addDropTargetListener(createTemplateTransferDropTargetListener(viewer));
}

Fixed version (ground truth):
protected void initializeGraphicalViewer(){
  super.initializeGraphicalViewer();
  GraphicalViewer viewer=getGraphicalViewer();
  if (getModel() != null) {
    setContents();
    hookModelEventManager(getModel());
  }
  viewer.addDropTargetListener(createTemplateTransferDropTargetListener(viewer));
}
Program: 77489
Project: 77489
Buggy source:
/** 
 * @see org.eclipse.gef.ui.parts.GraphicalEditor#initializeGraphicalViewer()
 */
protected void initializeGraphicalViewer(){
  super.initializeGraphicalViewer();
  setViewContentsAsMasterPage();
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.gef.ui.parts.GraphicalEditor#initializeGraphicalViewer()
 */
protected void initializeGraphicalViewer(){
  super.initializeGraphicalViewer();
}
Program: 77490
Project: 77490
Buggy source:
protected boolean hasNextRow() throws DataException {
  this.odiResult.last(lowestGroupLevel);
  return odiResult.next();
}

Fixed version (ground truth):
protected boolean hasNextRow() throws DataException {
  this.odiResult.last(lowestGroupLevel);
  boolean result=odiResult.next();
  if (result)   cachedStartingGroupLevel=odiResult.getStartingGroupLevel();
  return result;
}
Program: 77491
Project: 77491
Buggy source:
/** 
 * @param context
 * @param queryResults
 * @param queryResultID
 * @param useDetails
 * @param lowestGroupLevel
 * @throws DataException
 */
ResultIterator2(IServiceForResultSet rService,org.eclipse.birt.data.engine.odi.IResultIterator odiResult,Scriptable scope) throws DataException {
  super(rService,odiResult,scope);
  this.lowestGroupLevel=rService.getQueryDefn().getGroups().size();
  this.currRowIndex=-1;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResults
 * @param queryResultID
 * @param useDetails
 * @param lowestGroupLevel
 * @throws DataException
 */
ResultIterator2(IServiceForResultSet rService,org.eclipse.birt.data.engine.odi.IResultIterator odiResult,Scriptable scope) throws DataException {
  super(rService,odiResult,scope);
  this.lowestGroupLevel=rService.getQueryDefn().getGroups().size();
  this.currRowIndex=-1;
  this.cachedStartingGroupLevel=0;
}
Program: 77492
Project: 77492
Buggy source:
public boolean next() throws DataException {
  if (this.exprResultSet.getCurrentIndex() >= 0)   exprResultSet.skipToEnd(lowestGroupLevel);
  boolean hasNext=super.next();
  if (hasNext)   currRowIndex++;
  return hasNext;
}

Fixed version (ground truth):
public boolean next() throws DataException {
  if (this.exprResultSet.getCurrentIndex() >= 0)   exprResultSet.skipToEnd(lowestGroupLevel);
  boolean hasNext=super.next();
  if (hasNext) {
    currRowIndex++;
    cachedStartingGroupLevel=exprResultSet.getStartingGroupLevel();
  }
  return hasNext;
}
Program: 77493
Project: 77493
Buggy source:
/** 
 * @param context
 * @param queryResults
 * @param queryResultID
 * @param lowestGroupLevel
 * @throws DataException
 */
ResultIterator2(DataEngineContext context,IQueryResults queryResults,String queryResultID,int lowestGroupLevel) throws DataException {
  super(context,queryResults,queryResultID);
  this.lowestGroupLevel=lowestGroupLevel;
  this.currRowIndex=-1;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResults
 * @param queryResultID
 * @param lowestGroupLevel
 * @throws DataException
 */
ResultIterator2(DataEngineContext context,IQueryResults queryResults,String queryResultID,int lowestGroupLevel) throws DataException {
  super(context,queryResults,queryResultID);
  this.lowestGroupLevel=lowestGroupLevel;
  this.currRowIndex=-1;
  this.cachedStartingGroupLevel=0;
}
Program: 77494
Project: 77494
Buggy source:
public void testAddDataSet() throws Exception {
  openDesign(filename);
  JointDataSetHandle jointds=designHandle.findJointDataSet("String_Node_Str");
  jointds.addDataSet("String_Node_Str");
  jointds.addDataSet("String_Node_Str");
  assertEquals(2,jointds.getListProperty(JointDataSet.DATA_SETS_PROP).size());
  jointds.removeDataSet("String_Node_Str");
  assertEquals(1,jointds.getListProperty(JointDataSet.DATA_SETS_PROP).size());
}

Fixed version (ground truth):
public void testAddDataSet() throws Exception {
  openDesign(filename);
  JointDataSetHandle jointds=designHandle.findJointDataSet("String_Node_Str");
  jointds.addDataSet("String_Node_Str");
  assertEquals(3,jointds.getListProperty(JointDataSet.DATA_SETS_PROP).size());
  jointds.removeDataSet("String_Node_Str");
  assertEquals(2,jointds.getListProperty(JointDataSet.DATA_SETS_PROP).size());
}