nus-yam/ex-repair huggingface dataset:
Program: 65162
Project: 65162
Buggy source:
private void resetCubeReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    CubeHandle cubeHandle=null;
    if (value != null) {
      cubeHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().findCube(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setDataSet(null);
    getReportItemHandle().setCube(cubeHandle);
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}

Fixed version (ground truth):
private void resetCubeReference(Object value,boolean clearHistory){
  try {
    startTrans("String_Node_Str");
    CubeHandle cubeHandle=null;
    if (value != null) {
      cubeHandle=SessionHandleAdapter.getInstance().getReportDesignHandle().findCube(value.toString());
    }
    if (getReportItemHandle().getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      getReportItemHandle().setDataBindingReference(null);
    }
    getReportItemHandle().setDataSet(null);
    if (cubeHandle == null && value != null) {
      getReportItemHandle().setDataSet(null);
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),value);
    }
 else {
      new LinkedDataSetAdapter().setLinkedDataModel(getReportItemHandle(),null);
      getReportItemHandle().setCube(cubeHandle);
    }
    getReportItemHandle().setCube(cubeHandle);
    if (clearHistory) {
      getReportItemHandle().getColumnBindings().clearValue();
      getReportItemHandle().getPropertyHandle(ReportItemHandle.PARAM_BINDINGS_PROP).clearValue();
    }
    commit();
  }
 catch (  SemanticException e) {
    rollback();
    ExceptionHandler.handle(e);
  }
  section.load();
}
Program: 65163
Project: 65163
Buggy source:
public String[] getAvailableDatasetItems(){
  String[] dataSets=ChoiceSetFactory.getDataSets();
  String[] cubes=getCubes();
  int length=1;
  if (dataSets.length > 0)   length+=(dataSets.length + 1);
  if (cubes.length > 0)   length+=(cubes.length + 1);
  String[] newList=new String[length];
  newList[0]=NONE;
  if (dataSets.length > 0) {
    newList[1]=DATA_SETS_DEFAULT;
    System.arraycopy(dataSets,0,newList,2,dataSets.length);
  }
  if (cubes.length > 0) {
    newList[newList.length - cubes.length - 1]=DATA_CUBES_DEFAULT;
    System.arraycopy(cubes,0,newList,newList.length - cubes.length,cubes.length);
  }
  return newList;
}

Fixed version (ground truth):
public BindingInfo[] getAvailableDatasetItems(){
  ModuleHandle handle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  List<DataSetHandle> dataSets=UIUtil.getVisibleDataSetHandles(handle);
  List<CubeHandle> cubes=handle.getVisibleCubes();
  int length=1;
  if (dataSets.size() > 0)   length+=(dataSets.size() + 1);
  if (cubes.size() > 0)   length+=(cubes.size() + 1);
  BindingInfo[] newList=new BindingInfo[length];
  newList[0]=NullDatasetChoice;
  if (dataSets.size() > 0) {
    newList[1]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,DATA_SETS_DEFAULT,true);
    for (int i=0; i < dataSets.size(); i++) {
      DataSetHandle dataSet=dataSets.get(i);
      if (handle.findDataSet(dataSet.getQualifiedName()) == dataSet) {
        newList[i + 2]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,dataSet.getQualifiedName(),true);
      }
 else {
        newList[i + 2]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,dataSet.getQualifiedName(),false);
      }
    }
  }
  if (cubes.size() > 0) {
    newList[newList.length - cubes.size() - 1]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,DATA_CUBES_DEFAULT,true);
    ;
    for (int i=0; i < cubes.size(); i++) {
      CubeHandle cube=cubes.get(i);
      newList[i + newList.length - cubes.size()]=new BindingInfo(ReportItemHandle.DATABINDING_TYPE_DATA,cube.getQualifiedName(),true);
    }
  }
  return newList;
}
Program: 65164
Project: 65164
Buggy source:
public int getSubQueryStartingIndex() throws DataException {
  if (!subQueryOnGroup)   return this.parentIterator.getCurrentResultIndex();
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}

