nus-yam/ex-repair huggingface dataset:
Program: 78432
Project: 78432
Buggy source:
/** 
 * Updates values of <code>sourceHandle</code> with the given <code>sourceDesign</code>.
 * @param sourceDesign the ODA data source design
 * @param sourceHandle the Model handle
 * @throws SemanticException if any of <code>sourceDesign</code> property values is not valid.
 */
public void updateDataSourceHandle(DataSourceDesign sourceDesign,OdaDataSourceHandle sourceHandle) throws SemanticException {
  if (sourceDesign == null || sourceHandle == null)   return;
  DesignUtil.validateObject(sourceDesign);
  CommandStack stack=sourceHandle.getModuleHandle().getCommandStack();
  stack.startTrans(null);
  try {
    sourceHandle.getElement().setProperty(OdaDataSourceHandle.EXTENSION_ID_PROP,sourceDesign.getOdaExtensionId());
    sourceHandle.setName(sourceDesign.getName());
    sourceHandle.setDisplayName(sourceDesign.getDisplayName());
    List props=sourceDesign.getPublicProperties().getProperties();
    for (int i=0; i < props.size(); i++) {
      Property prop=(Property)props.get(i);
      sourceHandle.setProperty(prop.getName(),prop.getValue());
    }
    props=sourceDesign.getPrivateProperties().getProperties();
    for (int i=0; i < props.size(); i++) {
      Property prop=(Property)props.get(i);
      sourceHandle.setPrivateDriverProperty(prop.getName(),prop.getValue());
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}

Fixed version (ground truth):
/** 
 * Updates values of <code>sourceHandle</code> with the given <code>sourceDesign</code>.
 * @param sourceDesign the ODA data source design
 * @param sourceHandle the Model handle
 * @throws SemanticException if any of <code>sourceDesign</code> property values is not valid.
 */
public void updateDataSourceHandle(DataSourceDesign sourceDesign,OdaDataSourceHandle sourceHandle) throws SemanticException {
  if (sourceDesign == null || sourceHandle == null)   return;
  DesignUtil.validateObject(sourceDesign);
  CommandStack stack=sourceHandle.getModuleHandle().getCommandStack();
  stack.startTrans(null);
  try {
    sourceHandle.getElement().setProperty(OdaDataSourceHandle.EXTENSION_ID_PROP,sourceDesign.getOdaExtensionId());
    sourceHandle.setName(sourceDesign.getName());
    sourceHandle.setDisplayName(sourceDesign.getDisplayName());
    Properties props=sourceDesign.getPublicProperties();
    if (props != null) {
      EList propList=props.getProperties();
      for (int i=0; i < propList.size(); i++) {
        Property prop=(Property)propList.get(i);
        sourceHandle.setProperty(prop.getName(),prop.getValue());
      }
    }
    props=sourceDesign.getPrivateProperties();
    if (props != null) {
      EList propList=props.getProperties();
      for (int i=0; i < propList.size(); i++) {
        Property prop=(Property)propList.get(i);
        sourceHandle.setPrivateDriverProperty(prop.getName(),prop.getValue());
      }
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}
Program: 78437
Project: 78437
Buggy source:
public void clear(){
  mediatorMap.remove(getInstance().getReportDesignHandle());
  setReportDesignHandle(null);
  designHandleAdapter=null;
}

Fixed version (ground truth):
public void clear(ModuleHandle handle){
  mediatorMap.remove(handle);
  if (handle == getReportDesignHandle()) {
    setReportDesignHandle(null);
    designHandleAdapter=null;
  }
}
Program: 78438
Project: 78438
Buggy source:
/** 
 * Sets report design.
 * @param handle the model
 */
public void setReportDesignHandle(ModuleHandle handle){
  if (designHandleAdapter != null) {
    designHandleAdapter.setReportDesignHandle(handle);
  }
}

Fixed version (ground truth):
/** 
 * Sets report design.
 * @param handle the model
 */
public void setReportDesignHandle(ModuleHandle handle){
  if (designHandleAdapter != null) {
    designHandleAdapter.setReportDesignHandle(handle);
  }
 else   if (handle != null) {
    designHandleAdapter=new ReportDesignHandleAdapter(handle);
  }
}
Program: 78439
Project: 78439
Buggy source:
public void partClosed(IWorkbenchPart part){
  SessionHandleAdapter.getInstance().clear();
}

Fixed version (ground truth):
public void partClosed(IWorkbenchPart part){
  if (part == this) {
    SessionHandleAdapter.getInstance().clear(getModel());
  }
}
Program: 78440
Project: 78440
Buggy source:
/** 
 * Test openEditor method invoke openEditor then check the active editor's ID and title to test if it works correctly
 */
public void testOpenEditor() throws Exception {
  if (PlatformUtil.isWindows()) {
    IEditorPart tPart=openEditor();
    assertTrue(tPart instanceof ReportEditor);
    assertEquals(tPart,tPage.getActiveEditor());
    assertEquals(EDITOR_ID,tPart.getSite().getId());
    assertEquals(EDITOR_NAME,tPart.getSite().getRegisteredName());
    assertEquals(TEST_DESIGN_FILE,tPart.getTitle());
    closeEditor();
  }
}

Fixed version (ground truth):
/** 
 * Test openEditor method invoke openEditor then check the active editor's ID and title to test if it works correctly
 */
public void testOpenEditor() throws Exception {
  if (PlatformUtil.isWindows()) {
    IEditorPart tPart=openEditor();
    assertTrue(tPart instanceof AbstractMultiPageEditor);
    assertEquals(tPart,tPage.getActiveEditor());
    assertEquals(EDITOR_ID,tPart.getSite().getId());
    assertEquals(EDITOR_NAME,tPart.getSite().getRegisteredName());
    assertEquals(TEST_DESIGN_FILE,tPart.getTitle());
    closeEditor();
  }
}
Program: 78442
Project: 78442
Buggy source:
public void earlyStartup(){
  WorkspaceClassPathFinder finder=new WorkspaceClassPathFinder();
  WorkspaceClasspathManager.registerClassPathFinder(finder);
  String projectClassPaths=finder.getClassPath();
  if (projectClassPaths == null) {
    projectClassPaths="String_Node_Str";
  }
  System.setProperty(WORKSPACE_CLASSPATH_KEY,projectClassPaths);
  String value=System.getProperty("String_Node_Str");
  if (value == null || value.length() == 0) {
    return;
  }
  StringTokenizer token=new StringTokenizer(value,"String_Node_Str");
  while (token.hasMoreTokens()) {
    String str=token.nextToken();
    try {
      DebugUtil.importProject(str);
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void earlyStartup(){
  WorkspaceClassPathFinder finder=new WorkspaceClassPathFinder();
  WorkspaceClasspathManager.registerClassPathFinder(finder);
  String projectClassPaths=finder.getClassPath();
  if (projectClassPaths == null) {
    projectClassPaths="String_Node_Str";
  }
  System.setProperty(WORKSPACE_CLASSPATH_KEY,projectClassPaths);
  String value=System.getProperty("String_Node_Str");
  if (value == null || value.length() == 0) {
    return;
  }
  StringTokenizer token=new StringTokenizer(value,"String_Node_Str");
  while (token.hasMoreTokens()) {
    String str=token.nextToken();
    try {
      DebugUtil.importProject(str);
    }
 catch (    Exception e1) {
    }
  }
}
Program: 78443
Project: 78443
Buggy source:
/** 
 * Gets the display name of the node
 * @param model the model of the node 
 * @return Returns the display name for the node
 */
public String getNodeDisplayName(Object model);

Fixed version (ground truth):
/** 
 * Gets the display name of the node
 * @param model the model of the node
 * @return Returns the display name for the node
 */
public String getNodeDisplayName(Object model);
Program: 78445
Project: 78445
Buggy source:
public void layout(IFigure parent){
  Rectangle parentBounds=getInitSize();
  Result result=getReportBounds(parentBounds);
  parentBounds=result.reportSize;
  parent.setBounds(parentBounds);
  List children=parent.getChildren();
  Rectangle clientArea=parent.getClientArea();
  int y=clientArea.y;
  int height=clientArea.height;
  IFigure figure;
  for (int i=0; i < children.size(); i++) {
    figure=(IFigure)children.get(i);
    Rectangle bounds=(Rectangle)getConstraint(figure);
    if (bounds == null) {
      continue;
    }
    bounds=convertRectangle(bounds,clientArea);
    figure.getBounds().width=bounds.width;
    Dimension preferredSize=figure.getPreferredSize();
    bounds=bounds.getCopy();
    if (bounds.height <= 0) {
      bounds.height=Math.max(preferredSize.height,MINIMUM_HEIGHT);
    }
 else     if (bounds.height < MINIMUM_HEIGHT) {
      bounds.height=MINIMUM_HEIGHT;
    }
    if (bounds.height > height) {
      bounds.height=height;
    }
    if (bounds.y + bounds.height > height + y || bounds.y < y) {
      bounds.y=height + y - bounds.height;
    }
    figure.setBounds(bounds);
  }
  Rectangle rect=new Rectangle(0,0,parentBounds.x + parentBounds.width + result.rightSpace,parentBounds.y + parentBounds.height + result.bottomSpace);
  setViewProperty(rect,parentBounds);
}

Fixed version (ground truth):
public void layout(IFigure parent){
  Rectangle parentBounds=getInitSize();
  Result result=getReportBounds(parentBounds);
  parentBounds=result.reportSize;
  parent.setBounds(parentBounds);
  List children=parent.getChildren();
  Rectangle clientArea=parent.getClientArea();
  int y=clientArea.y;
  int height=clientArea.height;
  IFigure figure;
  for (int i=0; i < children.size(); i++) {
    figure=(IFigure)children.get(i);
    Rectangle bounds=(Rectangle)getConstraint(figure);
    if (bounds == null) {
      continue;
    }
    bounds=convertRectangle(bounds,clientArea);
    figure.getBounds().width=bounds.width;
    Dimension preferredSize=figure.getPreferredSize();
    bounds=bounds.getCopy();
    if (bounds.height < 0) {
      bounds.height=Math.max(preferredSize.height,MINIMUM_HEIGHT);
    }
    if (bounds.height > height) {
      bounds.height=height;
    }
    if (bounds.y + bounds.height > height + y || bounds.y < y) {
      bounds.y=height + y - bounds.height;
    }
    figure.setBounds(bounds);
  }
  Rectangle rect=new Rectangle(0,0,parentBounds.x + parentBounds.width + result.rightSpace,parentBounds.y + parentBounds.height + result.bottomSpace);
  setViewProperty(rect,parentBounds);
}
Program: 78446
Project: 78446
Buggy source:
/** 
 * @return The constraint
 */
protected Object getConstraint(){
  ReportItemHandle handle=(ReportItemHandle)getModel();
  ReportItemConstraint constraint=new ReportItemConstraint();
  constraint.setDisplay(handle.getPrivateStyle().getDisplay());
  return constraint;
}

Fixed version (ground truth):
/** 
 * @return The constraint
 */
protected Object getConstraint(){
  ReportItemHandle handle=(ReportItemHandle)getModel();
  ReportItemConstraint constraint=new ReportItemConstraint();
  constraint.setDisplay(handle.getPrivateStyle().getDisplay());
  DimensionHandle value=handle.getWidth();
  constraint.setMeasure(value.getMeasure());
  constraint.setUnits(value.getUnits());
  return constraint;
}
Program: 78447
Project: 78447
Buggy source:
protected Dimension getChildSize(IFigure child,int wHint,int hHint){
  ReportItemConstraint constraint=(ReportItemConstraint)getConstraint(child);
  Dimension preferredDimension=child.getPreferredSize(wHint,hHint);
  if (constraint != null) {
    if (constraint.isNone()) {
      return new Dimension(0,0);
    }
    Dimension dimension=constraint.getSize();
    if (dimension.height <= 0)     dimension.height=preferredDimension.height;
    if (dimension.width <= 0)     dimension.width=preferredDimension.width;
    return dimension;
  }
 else {
    return preferredDimension;
  }
}

Fixed version (ground truth):
protected Dimension getChildSize(IFigure child,int wHint,int hHint){
  ReportItemConstraint constraint=(ReportItemConstraint)getConstraint(child);
  Dimension preferredDimension=child.getPreferredSize(wHint,hHint);
  if (constraint != null) {
    if (constraint.isNone()) {
      return new Dimension(0,0);
    }
    Dimension dimension=constraint.getSize();
    if (dimension.height <= 0) {
      dimension.height=preferredDimension.height;
    }
    if (dimension.width <= 0) {
      if (constraint.getMeasure() != 0 && DesignChoiceConstants.UNITS_PERCENTAGE.equals(constraint.getUnits())) {
        dimension.width=(int)constraint.getMeasure() * wHint / 100;
      }
 else {
        dimension.width=preferredDimension.width;
      }
    }
    return dimension;
  }
 else {
    return preferredDimension;
  }
}
Program: 78449
Project: 78449
Buggy source:
public void startLabel(ILabelContent label){
  startText(label);
}

Fixed version (ground truth):
public void startLabel(ILabelContent label){
  String bookmark=label.getBookmark();
  if (bookmark == null) {
    bookmark=generateUniqueID();
    label.setBookmark(bookmark);
  }
  startText(label);
}
Program: 78450
Project: 78450
Buggy source:
private Image getImage(){
  TableEditPart part=(TableEditPart)getOwner();
  String type=HandleAdapterFactory.getInstance().getRowHandleAdapter(part.getRow(getRowNumber())).getType();
  if (TableHandleAdapter.TABLE_HEADER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_HEADER;
  }
 else   if (TableHandleAdapter.TABLE_DETAIL.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_DETAILS;
  }
 else   if (TableHandleAdapter.TABLE_FOOTER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_FOOTER;
  }
 else   if (TableHandleAdapter.TABLE_GROUP_HEADER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_GROUP_HEADER;
  }
 else   if (TableHandleAdapter.TABLE_GROUP_FOOTER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_GROUP_FOOTER;
  }
 else {
    return null;
  }
  return ReportPlatformUIImages.getImage(type);
}

Fixed version (ground truth):
private Image getImage(){
  TableEditPart part=(TableEditPart)getOwner();
  if (part.getRow(getRowNumber()) == null) {
    return null;
  }
  String type=HandleAdapterFactory.getInstance().getRowHandleAdapter(part.getRow(getRowNumber())).getType();
  if (TableHandleAdapter.TABLE_HEADER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_HEADER;
  }
 else   if (TableHandleAdapter.TABLE_DETAIL.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_DETAILS;
  }
 else   if (TableHandleAdapter.TABLE_FOOTER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_FOOTER;
  }
 else   if (TableHandleAdapter.TABLE_GROUP_HEADER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_GROUP_HEADER;
  }
 else   if (TableHandleAdapter.TABLE_GROUP_FOOTER.equals(type)) {
    type=IReportGraphicConstants.ICON_NODE_GROUP_FOOTER;
  }
 else {
    return null;
  }
  return ReportPlatformUIImages.getImage(type);
}
Program: 78451
Project: 78451
Buggy source:
/** 
 * Gets list edit parts.
 * @return The current selected list edit parts, null if no list edit partis selected.
 */
protected List getListEditParts(){
  List listParts=new ArrayList();
  for (Iterator iter=getSelectedObjects().iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof ListEditPart) {
      if (!(listParts.contains(obj))) {
        listParts.add(obj);
      }
    }
 else     if (obj instanceof ListBandEditPart) {
      Object parent=(ListEditPart)((ListBandEditPart)obj).getParent();
      if (!(listParts.contains(parent))) {
        listParts.add(parent);
      }
    }
 else {
      return Collections.EMPTY_LIST;
    }
  }
  return listParts;
}

Fixed version (ground truth):
/** 
 * Gets list edit parts.
 * @return The current selected list edit parts, null if no list edit partis selected.
 */
protected List getListEditParts(){
  List listParts=new ArrayList();
  for (Iterator iter=getSelectedObjects().iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof ListEditPart) {
      if (!(listParts.contains(obj))) {
        listParts.add(obj);
      }
    }
 else     if (obj instanceof ListBandEditPart) {
      ListEditPart parent2=(ListEditPart)((ListBandEditPart)obj).getParent();
      Object parent=parent2;
      if (!(listParts.contains(parent))) {
        listParts.add(parent);
      }
    }
 else {
      return Collections.EMPTY_LIST;
    }
  }
  return listParts;
}
Program: 78452
Project: 78452
Buggy source:
private boolean isMutilSelection(Object multiSelection){
  return multiSelection != null && (multiSelection == Object.class || multiSelection == DesignElementHandle.class || isRootElementHandleClass(multiSelection) || multiSelection == ReportItemHandle.class || multiSelection == ListHandle.class);
}

Fixed version (ground truth):
private boolean isMutilSelection(Object multiSelection){
  return multiSelection != null && (multiSelection == Object.class || multiSelection == DesignElementHandle.class || isRootElementHandleClass(multiSelection) || multiSelection == ReportItemHandle.class);
}
Program: 78453
Project: 78453
Buggy source:
/** 
 * Gets table edit part.
 * @return The current selected table edit part, null if no table edit partis selected.
 */
protected List getTableEditParts(){
  List tableParts=new ArrayList();
  for (Iterator itor=getSelectedObjects().iterator(); itor.hasNext(); ) {
    Object obj=itor.next();
    if (obj instanceof DummyEditpart) {
    }
 else     if (obj instanceof TableEditPart) {
      if (obj instanceof GridEditPart) {
        return Collections.EMPTY_LIST;
      }
      if (!(tableParts.contains(obj))) {
        tableParts.add(obj);
      }
    }
 else     if (obj instanceof TableCellEditPart) {
      Object parent=(TableEditPart)((TableCellEditPart)obj).getParent();
      if (parent instanceof GridEditPart) {
        return Collections.EMPTY_LIST;
      }
      if (!(tableParts.contains(parent))) {
        tableParts.add(parent);
      }
    }
 else {
      return Collections.EMPTY_LIST;
    }
  }
  return tableParts;
}

Fixed version (ground truth):
/** 
 * Gets table edit part.
 * @return The current selected table edit part, null if no table edit partis selected.
 */
protected List getTableEditParts(){
  List tableParts=new ArrayList();
  for (Iterator itor=getSelectedObjects().iterator(); itor.hasNext(); ) {
    Object obj=itor.next();
    if (obj instanceof DummyEditpart) {
    }
 else     if (obj instanceof TableEditPart) {
      if (obj instanceof GridEditPart) {
        return Collections.EMPTY_LIST;
      }
      if (!(tableParts.contains(obj))) {
        tableParts.add(obj);
      }
    }
 else     if (obj instanceof TableCellEditPart) {
      TableEditPart parent2=(TableEditPart)((TableCellEditPart)obj).getParent();
      Object parent=parent2;
      if (parent instanceof GridEditPart) {
        return Collections.EMPTY_LIST;
      }
      if (!(tableParts.contains(parent))) {
        tableParts.add(parent);
      }
    }
 else {
      return Collections.EMPTY_LIST;
    }
  }
  return tableParts;
}
Program: 78454
Project: 78454
Buggy source:
private boolean performRevertToTemplateItem(DesignElementHandle handle){
  try {
    handle.revertToTemplate("String_Node_Str");
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean performRevertToTemplateItem(DesignElementHandle handle){
  try {
    handle.revertToTemplate("String_Node_Str");
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return false;
  }
  return true;
}
Program: 78455
Project: 78455
Buggy source:
private boolean performTransferPlaceHolder(TemplateElementHandle handle){
  DesignElementHandle copiedHandle=handle.getDefaultElement().copy().getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle().getModule());
  try {
    ((TemplateReportItemHandle)handle).transformToReportItem((ReportItemHandle)copiedHandle);
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean performTransferPlaceHolder(TemplateElementHandle handle){
  DesignElementHandle copiedHandle=handle.getDefaultElement().copy().getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle().getModule());
  try {
    ((TemplateReportItemHandle)handle).transformToReportItem((ReportItemHandle)copiedHandle);
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return false;
  }
  return true;
}
Program: 78456
Project: 78456
Buggy source:
private boolean performRevertToReportItem(DesignElementHandle handle){
  try {
    handle.revertToReportItem();
  }
 catch (  SemanticException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean performRevertToReportItem(DesignElementHandle handle){
  try {
    handle.revertToReportItem();
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return false;
  }
  return true;
}
Program: 78457
Project: 78457
Buggy source:
/** 
 * Creates actions and registers them to the ActionRegistry.
 */
protected void createActions(){
  addStackAction(new UndoAction(this));
  addStackAction(new RedoAction(this));
  addEditPartAction(new DeleteAction((IWorkbenchPart)this){
    public Command createDeleteCommand(    List objects){
      if (objects.isEmpty())       return null;
      if (!(objects.get(0) instanceof EditPart))       return null;
      GroupRequest deleteReq=new GroupRequest(RequestConstants.REQ_DELETE);
      deleteReq.setEditParts(objects);
      List list=new ArrayList();
      for (int i=0; i < objects.size(); i++) {
        EditPart object=(EditPart)objects.get(i);
        list.add(object.getModel());
      }
      return new DeleteCommand(list.toArray());
    }
  }
);
  SaveAction saveAction=new SaveAction(this);
  saveAction.setLazyEnablementCalculation(true);
  addEditorAction(saveAction);
  addAction(new CopyTemplateAction(this));
}

Fixed version (ground truth):
/** 
 * Creates actions and registers them to the ActionRegistry.
 */
protected void createActions(){
  addStackAction(new UndoAction(this));
  addStackAction(new RedoAction(this));
  addEditPartAction(new DeleteAction((IWorkbenchPart)this){
    public Command createDeleteCommand(    List objects){
      if (objects.isEmpty())       return null;
      if (!(objects.get(0) instanceof EditPart))       return null;
      GroupRequest deleteReq=new GroupRequest(RequestConstants.REQ_DELETE);
      deleteReq.setEditParts(objects);
      List temp=TableUtil.filletCellModel(objects);
      List list=new ArrayList();
      for (int i=0; i < temp.size(); i++) {
        EditPart object=(EditPart)temp.get(i);
        list.add(object.getModel());
      }
      return new DeleteCommand(list.toArray());
    }
  }
);
  SaveAction saveAction=new SaveAction(this);
  saveAction.setLazyEnablementCalculation(true);
  addEditorAction(saveAction);
  addAction(new CopyTemplateAction(this));
}
Program: 78458
Project: 78458
Buggy source:
public Command createDeleteCommand(List objects){
  if (objects.isEmpty())   return null;
  if (!(objects.get(0) instanceof EditPart))   return null;
  GroupRequest deleteReq=new GroupRequest(RequestConstants.REQ_DELETE);
  deleteReq.setEditParts(objects);
  List list=new ArrayList();
  for (int i=0; i < objects.size(); i++) {
    EditPart object=(EditPart)objects.get(i);
    list.add(object.getModel());
  }
  return new DeleteCommand(list.toArray());
}

Fixed version (ground truth):
public Command createDeleteCommand(List objects){
  if (objects.isEmpty())   return null;
  if (!(objects.get(0) instanceof EditPart))   return null;
  GroupRequest deleteReq=new GroupRequest(RequestConstants.REQ_DELETE);
  deleteReq.setEditParts(objects);
  List temp=TableUtil.filletCellModel(objects);
  List list=new ArrayList();
  for (int i=0; i < temp.size(); i++) {
    EditPart object=(EditPart)temp.get(i);
    list.add(object.getModel());
  }
  return new DeleteCommand(list.toArray());
}
Program: 78459
Project: 78459
Buggy source:
/** 
 * @param list
 * @return
 */
public static ISelection filletCellInSelectionEditorpart(ISelection selection){
  if (selection == null || !(selection instanceof IStructuredSelection))   return new StructuredSelection(Collections.EMPTY_LIST);
  List list=((IStructuredSelection)selection).toList();
  ArrayList retValue=new ArrayList(list);
  boolean hasRowOrColumn=false;
  int size=list.size();
  for (int i=0; i < size; i++) {
    Object obj=list.get(i);
    if (obj instanceof TableEditPart.DummyColumnEditPart || obj instanceof TableEditPart.DummyRowEditPart) {
      hasRowOrColumn=true;
      break;
    }
  }
  if (hasRowOrColumn) {
    for (int i=0; i < size; i++) {
      Object obj=list.get(i);
      if (obj instanceof TableCellEditPart) {
        retValue.remove(obj);
      }
    }
  }
  return new StructuredSelection(retValue);
}

Fixed version (ground truth):
/** 
 * @param list
 * @return
 */
public static ISelection filletCellInSelectionEditorpart(ISelection selection){
  if (selection == null || !(selection instanceof IStructuredSelection))   return new StructuredSelection(Collections.EMPTY_LIST);
  List list=((IStructuredSelection)selection).toList();
  List retValue=filletCellModel(list);
  return new StructuredSelection(retValue);
}
Program: 78460
Project: 78460
Buggy source:
public List getChildren(){
  List list=new ArrayList();
  list.add(currentEditorModel);
  return list;
}

Fixed version (ground truth):
public List getChildren(){
  List list=new ArrayList();
  list.add(getTopContainer(getCurrentEditorModel()));
  return list;
}
Program: 78461
Project: 78461
Buggy source:
/** 
 * @param currentEditorModel The currentEditorModel to set.
 */
public void setCurrentEditorModel(Object current){
  Object old=this.currentEditorModel;
  if (current == null || current instanceof LibraryHandle) {
    this.currentEditorModel=new LibRootModel(current);
  }
 else {
    this.currentEditorModel=current;
  }
  if (currentEditorModel == old) {
    return;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,CURRENTMODEL,old,this.currentEditorModel);
  firePropertyChangeEvent(event);
}

Fixed version (ground truth):
/** 
 * @param currentEditorModel The currentEditorModel to set.
 */
public void setCurrentEditorModel(Object current){
  Object old=this.currentEditorModel;
  if (current == null || current instanceof LibraryHandle) {
    this.currentEditorModel=new LibRootModel(current);
  }
 else {
    this.currentEditorModel=current;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,CURRENTMODEL,old,this.currentEditorModel);
  firePropertyChangeEvent(event);
}
Program: 78462
Project: 78462
Buggy source:
public void elementChanged(DesignElementHandle arg0,NotificationEvent arg1){
  markDirty(true);
  refreshVisuals();
  if (arg1.getEventType() == NotificationEvent.PROPERTY_EVENT && ((PropertyEvent)arg1).getPropertyName().equals(StyleHandle.FONT_SIZE_PROP)) {
    getFigure().invalidateTree();
  }
}

Fixed version (ground truth):
public void elementChanged(DesignElementHandle arg0,NotificationEvent arg1){
  markDirty(true);
  refreshVisuals();
  if (arg1.getEventType() == NotificationEvent.PROPERTY_EVENT && ((PropertyEvent)arg1).getPropertyName().equals(StyleHandle.FONT_SIZE_PROP)) {
    ((LabelFigure)getFigure()).resetHeight();
    getFigure().invalidateTree();
  }
}
Program: 78464
Project: 78464
Buggy source:
/** 
 * Compare two objects
 * @param colObj1
 * @param colObj2
 * @return true colObj1 equals colObj2
 */
private int doCompare(Object colObj1,Object colObj2){
  int result=0;
  if (colObj1 == colObj2) {
    return result;
  }
  if (colObj1 == null || colObj2 == null) {
    if (colObj1 == null) {
      result=-1;
    }
 else {
      result=1;
    }
    return result;
  }
  if (colObj1.equals(colObj2)) {
    return result;
  }
 else   if (colObj1 instanceof Comparable && colObj2 instanceof Comparable) {
    Comparable comp1=(Comparable)colObj1;
    Comparable comp2=(Comparable)colObj2;
    result=comp1.compareTo(comp2);
  }
 else   if (colObj1 instanceof Boolean && colObj2 instanceof Boolean) {
    Boolean bool=(Boolean)colObj1;
    if (bool.equals(Boolean.TRUE))     result=1;
 else     result=-1;
  }
 else {
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Compare two objects
 * @param colObj1
 * @param colObj2
 * @return true colObj1 equals colObj2
 */
private int doCompare(Object colObj1,Object colObj2){
  int result=0;
  if (colObj1 == colObj2) {
    return result;
  }
  if (colObj1 == null || colObj2 == null) {
    if (colObj1 == null) {
      result=-1;
    }
 else {
      result=1;
    }
    return result;
  }
  if (colObj1.equals(colObj2)) {
    return result;
  }
 else   if (colObj1 instanceof Comparable && colObj2 instanceof Comparable) {
    Comparable comp1=(Comparable)colObj1;
    Comparable comp2=(Comparable)colObj2;
    if (colObj1.getClass() != colObj2.getClass() && colObj1 instanceof Number && colObj2 instanceof Number) {
      try {
        comp1=(Comparable)DataTypeUtil.toDouble(colObj1);
        comp2=(Comparable)DataTypeUtil.toDouble(colObj2);
      }
 catch (      BirtException ex) {
      }
    }
    result=comp1.compareTo(comp2);
  }
 else   if (colObj1 instanceof Boolean && colObj2 instanceof Boolean) {
    Boolean bool=(Boolean)colObj1;
    if (bool.equals(Boolean.TRUE))     result=1;
 else     result=-1;
  }
 else {
  }
  return result;
}
Program: 78465
Project: 78465
Buggy source:
/** 
 * Constructor Statement(java.sql.Connection connection) use JDBC's Connection to construct it.
 */
public Statement(java.sql.Connection connection) throws OdaException {
  if (connection != null) {
    this.preStat=null;
    this.conn=connection;
    maxrows=0;
  }
 else {
    throw new JDBCException(ResourceConstants.DRIVER_NO_CONNECTION,ResourceConstants.ERROR_NO_CONNECTION);
  }
}

Fixed version (ground truth):
/** 
 * Constructor Statement(java.sql.Connection connection) use JDBC's Connection to construct it.
 */
public Statement(java.sql.Connection connection) throws OdaException {
  if (connection != null) {
    this.preStat=null;
    this.conn=connection;
    maxrows=-1;
  }
 else {
    throw new JDBCException(ResourceConstants.DRIVER_NO_CONNECTION,ResourceConstants.ERROR_NO_CONNECTION);
  }
}
Program: 78466
Project: 78466
Buggy source:
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (!maxRowsUpToDate) {
      try {
        preStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    return new ResultSet(this.preStat.executeQuery());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}

Fixed version (ground truth):
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      try {
        preStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    return new ResultSet(this.preStat.executeQuery());
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}
Program: 78467
Project: 78467
Buggy source:
public void fatalError(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  sb.append(exception.getURI()).append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
}

Fixed version (ground truth):
public void fatalError(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  if (!StringUtil.isBlank(exception.getURI()))   sb.append(exception.getURI()).append("String_Node_Str");
  ;
  sb.append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
  fatalErrors.add(sb.toString());
}
Program: 78468
Project: 78468
Buggy source:
public void warning(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  sb.append(exception.getURI()).append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
}

Fixed version (ground truth):
public void warning(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  if (!StringUtil.isBlank(exception.getURI()))   sb.append(exception.getURI()).append("String_Node_Str");
  ;
  sb.append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
  warnings.add(sb.toString());
}
Program: 78469
Project: 78469
Buggy source:
public void error(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  sb.append(exception.getURI()).append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
}

Fixed version (ground truth):
public void error(CSSParseException exception) throws CSSException {
  StringBuffer sb=new StringBuffer();
  if (!StringUtil.isBlank(exception.getURI()))   sb.append(exception.getURI()).append("String_Node_Str");
  ;
  sb.append("String_Node_Str").append(exception.getLineNumber()).append("String_Node_Str").append(exception.getColumnNumber()).append("String_Node_Str").append(exception.getMessage());
  System.err.println(sb.toString());
  errors.add(sb.toString());
}
Program: 78470
Project: 78470
Buggy source:
/** 
 * Loads the styles from an external style sheet resource.
 * @param charStream character stream that shall not include a byte order mark
 * @return the <code>CssStyleSheet</code> containing all the styles loadedfrom an external style sheet, otherwise null
 * @throws StyleSheetException the style sheet resource has some syntax errors colliding with CSS2 grammar
 */
CssStyleSheet load(Reader charStream) throws StyleSheetException {
  StyleSheet ss=null;
  try {
    InputSource is=new InputSource(source);
    ss=(StyleSheet)parser.parseStyleSheet(is);
  }
 catch (  CSSException e) {
    logger.log(Level.SEVERE,e.getMessage());
    throw new StyleSheetException(StyleSheetException.DESIGN_EXCEPTION_SYNTAX_ERROR,e);
  }
catch (  IOException e) {
    throw new StyleSheetException(StyleSheetException.DESIGN_EXCEPTION_STYLE_SHEET_NOT_FOUND,e);
  }
 finally {
    try {
      source.close();
    }
 catch (    IOException e) {
    }
  }
  if (ss == null)   return null;
  CssStyleSheet styleSheet=new CssStyleSheet();
  List rules=ss.getRules();
  for (int i=0; i < rules.size(); i++) {
    CSSRule rule=(CSSRule)rules.get(i);
    loadStyle(styleSheet,rule);
  }
  styleSheet.addWarning(warnings);
  return styleSheet;
}

Fixed version (ground truth):
/** 
 * Loads the styles from an external style sheet resource.
 * @param charStream character stream that shall not include a byte order mark
 * @return the <code>CssStyleSheet</code> containing all the styles loadedfrom an external style sheet, otherwise null
 * @throws StyleSheetException the style sheet resource has some syntax errors colliding with CSS2 grammar
 */
CssStyleSheet load(Reader charStream) throws StyleSheetException {
  StyleSheet ss=null;
  try {
    InputSource is=new InputSource(source);
    ss=(StyleSheet)parser.parseStyleSheet(is);
  }
 catch (  CSSException e) {
    logger.log(Level.SEVERE,e.getMessage());
    throw new StyleSheetException(StyleSheetException.DESIGN_EXCEPTION_SYNTAX_ERROR,e);
  }
catch (  IOException e) {
    throw new StyleSheetException(StyleSheetException.DESIGN_EXCEPTION_STYLE_SHEET_NOT_FOUND,e);
  }
 finally {
    try {
      source.close();
    }
 catch (    IOException e) {
    }
  }
  if (ss == null)   return null;
  CssStyleSheet styleSheet=new CssStyleSheet();
  List rules=ss.getRules();
  for (int i=0; i < rules.size(); i++) {
    CSSRule rule=(CSSRule)rules.get(i);
    loadStyle(styleSheet,rule);
  }
  styleSheet.addWarning(warnings);
  styleSheet.setErrorHandler(parser.getErrorHandler());
  return styleSheet;
}
Program: 78471
Project: 78471
Buggy source:
boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  try {
    if (!maxRowsUpToDate) {
      preStat.setMaxRows(maxrows);
      maxRowsUpToDate=true;
    }
    return preStat.execute();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  try {
    if (maxrows >= 0 && !maxRowsUpToDate) {
      preStat.setMaxRows(maxrows);
      maxRowsUpToDate=true;
    }
    return preStat.execute();
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}
Program: 78473
Project: 78473
Buggy source:
/** 
 * To check whether the expressions are comparable. If so, they will be formatted to the comparable.For operands, only ExprTextAndValue is acceptable.
 * @param obj
 * @param operator
 * @param op1
 * @param op2
 * @return
 * @throws DataException
 */
private static Object[] isComparable(Object obj,int operator,ExprTextAndValue op1,ExprTextAndValue op2) throws DataException {
  if (isFormatNeeded(obj,operator,op1,op2))   return formatToComparable(obj,op1,op2);
  return null;
}

Fixed version (ground truth):
/** 
 * To check whether the expressions are comparable. If so, they will be formatted to the comparable.For operands, only ExprTextAndValue is acceptable.
 * @param obj
 * @param operator
 * @param op1
 * @param op2
 * @return
 * @throws DataException
 */
private static Object[] isComparable(Object obj,int operator,ExprTextAndValue op1,ExprTextAndValue op2) throws DataException {
  if (needFormat(obj,operator,op1,op2))   return formatToComparable(obj,op1,op2);
  return null;
}
Program: 78474
Project: 78474
Buggy source:
public String getNamedExpression(String name){
  UserPropertyDefnHandle propDefn=handle.getUserPropertyDefnHandle(name);
  if (propDefn == null || propDefn.getDefn() == null || propDefn.getDefn().getDefault() == null || propDefn.getType() != IPropertyType.EXPRESSION_TYPE)   return null;
  return propDefn.getDefn().getDefault().toString();
}

Fixed version (ground truth):
public String getNamedExpression(String name){
  UserPropertyDefnHandle propDefn=handle.getUserPropertyDefnHandle(name);
  Object userProp=getUserProperty(name);
  if (propDefn == null || userProp == null || propDefn.getType() != IPropertyType.EXPRESSION_TYPE)   return null;
  return userProp.toString();
}
Program: 78475
Project: 78475
Buggy source:
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    CSSEngine cssEngine=null;
    if (report != null) {
      cssEngine=report.getCSSEngine();
    }
    if (cssEngine != null) {
      cssEngine=new BIRTCSSEngine();
    }
    computedStyle=new ComputedStyle(this);
  }
  return computedStyle;
}

Fixed version (ground truth):
public IStyle getComputedStyle(){
  if (computedStyle == null) {
    CSSEngine cssEngine=null;
    if (report != null) {
      cssEngine=report.getCSSEngine();
    }
    if (cssEngine == null) {
      cssEngine=new BIRTCSSEngine();
    }
    computedStyle=new ComputedStyle(this);
  }
  return computedStyle;
}
Program: 78476
Project: 78476
Buggy source:
/** 
 * Gets a property value given its definition. This version does the property search as defined by the given derived component. That is, it gets the "effective" property value. The definition can be for a system or user-defined property. <p> The search won't search up the containment hierarchy. Meanwhile, it won't the inheritance hierarchy if the non-style property is not inheritable. <p> Part of: Property value system.
 * @param module the module
 * @param prop definition of the property to get
 * @return The property value, or null if no value is set.
 */
public Object getPropertyFromElement(Module module,ElementPropertyDefn prop){
  Object value=null;
  value=getPropertyFromSelf(module,prop);
  if (value != null)   return value;
  if (isInheritableProperty(prop) || prop.isStyleProperty()) {
    if (isVirtualElement()) {
      value=getPropertyFromVirtualParent(module,prop);
    }
 else {
      value=getPropertyFromParent(module,prop);
    }
    if (value != null)     return value;
  }
  if (prop.isStyleProperty()) {
    value=getPropertyFromSelfSelector(module,prop);
    if (value != null)     return value;
    value=getPropertyFromSlotSelector(module,prop);
    if (value != null)     return value;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets a property value given its definition. This version does the property search as defined by the given derived component. That is, it gets the "effective" property value. The definition can be for a system or user-defined property. <p> The search won't search up the containment hierarchy. Meanwhile, it won't the inheritance hierarchy if the non-style property is not inheritable. <p> Part of: Property value system.
 * @param module the module
 * @param prop definition of the property to get
 * @return The property value, or null if no value is set.
 */
public Object getPropertyFromElement(Module module,ElementPropertyDefn prop){
  Object value=null;
  value=getPropertyFromSelf(module,prop);
  if (value != null)   return value;
  if (isInheritableProperty(prop) || prop.isStyleProperty()) {
    value=getPropertyFromParent(module,prop);
    if (value != null)     return value;
  }
  if (prop.isStyleProperty()) {
    value=getPropertyFromSelfSelector(module,prop);
    if (value != null)     return value;
    value=getPropertyFromSlotSelector(module,prop);
    if (value != null)     return value;
  }
  return null;
}
Program: 78477
Project: 78477
Buggy source:
/** 
 * Returns the property value from this element's parent, or any ancestor. The value is only from local properties, or local style of its ancestor.
 * @param module module
 * @param prop definition of the property to get.
 * @return property value, or null if no value is set.
 */
protected Object getPropertyFromParent(Module module,ElementPropertyDefn prop){
}

Fixed version (ground truth):
/** 
 * Returns the property value from this element's parent, or its virtual parent. The value is only from local properties, or local style of its ancestor.
 * @param module module
 * @param prop definition of the property to get.
 * @return property value, or <code>null</code> if no value is set.
 */
protected Object getPropertyFromParent(Module module,ElementPropertyDefn prop){
}
Program: 78478
Project: 78478
Buggy source:
/** 
 * Gets the property value by the following rule: <li>if the value existed on self, return it.</li> <li>if the value existed on parent, return null, else check the element selector.</li> <li>if the value existed on the self selector, return it.</li>
 * @param module module
 * @param prop definition of the property to get
 * @return The property value, or null if no value is set.
 */
private Object getFactoryPropertyFromElement(Module module,ElementPropertyDefn prop){
}

Fixed version (ground truth):
/** 
 * Gets the property value by the following rule: <li>if the value existed on self, return it.</li> <li>if the value existed on parent, return null, else check the element selector.</li> <li>if the value existed on the self selector, return it.</li>
 * @param module module
 * @param prop definition of the property to get
 * @return The property value, or null if no value is set.
 */
private Object getFactoryPropertyFromElement(Module module,ElementPropertyDefn prop){
  Object value=null;
  value=getPropertyFromSelf(module,prop);
  if (value != null)   return value;
  if (isInheritableProperty(prop) || prop.isStyleProperty()) {
    value=getPropertyFromParent(module,prop);
    if (value != null)     return value;
  }
  if (prop.isStyleProperty()) {
    value=getPropertyFromSelfSelector(module,prop);
    if (value != null)     return value;
    value=getPropertyFromSlotSelector(module,prop);
    if (value != null)     return value;
  }
  return null;
}
Program: 78479
Project: 78479
Buggy source:
/** 
 * Loads the extensions in plug-ins, and add them into metadata dictionary.
 * @throws MetaDataParserException if error is found when loading extension.
 */
public void load() throws MetaDataParserException {
  try {
    doLoad();
  }
 catch (  ExtensionException e) {
    logger.log(Level.SEVERE,e.getMessage());
    MetaLogManager.log("String_Node_Str",e);
    throw new MetaDataParserException(e,MetaDataParserException.DESIGN_EXCEPTION_EXTENSION_ERROR);
  }
catch (  MetaDataException e) {
    logger.log(Level.SEVERE,e.getMessage());
    MetaLogManager.log("String_Node_Str",e);
    throw new MetaDataParserException(e,MetaDataParserException.DESIGN_EXCEPTION_EXTENSION_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Loads the extensions in plug-ins, and add them into metadata dictionary.
 * @throws MetaDataParserException if error is found when loading extension.
 */
public void load() throws MetaDataParserException {
  try {
    doLoad();
  }
 catch (  ExtensionException e) {
    logExtenstionException(e);
    throw new MetaDataParserException(e,MetaDataParserException.DESIGN_EXCEPTION_EXTENSION_ERROR);
  }
catch (  MetaDataException e) {
    logger.log(Level.SEVERE,e.getMessage());
    MetaLogManager.log("String_Node_Str",e);
    throw new MetaDataParserException(e,MetaDataParserException.DESIGN_EXCEPTION_EXTENSION_ERROR);
  }
}
Program: 78480
Project: 78480
Buggy source:
protected void setRowType(String tagName,Object value){
  if (tagName != null && value != null) {
    if (value instanceof RowDesign) {
      RowDesign row=(RowDesign)value;
      int bandType=row.getBandType();
      if (bandType == TableBandDesign.TABLE_HEADER) {
        writer.attribute(tagName,"String_Node_Str");
      }
 else       if (bandType == TableBandDesign.TABLE_FOOTER) {
        writer.attribute(tagName,"String_Node_Str");
      }
 else       if (bandType == TableBandDesign.GROUP_HEADER) {
        writer.attribute(tagName,"String_Node_Str" + row.getGroupLevel());
      }
 else       if (bandType == TableBandDesign.GROUP_FOOTER) {
        writer.attribute(tagName,"String_Node_Str" + row.getGroupLevel());
      }
    }
  }
}

Fixed version (ground truth):
protected void setRowType(String tagName,IRowContent rowContent){
  if (tagName != null && rowContent != null) {
    if (rowContent instanceof RowContent) {
      RowContent rCont=(RowContent)rowContent;
      int bandType=rCont.getRowType();
      if (bandType == TableBandDesign.TABLE_HEADER) {
        writer.attribute(tagName,"String_Node_Str");
      }
 else       if (bandType == TableBandDesign.TABLE_FOOTER) {
        writer.attribute(tagName,"String_Node_Str");
      }
 else       if (bandType == TableBandDesign.GROUP_HEADER) {
        writer.attribute(tagName,"String_Node_Str" + rCont.getGroupLevel());
      }
 else       if (bandType == TableBandDesign.GROUP_FOOTER) {
        writer.attribute(tagName,"String_Node_Str" + rCont.getGroupLevel());
      }
    }
  }
}
Program: 78481
Project: 78481
Buggy source:
protected void writeFields(DataOutputStream out) throws IOException {
  super.writeFields(out);
  if (rowID != -1) {
    IOUtil.writeInt(out,FIELD_ROWID);
    IOUtil.writeInt(out,rowID);
  }
}

Fixed version (ground truth):
protected void writeFields(DataOutputStream out) throws IOException {
  super.writeFields(out);
  if (rowID != -1) {
    IOUtil.writeInt(out,FIELD_ROWID);
    IOUtil.writeInt(out,rowID);
    IOUtil.writeInt(out,FIELD_ROWTYPE);
    IOUtil.writeInt(out,rowType);
    IOUtil.writeInt(out,FIELD_ROW_GROUPLEVEL);
    IOUtil.writeInt(out,groupLevel);
  }
}
Program: 78482
Project: 78482
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_ROWID:
    rowID=IOUtil.readInt(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_ROWID:
    rowID=IOUtil.readInt(in);
  break;
case FIELD_ROWTYPE:
rowType=IOUtil.readInt(in);
break;
case FIELD_ROW_GROUPLEVEL:
groupLevel=IOUtil.readInt(in);
break;
default :
super.readField(version,filedId,in);
}
}