Fixed version (ground truth):
public int getSubQueryStartingIndex() throws DataException {
  if (!subQueryOnGroup)   return this.parentIterator.getCurrentResultIndex();
  if (parentIterator instanceof EmptyResultIterator)   return 0;
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}
Program: 65166
Project: 65166
Buggy source:
protected void okPressed(){
  if (canSelect) {
    setResult(selectedColumnName);
    if (inputElement instanceof DataItemHandle) {
      try {
        ((DataItemHandle)inputElement).setResultSetColumn(selectedColumnName);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (ExtendedDataModelUIAdapterHelper.isBoundToExtendedData(inputElement)) {
    IStatus status=DataModelAdapterUtil.validateRelativeTimePeriod(inputElement,getSelectColumnHandle());
    if (status.getSeverity() == IStatus.ERROR) {
      MessageDialog.openError(UIUtil.getDefaultShell(),null,status.getMessage());
      return;
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  if (canSelect) {
    setResult(selectedColumnName);
    if (inputElement instanceof DataItemHandle) {
      try {
        ((DataItemHandle)inputElement).setResultSetColumn(selectedColumnName);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (ExtendedDataModelUIAdapterHelper.isBoundToExtendedData(inputElement)) {
    DataModelAdapterStatus status=DataModelAdapterUtil.validateRelativeTimePeriod(inputElement,getSelectColumnHandle());
    if (status.getStatus() == DataModelAdapterStatus.Status.FAIL) {
      MessageDialog.openError(UIUtil.getDefaultShell(),null,status.getMessage());
      return;
    }
  }
  super.okPressed();
}
Program: 65167
Project: 65167
Buggy source:
public static IStatus validateRelativeTimePeriod(ReportItemHandle reportItemHandle,ComputedColumnHandle computedColumnHandle){
  return new Status(IStatus.OK,Activator.PLUGIN_ID,"String_Node_Str");
}

Fixed version (ground truth):
public static DataModelAdapterStatus validateRelativeTimePeriod(ReportItemHandle reportItemHandle,ComputedColumnHandle computedColumnHandle){
  return new DataModelAdapterStatus(DataModelAdapterStatus.Status.SUCCESS,"String_Node_Str");
}
Program: 65168
Project: 65168
Buggy source:
/** 
 * uses to clear the data cach.
 * @param dataSet the dataset handle
 * @throws BirtException
 */
public void clearCache(DataSetHandle dataSet) throws BirtException {
  DataSessionContext context;
  DataRequestSession requestSession=null;
  try {
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle(),null);
    requestSession=DataRequestSession.newSession(context);
    IModelAdapter modelAdaptor=requestSession.getModelAdaptor();
    DataSourceHandle dataSource=dataSet.getDataSource();
    IBaseDataSourceDesign sourceDesign=modelAdaptor.adaptDataSource(dataSource);
    IBaseDataSetDesign dataSetDesign=modelAdaptor.adaptDataSet(dataSet);
    requestSession.clearCache(sourceDesign,dataSetDesign);
  }
 catch (  Exception e) {
    ExceptionUtil.handle(e);
  }
 finally {
    if (requestSession != null) {
      requestSession.shutdown();
    }
  }
}

Fixed version (ground truth):
/** 
 * uses to clear the data cach.
 * @param dataSet the dataset handle
 * @throws BirtException
 */
public void clearCache(DataSetHandle dataSet) throws BirtException {
  DataSessionContext context;
  DataRequestSession requestSession=null;
  try {
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,dataSet.getModuleHandle(),null);
    requestSession=DataRequestSession.newSession(context);
    IModelAdapter modelAdaptor=requestSession.getModelAdaptor();
    DataSourceHandle dataSource=dataSet.getDataSource();
    IBaseDataSourceDesign sourceDesign=modelAdaptor.adaptDataSource(dataSource);
    IBaseDataSetDesign dataSetDesign=modelAdaptor.adaptDataSet(dataSet);
    requestSession.clearCache(sourceDesign,dataSetDesign);
  }
  finally {
    if (requestSession != null) {
      requestSession.shutdown();
    }
  }
}
Program: 65169
Project: 65169
Buggy source:
/** 
 * Creates a DataEngine context in the provided mode, using the provided top level scope. Also sets the handle of the report design being executed. 
 * @param mode Data Session mode. Can be MODE_GENERATION, MODE_PRESENTATION or MODE_DIRECT_PRESENTATION
 * @param moduleHandle If not null, this report module is used to look up data setand data source definition when executing queries.
 * @param scriptContext
 * @param classLoader
 * @throws AdapterException
 */
public DataSessionContext(int mode,ModuleHandle moduleHandle,ScriptContext scriptContext,ClassLoader classLoader) throws AdapterException {
  try {
    if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == MODE_DIRECT_PRESENTATION || mode == MODE_UPDATE))     throw new AdapterException(ResourceConstants.ADAPTER_INVALID_MODE,Integer.valueOf(mode));
    this.mode=mode;
    this.moduleHandle=moduleHandle;
    this.appClassLoader=classLoader;
    ScriptContext internalScriptContext=null;
    if (scriptContext == null) {
      internalScriptContext=new ScriptContext();
      scriptContext=internalScriptContext.newContext(this.getTopScope());
      DataEngineThreadLocal.getInstance().getCloseListener().add(new ScriptContextCloser(internalScriptContext));
    }
    this.sContext=scriptContext;
    this.topScope=((IDataScriptEngine)scriptContext.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSScope(scriptContext);
    this.hasExternalScope=topScope != null;
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getErrorCode(),e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a DataEngine context in the provided mode, using the provided top level scope. Also sets the handle of the report design being executed. 
 * @param mode Data Session mode. Can be MODE_GENERATION, MODE_PRESENTATION or MODE_DIRECT_PRESENTATION
 * @param moduleHandle If not null, this report module is used to look up data setand data source definition when executing queries.
 * @param scriptContext
 * @param classLoader
 * @throws AdapterException
 */
public DataSessionContext(int mode,ModuleHandle moduleHandle,ScriptContext scriptContext,ClassLoader classLoader) throws AdapterException {
  try {
    if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == MODE_DIRECT_PRESENTATION || mode == MODE_UPDATE))     throw new AdapterException(ResourceConstants.ADAPTER_INVALID_MODE,Integer.valueOf(mode));
    this.mode=mode;
    this.moduleHandle=moduleHandle;
    this.appClassLoader=classLoader;
    this.hasExternalScope=scriptContext != null;
    ScriptContext internalScriptContext=null;
    if (scriptContext == null) {
      internalScriptContext=new ScriptContext();
      scriptContext=internalScriptContext.newContext(this.getTopScope());
      DataEngineThreadLocal.getInstance().getCloseListener().add(new ScriptContextCloser(internalScriptContext));
    }
    this.sContext=scriptContext;
    this.topScope=((IDataScriptEngine)scriptContext.getScriptEngine(IDataScriptEngine.ENGINE_NAME)).getJSScope(scriptContext);
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getErrorCode(),e);
  }
}
Program: 65170
Project: 65170
Buggy source:
public Map getAllExtensionProperties(){
  return new HashMap();
}

Fixed version (ground truth):
public Map getAllExtensionProperties(){
  return properties;
}
Program: 65171
Project: 65171
Buggy source:
public String getExtensionProperty(String name){
  return null;
}

Fixed version (ground truth):
public String getExtensionProperty(String name){
  return properties.get(name);
}
Program: 65172
Project: 65172
Buggy source:
public void setExtensionProperty(String name,String value){
}

Fixed version (ground truth):
public void setExtensionProperty(String name,String value){
  properties.put(name,value);
}
Program: 65173
Project: 65173
Buggy source:
private void iterateOnRows(IContainerArea table){
  int internalRowCount=currentRow;
  currentRow=0;
  Iterator<IArea> iter=table.getChildren();
  while (iter.hasNext()) {
    IArea child=iter.next();
    if (child instanceof RowArea) {
      drawRow((RowArea)child);
      currentRow++;
    }
 else {
      currentX+=getX(table);
      currentY+=getY(table);
      updateRenderXY();
      iterateOnRows((TableGroupArea)child);
      currentX-=getX(table);
      currentY-=getY(table);
      updateRenderXY();
      currentRow=internalRowCount + 1;
    }
  }
}

Fixed version (ground truth):
private void iterateOnRows(IContainerArea table){
  int internalRowCount=currentRow;
  currentRow=0;
  Iterator<IArea> iter=table.getChildren();
  while (iter.hasNext()) {
    IArea child=iter.next();
    if (child instanceof RowArea) {
      drawRow((RowArea)child);
      currentRow++;
    }
 else {
      currentX+=getX(table);
      currentY+=getY(table);
      internalRowCount=currentRow;
      updateRenderXY();
      iterateOnRows((TableGroupArea)child);
      currentX-=getX(table);
      currentY-=getY(table);
      updateRenderXY();
      currentRow=internalRowCount + 1;
    }
  }
}
Program: 65174
Project: 65174
Buggy source:
private void writeColumnsWidth(TableArea tablearea){
  numOfColumns=tablearea.getColumnCount();
  int columnWidth=0;
  int cellwidth=0;
  writer.openTag("String_Node_Str");
  for (int i=0; i < numOfColumns; i++) {
    cellwidth=tablearea.getCellWidth(i,i + 1);
    if (cellwidth <= 0) {
      CellArea ca=((RowArea)tablearea.getChild(0)).getCell(i);
      if (ca != null) {
        cellwidth=ca.getWidth();
      }
    }
    if (cellwidth > 0) {
      columnWidth=PPTXUtil.convertToEnums(cellwidth);
    }
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",columnWidth);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeColumnsWidth(TableArea tablearea){
  numOfColumns=tablearea.getColumnCount();
  int columnWidth=0;
  int cellwidth=0;
  writer.openTag("String_Node_Str");
  int defaultwidth=tablearea.getWidth() / numOfColumns;
  for (int i=0; i < numOfColumns; i++) {
    cellwidth=tablearea.getCellWidth(i,i + 1);
    if (cellwidth <= 0) {
      cellwidth=defaultwidth;
    }
    columnWidth=PPTXUtil.convertToEnums(getScaledValue(cellwidth));
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",columnWidth);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
}
Program: 65175
Project: 65175
Buggy source:
protected void drawRow(RowArea row){
  if (row.getChildrenCount() == 0) {
    return;
  }
  currentX+=getX(row);
  currentY+=getY(row);
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
}

Fixed version (ground truth):
protected void drawRow(RowArea row){
  row.setRowID(currentRow);
  if (row.getChildrenCount() == 0) {
    return;
  }
  currentX+=getX(row);
  currentY+=getY(row);
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
}
Program: 65177
Project: 65177
Buggy source:
public static int pixelToEmu(int pixels,int dpi){
  if (dpi == 0) {
    dpi=96;
  }
  return pixels * (int)((float)914400 / dpi);
}

Fixed version (ground truth):
public static int pixelToEmu(int pixels,int dpi){
  if (dpi <= 0) {
    dpi=96;
  }
  return pixels * (int)((float)914400 / dpi);
}
Program: 65178
Project: 65178
Buggy source:
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
public void drawContainer(IContainerArea container){
  BoxStyle style=container.getBoxStyle();
  if ((null == style || style == BoxStyle.DEFAULT) && container.getHelpText() == null) {
    return;
  }
  Color bc=style.getBackgroundColor();
  BackgroundImageInfo bi=style.getBackgroundImage();
  int startX=currentX + getX(container);
  int startY=currentY + getY(container);
  int width=getWidth(container);
  int height=getHeight(container);
  if (bc != null) {
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
  }
  if (bi != null) {
    drawBackgroundImage(bi,startX,startY,width,height);
  }
  if (container.getHelpText() != null) {
    pageGraphic.showHelpText(container.getHelpText(),startX,startY,width,height);
  }
}

Fixed version (ground truth):
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
protected void drawContainer(IContainerArea container){
  BoxStyle style=container.getBoxStyle();
  if ((null == style || style == BoxStyle.DEFAULT) && container.getHelpText() == null) {
    return;
  }
  Color bc=style.getBackgroundColor();
  BackgroundImageInfo bi=style.getBackgroundImage();
  int startX=currentX + getX(container);
  int startY=currentY + getY(container);
  int width=getWidth(container);
  int height=getHeight(container);
  if (bc != null) {
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
  }
  if (bi != null) {
    drawBackgroundImage(bi,startX,startY,width,height);
  }
  if (container.getHelpText() != null) {
    pageGraphic.showHelpText(container.getHelpText(),startX,startY,width,height);
  }
}
Program: 65180
Project: 65180
Buggy source:
/** 
 * draw background image for the container
 * @param containerStyle the style of the container we draw background image for
 * @param imageUrl the url of background image 
 * @param startX the absolute horizontal position of the container
 * @param startY the absolute vertical position of the container
 * @param width container width
 * @param height container height
 */
public void drawBackgroundImage(BackgroundImageInfo bi,int startX,int startY,int width,int height){
  try {
    pageGraphic.drawBackgroundImage(startX,startY,width,height,bi.getWidth(),bi.getHeight(),bi.getRepeatedMode(),bi.getUrl(),bi.getImageData(),getScaledValue(bi.getXOffset()),getScaledValue(bi.getYOffset()));
  }
 catch (  Exception e) {
    log(e,Level.WARNING);
  }
}

Fixed version (ground truth):
/** 
 * draw background image for the container
 * @param containerStyle the style of the container we draw background image for
 * @param imageUrl the url of background image 
 * @param startX the absolute horizontal position of the container
 * @param startY the absolute vertical position of the container
 * @param width container width
 * @param height container height
 */
private void drawBackgroundImage(BackgroundImageInfo bi,int startX,int startY,int width,int height){
  try {
    pageGraphic.drawBackgroundImage(startX,startY,width,height,bi.getWidth(),bi.getHeight(),bi.getRepeatedMode(),bi.getUrl(),bi.getImageData(),getScaledValue(bi.getXOffset()),getScaledValue(bi.getYOffset()));
  }
 catch (  Exception e) {
    log(e,Level.WARNING);
  }
}
Program: 65181
Project: 65181
Buggy source:
public void drawTableBorder(TableArea table){
  TableBorder tb=new TableBorder(table.getX(),table.getY());
  traverseRows(tb,table,tb.tableX,tb.tableY);
  drawBorder(tb);
}

Fixed version (ground truth):
protected void drawTableBorder(TableArea table){
  TableBorder tb=new TableBorder(table.getX(),table.getY());
  traverseRows(tb,table,tb.tableX,tb.tableY);
  drawBorder(tb);
}
Program: 65182
Project: 65182
Buggy source:
private boolean containMember(Object[] levelkey,Object[] key){
  Object[] memberKeys=levelkey;
  for (  Object obj : key) {
    if (obj.toString().equals(memberKeys[0].toString())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean containMember(Object[] levelkey,Object[] key){
  Object[] memberKeys=levelkey;
  for (  Object obj : key) {
    try {
      if (ScriptEvalUtil.compare(obj,memberKeys[0]) == 0) {
        return true;
      }
    }
 catch (    DataException e) {
    }
  }
  return false;
}
Program: 65183
Project: 65183
Buggy source:
private void iterateOnRows(IContainerArea table){
  int internalRowCount=currentRow;
  currentRow=0;
  Iterator<IArea> iter=table.getChildren();
  while (iter.hasNext()) {
    IArea child=iter.next();
    if (child instanceof RowArea) {
      drawRow((RowArea)child);
      currentRow++;
    }
 else {
      currentX+=getX(table);
      currentY+=getY(table);
      internalRowCount=currentRow;
      updateRenderXY();
      iterateOnRows((TableGroupArea)child);
      currentX-=getX(table);
      currentY-=getY(table);
      updateRenderXY();
      currentRow=internalRowCount + 1;
    }
  }
}

Fixed version (ground truth):
private void iterateOnRows(IContainerArea table){
  int internalRowCount=currentRow;
  currentRow=0;
  Iterator<IArea> iter=table.getChildren();
  while (iter.hasNext()) {
    IContainerArea child=(IContainerArea)iter.next();
    if (child instanceof RowArea) {
      drawRow((RowArea)child);
      currentRow++;
    }
 else {
      currentX+=getX(child);
      currentY+=getY(child);
      internalRowCount=currentRow;
      updateRenderXY();
      iterateOnRows(child);
      currentX-=getX(child);
      currentY-=getY(child);
      updateRenderXY();
      currentRow=internalRowCount + 1;
    }
  }
}
Program: 65184
Project: 65184
Buggy source:
protected void drawRow(RowArea row){
  row.setRowID(currentRow);
  if (row.getChildrenCount() == 0) {
    return;
  }
  currentX+=getX(row);
  currentY+=getY(row);
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
}

Fixed version (ground truth):
protected void drawRow(RowArea row){
  row.setRowID(currentRow);
  if (row.getChildrenCount() == 0) {
    return;
  }
  currentX+=getX(row);
  currentY+=getY(row);
  updateRenderXY();
  BoxStyle style=row.getBoxStyle();
  if (style.getBackgroundColor() == null && style.getBackgroundImage() == null) {
    style=row.getParent().getBoxStyle();
  }
  rowStyleStack.push(style);
  startRow(row);
  Iterator<IArea> iter=row.getChildren();
  currentCol=0;
  fillEmptyMergeCells(0,0,0);
  while (iter.hasNext()) {
    IArea child=iter.next();
    drawCell((CellArea)child);
  }
  endRow();
  rowStyleStack.pop();
  currentX-=getX(row);
  currentY-=getY(row);
  updateRenderXY();
}
Program: 65185
Project: 65185
Buggy source:
void setHyperlink(HyperlinkDef link){
  if (link != null) {
    String hyperlink=link.getLink();
    if (hyperlink != null) {
      if (hyperlink.startsWith("String_Node_Str") && hyperlink.endsWith("String_Node_Str")) {
        hyperlink=hyperlink.substring(1,hyperlink.length() - 1);
      }
      writer.openTag("String_Node_Str");
      writer.attribute("String_Node_Str",part.getHyperlinkId(hyperlink));
      if (link.getTooltip() != null) {
        writer.attribute("String_Node_Str",link.getTooltip());
      }
      writer.closeTag("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
void setHyperlink(HyperlinkDef link){
  if (link != null) {
    String hyperlink=null;
    try {
      hyperlink=URLEncoder.encode(link.getLink(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException ue) {
      logger.log(Level.SEVERE,ue.getLocalizedMessage(),ue);
    }
    if (hyperlink != null) {
      if (hyperlink.startsWith("String_Node_Str") && hyperlink.endsWith("String_Node_Str")) {
        hyperlink=hyperlink.substring(1,hyperlink.length() - 1);
      }
      writer.openTag("String_Node_Str");
      writer.attribute("String_Node_Str",part.getHyperlinkId(hyperlink));
      if (link.getTooltip() != null) {
        writer.attribute("String_Node_Str",link.getTooltip());
      }
      writer.closeTag("String_Node_Str");
    }
  }
}
Program: 65189
Project: 65189
Buggy source:
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (session != null) {
    try {
      DataService.getInstance().unRegisterSession(session);
    }
 catch (    BirtException e) {
      logger.log(e);
    }
  }
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}
Program: 65192
Project: 65192
Buggy source:
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
    theme=new Theme(part);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 65193
Project: 65193
Buggy source:
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}

Fixed version (ground truth):
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  Theme theme=new Theme(part,this);
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}
Program: 65195
Project: 65195
Buggy source:
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
    theme=new Theme(part);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 65196
Project: 65196
Buggy source:
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}

Fixed version (ground truth):
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  Theme theme=new Theme(part,this);
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}
Program: 65197
Project: 65197
Buggy source:
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public Presentation(OutputStream out,String tempFileDir,int compressionMode){
  pkg=Package.createInstance(out,tempFileDir,compressionMode);
  String uri="String_Node_Str";
  String type=ContentTypes.PRESENTATIONML;
  String relationshipType=RelationshipTypes.DOCUMENT;
  this.part=pkg.getPart(uri,type,relationshipType);
  pkg.setExtensionData(new ImageManager());
  try {
    writer=part.getCacheWriter();
    initialize();
    theme=new Theme(part);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 65198
Project: 65198
Buggy source:
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  Theme theme=new Theme(part,this);
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}

Fixed version (ground truth):
public SlideMaster createSlideMaster(String name,PageArea area) throws IOException {
  SlideMaster slideMaster=new SlideMaster(this,area);
  slideMaster.referTo(theme);
  slideMasters.put(name,slideMaster);
  return slideMaster;
}
Program: 65199
Project: 65199
Buggy source:
@Override public void visitContainer(IContainerArea container){
  if (container instanceof PageArea) {
    newPage(container);
    new SlideWriter(this).writeSlide((PageArea)container);
    this.pageGraphic.dispose();
  }
 else   if (container instanceof TableArea) {
    outputTable((TableArea)container);
  }
 else   if (TextWriter.isSingleTextControl(container)) {
    int x=currentX + getX(container);
    int y=currentY + getY(container);
    int width=getWidth(container);
    int height=getHeight(container);
    new TextWriter(this).writeTextBlock(x,y,width,height,(ContainerArea)container);
  }
 else {
    startContainer(container);
    visitChildren(container);
    endContainer(container);
  }
}

Fixed version (ground truth):
@Override public void visitContainer(IContainerArea container){
  if (container instanceof PageArea) {
    newPage(container);
    new SlideWriter(this).writeSlide((PageArea)container);
    this.pageGraphic.dispose();
  }
 else   if (container instanceof TableArea) {
    outputTable((TableArea)container);
  }
 else   if (TextWriter.isSingleTextControl(container)) {
    outputText((ContainerArea)container);
  }
 else {
    startContainer(container);
    visitChildren(container);
    endContainer(container);
  }
}
Program: 65200
Project: 65200
Buggy source:
private void outputText(BlockTextArea text){
  if (!editMode) {
    visitText(text);
    return;
  }
  int x=currentX + getX(text);
  int y=currentY + getY(text);
  int width=getWidth(text);
  int height=getHeight(text);
  new TextWriter(this).writeBlockText(x,y,width,height,text);
}

Fixed version (ground truth):
private void outputText(ContainerArea text){
  if (editMode) {
    int x=currentX + getX(text);
    int y=currentY + getY(text);
    int width=getWidth(text);
    int height=getHeight(text);
    new TextWriter(this).writeTextBlock(x,y,width,height,text);
  }
 else {
    startContainer(text);
    visitChildren(text);
    endContainer(text);
  }
}
Program: 65201
Project: 65201
Buggy source:
void writeTextBlock(int startX,int startY,int width,int height,ContainerArea container){
  parseBlockTextArea(container);
  startX=PPTXUtil.convertToEnums(startX);
  startY=PPTXUtil.convertToEnums(startY);
  width=PPTXUtil.convertToEnums(width);
  height=PPTXUtil.convertToEnums(height);
  if (needGroup) {
    startGroup(startX,startY,width + 1,height);
    startX=0;
    startY=0;
  }
  drawLineBorder(container);
  startBlockText(startX,startY,width + 1,height,container);
  drawBlockTextChildren(container);
  endBlockText(container);
  if (needGroup)   endGroup();
}

Fixed version (ground truth):
public void writeTextBlock(int startX,int startY,int width,int height,ContainerArea container){
  parseBlockTextArea(container);
  startX=PPTXUtil.convertToEnums(startX);
  startY=PPTXUtil.convertToEnums(startY);
  width=PPTXUtil.convertToEnums(width);
  height=PPTXUtil.convertToEnums(height);
  if (needGroup) {
    startGroup(startX,startY,width + 1,height);
    startX=0;
    startY=0;
  }
  drawLineBorder(container);
  startBlockText(startX,startY,width + 1,height,container);
  drawBlockTextChildren(container);
  endBlockText(container);
  if (needGroup)   endGroup();
}
Program: 65202
Project: 65202
Buggy source:
private void startTable(TableArea tablearea){
  int X=PPTXUtil.convertToEnums(currentX);
  int Y=PPTXUtil.convertToEnums(currentY);
  int width=PPTXUtil.convertToEnums(tablearea.getWidth());
  int height=PPTXUtil.convertToEnums(tablearea.getHeight());
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",canvas.getPresentation().nextShapeId());
  writer.attribute("String_Node_Str","String_Node_Str" + TableIndex++);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  canvas.setPosition('p',X,Y,width,height);
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writeColumnsWidth(tablearea);
}

Fixed version (ground truth):
private void startTable(TableArea tablearea){
  int X=PPTXUtil.convertToEnums(currentX);
  int Y=PPTXUtil.convertToEnums(currentY);
  int width=PPTXUtil.convertToEnums(tablearea.getWidth());
  int height=PPTXUtil.convertToEnums(tablearea.getHeight());
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",canvas.getPresentation().getNextShapeId());
  writer.attribute("String_Node_Str","String_Node_Str" + TableIndex++);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  canvas.setPosition('p',X,Y,width,height);
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writeColumnsWidth(tablearea);
}
Program: 65203
Project: 65203
Buggy source:
private void startGroup(int startX,int startY,int width,int height){
  int shapeId=canvas.getPresentation().nextShapeId();
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",shapeId);
  writer.attribute("String_Node_Str","String_Node_Str" + shapeId);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  canvas.setPosition(startX,startY,width + 1,height);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void startGroup(int startX,int startY,int width,int height){
  int shapeId=canvas.getPresentation().getNextShapeId();
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",shapeId);
  writer.attribute("String_Node_Str","String_Node_Str" + shapeId);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  canvas.setPosition(startX,startY,width + 1,height);
  writer.closeTag("String_Node_Str");
}
Program: 65205
Project: 65205
Buggy source:
public int compare(Object o1,Object o2){
  CrosstabCellAdapter part1=(CrosstabCellAdapter)o1;
  CrosstabCellAdapter part2=(CrosstabCellAdapter)o2;
  if (part1.getRowNumber() > part2.getRowNumber()) {
    return 1;
  }
 else   if (part1.getRowNumber() < part2.getRowNumber()) {
    return -1;
  }
 else   if (part1.getColumnNumber() > part2.getColumnNumber()) {
    return 1;
  }
 else   if (part1.getColumnNumber() > part2.getColumnNumber()) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Object o1,Object o2){
  CrosstabCellAdapter part1=(CrosstabCellAdapter)o1;
  CrosstabCellAdapter part2=(CrosstabCellAdapter)o2;
  if (part1.getRowNumber() > part2.getRowNumber()) {
    return 1;
  }
 else   if (part1.getRowNumber() < part2.getRowNumber()) {
    return -1;
  }
 else   if (part1.getColumnNumber() > part2.getColumnNumber()) {
    return 1;
  }
 else   if (part1.getColumnNumber() < part2.getColumnNumber()) {
    return -1;
  }
  return 0;
}
Program: 65206
Project: 65206
Buggy source:
/** 
 * Return whether or not given id matches the id of the coolitems that the workbench creates.
 */
public boolean isWorkbenchCoolItemId(String id){
  if (IWorkbenchActionConstants.TOOLBAR_FILE.equalsIgnoreCase(id))   return true;
  if (IWorkbenchActionConstants.TOOLBAR_NAVIGATE.equalsIgnoreCase(id))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Return whether or not given id matches the id of the cool items that the workbench creates.
 */
public boolean isWorkbenchCoolItemId(String id){
  if (IWorkbenchActionConstants.TOOLBAR_FILE.equalsIgnoreCase(id))   return true;
  if (IWorkbenchActionConstants.TOOLBAR_NAVIGATE.equalsIgnoreCase(id))   return true;
  return false;
}
Program: 65208
Project: 65208
Buggy source:
/** 
 * Creates and returns the File menu.
 */
private MenuManager createFileMenu(){
  MenuManager menu=new MenuManager(DesignerWorkbenchMessages.Workbench_file,IWorkbenchActionConstants.M_FILE);
  MenuManager newMenu=new MenuManager(DesignerWorkbenchMessages.Workbench_new,ActionFactory.NEW.getId());
  newMenu.add(newReportAction);
  newMenu.add(newLibraryAction);
  newMenu.add(newReportTemplateAction);
  for (int i=0; i < newActios.length; i++) {
    newMenu.add(newActios[i]);
  }
  menu.add(newMenu);
  menu.add(openFileAction);
  menu.add(new Separator());
  menu.add(closeAction);
  menu.add(closeAllAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
  menu.add(new Separator());
  menu.add(saveAction);
  menu.add(saveAsAction);
  menu.add(saveAllAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
  menu.add(new Separator());
  menu.add(quitAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
  return menu;
}

Fixed version (ground truth):
/** 
 * Creates and returns the File menu.
 */
private MenuManager createFileMenu(){
  MenuManager menu=new MenuManager(DesignerWorkbenchMessages.Workbench_file,IWorkbenchActionConstants.M_FILE);
  MenuManager newMenu=new MenuManager(DesignerWorkbenchMessages.Workbench_new,ActionFactory.NEW.getId());
  newMenu.add(newReportAction);
  newMenu.add(newLibraryAction);
  newMenu.add(newReportTemplateAction);
  for (int i=0; i < newActions.length; i++) {
    newMenu.add(newActions[i]);
  }
  menu.add(newMenu);
  menu.add(openFileAction);
  menu.add(new Separator());
  menu.add(closeAction);
  menu.add(closeAllAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
  menu.add(new Separator());
  menu.add(saveAction);
  menu.add(saveAsAction);
  menu.add(saveAllAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
  menu.add(new Separator());
  menu.add(quitAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
  return menu;
}
Program: 65209
Project: 65209
Buggy source:
/** 
 * Disposes any resources and unhooks any listeners that are no longer needed. Called when the window is closed.
 */
public void dispose(){
  if (isDisposed)   return;
  isDisposed=true;
  pinEditorContributionItem.dispose();
  openFileAction=null;
  newReportAction=null;
  newLibraryAction=null;
  newReportTemplateAction=null;
  for (int i=0; i < newActios.length; i++) {
    newActios[i]=null;
  }
  closeAction=null;
  closeAllAction=null;
  saveAction=null;
  saveAllAction=null;
  helpContentsAction=null;
  aboutAction=null;
  openPreferencesAction=null;
  saveAsAction=null;
  lockToolBarAction=null;
  backwardHistoryAction=null;
  forwardHistoryAction=null;
  undoAction=null;
  redoAction=null;
  cutAction=null;
  copyAction=null;
  pasteAction=null;
  deleteAction=null;
  selectAllAction=null;
  findAction=null;
  quitAction=null;
  pinEditorContributionItem=null;
  introAction=null;
  super.dispose();
}

Fixed version (ground truth):
/** 
 * Disposes any resources and unhooks any listeners that are no longer needed. Called when the window is closed.
 */
public void dispose(){
  if (isDisposed)   return;
  isDisposed=true;
  pinEditorContributionItem.dispose();
  openFileAction=null;
  newReportAction=null;
  newLibraryAction=null;
  newReportTemplateAction=null;
  for (int i=0; i < newActions.length; i++) {
    newActions[i]=null;
  }
  closeAction=null;
  closeAllAction=null;
  saveAction=null;
  saveAllAction=null;
  helpContentsAction=null;
  aboutAction=null;
  openPreferencesAction=null;
  saveAsAction=null;
  lockToolBarAction=null;
  backwardHistoryAction=null;
  forwardHistoryAction=null;
  undoAction=null;
  redoAction=null;
  cutAction=null;
  copyAction=null;
  pasteAction=null;
  deleteAction=null;
  selectAllAction=null;
  findAction=null;
  quitAction=null;
  pinEditorContributionItem=null;
  introAction=null;
  super.dispose();
}
Program: 65210
Project: 65210
Buggy source:
/** 
 * Init the window
 * @param window
 */
void init(IWorkbenchWindow window);

Fixed version (ground truth):
/** 
 * Initialize the window
 * @param window
 */
void init(IWorkbenchWindow window);
Program: 65212
Project: 65212
Buggy source:
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == QUARTER) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == QUARTER) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE || iUnit == DAY_OF_MONTH || iUnit == DAY_OF_WEEK || iUnit == DAY_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR || iUnit == WEEK_OF_MONTH) {
    set(Calendar.YEAR,2000);
  }
  return;
}
Program: 65214
Project: 65214
Buggy source:
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == GroupingUnitType.QUARTERS) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Reset year units for this datetime instance above a specified unit.
 * @param iUnit The unit above which year values are to be reset
 * @param always indicates if it's always trimmed no matter if it's full date time
 */
public final void clearAbove(int iUnit,boolean always){
  if (!always && isFullDateTime()) {
    return;
  }
  if (iUnit == YEAR) {
    return;
  }
 else   if (iUnit == MONTH || iUnit == QUARTER) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == DATE) {
    set(Calendar.YEAR,2000);
  }
 else   if (iUnit == WEEK_OF_YEAR) {
    set(Calendar.YEAR,2000);
  }
  return;
}