nus-yam/ex-repair huggingface dataset:
Program: 70500
Project: 70500
Buggy source:
public void endListBand(IListBandContent listBand) throws BirtException {
}

Fixed version (ground truth):
public void endListBand(IListBandContent listBand) throws BirtException {
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    if (current instanceof RepeatableArea) {
      ((RepeatableArea)current).setInHeaderBand(false);
    }
  }
}
Program: 70501
Project: 70501
Buggy source:
public void endTableBand(ITableBandContent band) throws BirtException {
}

Fixed version (ground truth):
public void endTableBand(ITableBandContent band) throws BirtException {
  int bandType=band.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    if (current instanceof RepeatableArea) {
      ((RepeatableArea)current).setInHeaderBand(false);
    }
  }
}
Program: 70502
Project: 70502
Buggy source:
public void startTableBand(ITableBandContent band) throws BirtException {
}

Fixed version (ground truth):
public void startTableBand(ITableBandContent band) throws BirtException {
  int bandType=band.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    if (current instanceof RepeatableArea) {
      ((RepeatableArea)current).setInHeaderBand(true);
    }
  }
}
Program: 70503
Project: 70503
Buggy source:
public void startListBand(IListBandContent listBand) throws BirtException {
}

Fixed version (ground truth):
public void startListBand(IListBandContent listBand) throws BirtException {
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    if (current instanceof RepeatableArea) {
      ((RepeatableArea)current).setInHeaderBand(true);
    }
  }
}
Program: 70504
Project: 70504
Buggy source:
protected boolean isValidResult(List result){
  if (repeatList != null && !isFirst) {
    return result.size() > repeatList.size();
  }
  return super.isValidResult(result);
}

Fixed version (ground truth):
protected boolean isValidResult(List result){
  if (repeatList != null && !inHeaderBand) {
    return result.size() > repeatList.size();
  }
  return super.isValidResult(result);
}
Program: 70505
Project: 70505
Buggy source:
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!isInHeaderBand()) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
          cloneRow.setAllocatedY(currentBP);
        }
      }
 else {
        repeatList=null;
      }
    }
    isFirst=false;
  }
  super.updateChildrenPosition();
}

Fixed version (ground truth):
protected void updateChildrenPosition() throws BirtException {
  if (repeatList != null && repeatList.size() > 0) {
    if (!inHeaderBand) {
      if (getRepeatedHeight() < getMaxAvaHeight()) {
        for (int i=0; i < repeatList.size(); i++) {
          ContainerArea row=(ContainerArea)repeatList.get(i);
          ContainerArea cloneRow=row.deepClone();
          children.add(i,cloneRow);
          cloneRow.setParent(this);
          update(cloneRow);
          cloneRow.setAllocatedY(currentBP);
        }
      }
 else {
        repeatList=null;
      }
    }
  }
  super.updateChildrenPosition();
}
Program: 70506
Project: 70506
Buggy source:
protected int getRepeatedHeight(){
  if (repeatList != null && repeatHeight == 0) {
    for (int i=0; i < repeatList.size(); i++) {
      AbstractArea area=(AbstractArea)repeatList.get(i);
      repeatHeight+=area.getAllocatedHeight();
    }
  }
  return repeatHeight;
}

Fixed version (ground truth):
protected int getRepeatedHeight(){
  if (inHeaderBand) {
    return 0;
  }
  if (repeatHeight != 0) {
    return repeatHeight;
  }
 else {
    if (repeatList != null) {
      for (int i=0; i < repeatList.size(); i++) {
        AbstractArea area=(AbstractArea)repeatList.get(i);
        repeatHeight+=area.getAllocatedHeight();
      }
      return repeatHeight;
    }
  }
  return 0;
}
Program: 70507
Project: 70507
Buggy source:
public void align(boolean lastLine,LayoutContext context){
  assert(parent instanceof BlockContainerArea);
  CSSValue align=((BlockContainerArea)parent).getTextAlign();
  boolean isRightAligned=BidiAlignmentResolver.isRightAligned(parent.content,align,lastLine);
  if ((isRightAligned || IStyle.CENTER_VALUE.equals(align))) {
    int spacing=width - currentIP;
    Iterator iter=getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (isRightAligned) {
          area.setPosition(spacing + area.getX(),area.getY());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setPosition(spacing / 2 + area.getX(),area.getY());
        }
      }
    }
  }
 else   if (IStyle.JUSTIFY_VALUE.equals(align) && !lastLine) {
    justify();
  }
  if (context.getBidiProcessing())   reorderVisually();
  verticalAlign();
}

Fixed version (ground truth):
public void align(boolean lastLine,LayoutContext context){
  assert(parent instanceof BlockContainerArea);
  CSSValue align=((BlockContainerArea)parent).getTextAlign();
  boolean isRightAligned=BidiAlignmentResolver.isRightAligned(parent.content,align,lastLine);
  if ((isRightAligned || IStyle.CENTER_VALUE.equals(align))) {
    int spacing=width - currentIP;
    Iterator iter=getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      if (spacing > 0) {
        if (isRightAligned) {
          if (parent.content.isDirectionRTL()) {
            area.setPosition(spacing + area.getX(),area.getY());
          }
 else {
            area.setPosition(spacing + area.getX() + ignoreRightMostWhiteSpace(),area.getY());
          }
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setPosition(spacing / 2 + area.getX(),area.getY());
        }
      }
    }
  }
 else   if (IStyle.JUSTIFY_VALUE.equals(align) && !lastLine) {
    justify();
  }
  if (context.getBidiProcessing())   reorderVisually();
  verticalAlign();
}
Program: 70508
Project: 70508
Buggy source:
private void testMethod(StyleInstance styleInstance,String methodName) throws Throwable {
  try {
    Method method=StyleInstance.class.getMethod(methodName,String.class);
    method.invoke(styleInstance,"String_Node_Str");
    fail();
  }
 catch (  InvocationTargetException expected) {
    Throwable targetException=expected.getTargetException();
    if (targetException instanceof IllegalStateException) {
      assertTrue(true);
      return;
    }
    throw targetException;
  }
}

Fixed version (ground truth):
private void testMethod(StyleInstance styleInstance,String methodName) throws Throwable {
  try {
    Method method=StyleInstance.class.getMethod(methodName,String.class);
    method.invoke(styleInstance,"String_Node_Str");
    fail();
  }
 catch (  InvocationTargetException expected) {
    Throwable targetException=expected.getTargetException();
    if (targetException instanceof UnsupportedOperationException) {
      assertTrue(true);
      return;
    }
    throw targetException;
  }
}
Program: 70509
Project: 70509
Buggy source:
private void checkRunningState(){
  if (runningState == RunningState.RENDER) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (runningState == RunningState.PAGEBREAK) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkRunningState(){
  if (runningState == RunningState.RENDER) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  if (runningState == RunningState.PAGEBREAK) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}
Program: 70510
Project: 70510
Buggy source:
/** 
 * API test on IReportEngine.openReportDesign( ) method
 */
public void testOpenReportDesign(){
  try {
    String rootPath=new File("String_Node_Str").toURL().toString();
    String goldenReportName=rootPath + "String_Node_Str" + REPORT_DESIGN;
    ReportEngine engine=new ReportEngine(new EngineConfig());
    IReportRunnable runnable=engine.openReportDesign(REPORT_DESIGN);
    assertTrue(runnable.getReportName().equals(goldenReportName));
    engine.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
/** 
 * API test on IReportEngine.openReportDesign( ) method
 */
public void testOpenReportDesign(){
  try {
    String rootPath=new File("String_Node_Str").toURL().toString();
    String goldenReportName=rootPath + "String_Node_Str" + REPORT_DESIGN;
    ReportEngine engine=new ReportEngine(new EngineConfig());
    IReportRunnable runnable=engine.openReportDesign(REPORT_DESIGN);
    assertEquals(goldenReportName,URLDecoder.decode(runnable.getReportName(),"String_Node_Str"));
    engine.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 70511
Project: 70511
Buggy source:
/** 
 * Tests legend defined on chart are generated by the image layout engine.
 * @throws EngineException
 */
public void testPdfChartLegend() throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=getPageAreas(report);
  assertEquals(1,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(0);
  Iterator logicContainers=pageArea.getBody().getChildren();
  ContainerArea blockContainer=(ContainerArea)logicContainers.next();
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    checkChart(162590,40173,39800,11251,"String_Node_Str",null,"String_Node_Str",blockContainer);
    logicContainers.next();
    checkChart(162590,40173,39800,11251,"String_Node_Str",null,"String_Node_Str",(ContainerArea)logicContainers.next());
    checkChart(162590,40173,39800,11251,"String_Node_Str",null,"String_Node_Str",(ContainerArea)logicContainers.next());
  }
}

Fixed version (ground truth):
/** 
 * Tests legend defined on chart are generated by the image layout engine.
 * @throws EngineException
 */
public void testPdfChartLegend() throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=getPageAreas(report);
  assertEquals(1,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(0);
  Iterator logicContainers=pageArea.getBody().getChildren();
  ContainerArea blockContainer=(ContainerArea)logicContainers.next();
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    checkChart(162302,40057,39729,11219,"String_Node_Str",null,null,blockContainer);
    logicContainers.next();
    checkChart(162302,40057,39729,11219,"String_Node_Str",null,"String_Node_Str",(ContainerArea)logicContainers.next());
    checkChart(162302,40057,39729,11219,"String_Node_Str",null,"String_Node_Str",(ContainerArea)logicContainers.next());
  }
}
Program: 70512
Project: 70512
Buggy source:
private void checkChartLengend(ContainerArea map,int x,int y,int width,int height,String hyperlink,String bookmark,String targetWindow){
  IContent mapContent=(IContent)map.getContent();
  IHyperlinkAction link=mapContent.getHyperlinkAction();
  assertEquals(x,map.getX());
  assertEquals(y,map.getY());
  assertEquals(width,map.getWidth());
  assertEquals(height,map.getHeight());
  assertTrue(link.getHyperlink().matches(hyperlink));
  assertEquals(bookmark,link.getBookmark());
  assertEquals(targetWindow,link.getTargetWindow());
}

Fixed version (ground truth):
private void checkChartLengend(ContainerArea map,int x,int y,int width,int height,String hyperlink,String bookmark,String targetWindow){
  IHyperlinkAction link=map.getAction();
  assertEquals(x,map.getX());
  assertEquals(y,map.getY());
  assertEquals(width,map.getWidth());
  assertEquals(height,map.getHeight());
  assertTrue(link.getHyperlink().matches(hyperlink));
  assertEquals(bookmark,link.getBookmark());
  assertEquals(targetWindow,link.getTargetWindow());
}
Program: 70513
Project: 70513
Buggy source:
/** 
 * Test case for bugzilla bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=157189">157189</a> : HTML BR tags cease to work for text element after page break in PDF
 * @throws EngineException
 */
public void estForeignContent() throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=getPageAreas(report);
  assertEquals(2,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(1);
  Iterator logicContainers=pageArea.getBody().getChildren();
  IContainerArea blockContains=(IContainerArea)logicContainers.next();
  Iterator lineAreas=blockContains.getChildren();
  lineAreas.next();
  LineArea emptyLine=(LineArea)lineAreas.next();
  assertTrue("String_Node_Str",isEmpty(emptyLine));
  LineArea lineArea=(LineArea)lineAreas.next();
  assertEquals("String_Node_Str",getText(lineArea,2));
  assertEquals("String_Node_Str",getText(lineArea,5));
}

Fixed version (ground truth):
/** 
 * Test case for bugzilla bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=157189">157189</a> : HTML BR tags cease to work for text element after page break in PDF
 * @throws EngineException
 */
public void estForeignContent() throws EngineException {
  String designFile="String_Node_Str";
  IReportRunnable report=openReportDesign(designFile);
  List pageAreas=getPageAreas(report);
  assertEquals(2,pageAreas.size());
  PageArea pageArea=(PageArea)pageAreas.get(1);
  Iterator logicContainers=pageArea.getBody().getChildren();
  IContainerArea blockContains=(IContainerArea)logicContainers.next();
  logicContainers=blockContains.getChildren();
  IContainerArea blockContains1=(IContainerArea)logicContainers.next();
  Iterator lineAreas=blockContains1.getChildren();
  lineAreas.next();
  LineArea emptyLine=(LineArea)lineAreas.next();
  assertTrue("String_Node_Str",isEmpty(emptyLine));
  LineArea lineArea=(LineArea)lineAreas.next();
  assertEquals("String_Node_Str",getText(lineArea,2));
  assertEquals("String_Node_Str",getText(lineArea,5));
}
Program: 70514
Project: 70514
Buggy source:
protected void update() throws BirtException {
  if (parent != null) {
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      int size=children.size();
      if ((aHeight + parent.getAbsoluteBP() > context.getMaxBP()) && (size > 1)) {
        IStyle style=content.getComputedStyle();
        int widow=PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_WIDOWS));
        int orphan=PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_ORPHANS));
        for (int i=0; i < size; i++) {
          TextLineArea line=(TextLineArea)children.get(i);
          if (i > 0 && i < orphan) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
 else           if (i > size - widow) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
        }
      }
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        parent.autoPageBreak();
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
}

Fixed version (ground truth):
protected void update() throws BirtException {
  if (parent != null) {
    if (context.isFixedLayout() && height > specifiedHeight) {
      setHeight(specifiedHeight);
      setNeedClip(true);
    }
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      int size=children.size();
      if ((aHeight + parent.getAbsoluteBP() > context.getMaxBP()) && (size > 1)) {
        IStyle style=content.getComputedStyle();
        int widow=PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_WIDOWS));
        int orphan=PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_ORPHANS));
        for (int i=0; i < size; i++) {
          TextLineArea line=(TextLineArea)children.get(i);
          if (i > 0 && i < orphan) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
 else           if (i > size - widow) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
        }
      }
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        parent.autoPageBreak();
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
}
Program: 70515
Project: 70515
Buggy source:
public static void handleOnCreate(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextItemDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnCreate(autoTextItemDesign)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context);
    if (handleJS(autoText,autoTextItemDesign.getOnCreate(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextItemDesign,context);
    if (eh != null)     eh.onCreate(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnCreate(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextItemDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnCreate(autoTextItemDesign)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context,RunningState.CREATE);
    if (handleJS(autoText,autoTextItemDesign.getOnCreate(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextItemDesign,context);
    if (eh != null)     eh.onCreate(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextItemDesign.getHandle());
  }
}
Program: 70516
Project: 70516
Buggy source:
public static void handleOnRender(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  if (!needOnRender(autoTextDesign)) {
    return;
  }
  try {
    IAutoTextInstance autoText=new AutoTextInstance(content,context);
    if (handleJS(autoText,autoTextDesign.getOnRender(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onRender(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnRender(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  if (!needOnRender(autoTextDesign)) {
    return;
  }
  try {
    IAutoTextInstance autoText=new AutoTextInstance(content,context,RunningState.RENDER);
    if (handleJS(autoText,autoTextDesign.getOnRender(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onRender(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}
Program: 70517
Project: 70517
Buggy source:
public static void handleOnPageBreak(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnPageBreak(autoTextDesign)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context);
    if (handleJS(autoText,autoTextDesign.getOnPageBreak(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onPageBreak(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnPageBreak(autoTextDesign)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context,RunningState.PAGEBREAK);
    if (handleJS(autoText,autoTextDesign.getOnPageBreak(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onPageBreak(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}
Program: 70518
Project: 70518
Buggy source:
public static void handleOnCreate(ICellContent content,ExecutionContext context,boolean fromGrid){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnCreate(cellDesign)) {
      return;
    }
    ICellInstance cell=new CellInstance(content,context,fromGrid);
    if (handleJS(cell,cellDesign.getOnCreate(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onCreate(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnCreate(ICellContent content,ExecutionContext context,boolean fromGrid){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnCreate(cellDesign)) {
      return;
    }
    ICellInstance cell=new CellInstance(content,context,RunningState.CREATE,fromGrid);
    if (handleJS(cell,cellDesign.getOnCreate(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onCreate(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}
Program: 70519
Project: 70519
Buggy source:
public static void handleOnRender(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnRender(cellDesign)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,false);
    if (handleJS(cell,cellDesign.getOnRender(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onRender(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnRender(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnRender(cellDesign)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,RunningState.RENDER,false);
    if (handleJS(cell,cellDesign.getOnRender(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onRender(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}
Program: 70520
Project: 70520
Buggy source:
public static void handleOnPageBreak(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnPageBreak(cellDesign)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,false);
    if (handleJS(cell,cellDesign.getOnPageBreak(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onPageBreak(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnPageBreak(cellDesign)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,RunningState.RENDER,false);
    if (handleJS(cell,cellDesign.getOnPageBreak(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onPageBreak(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}
Program: 70521
Project: 70521
Buggy source:
public static void handleOnCreate(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context);
    if (handleJS(dataItem,dataItemDesign.getOnCreate(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onCreate(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnCreate(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context,RunningState.CREATE);
    if (handleJS(dataItem,dataItemDesign.getOnCreate(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onCreate(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}
Program: 70522
Project: 70522
Buggy source:
public static void handleOnRender(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context);
    if (handleJS(dataItem,dataItemDesign.getOnRender(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onRender(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnRender(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context,RunningState.RENDER);
    if (handleJS(dataItem,dataItemDesign.getOnRender(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onRender(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}
Program: 70523
Project: 70523
Buggy source:
public static void handleOnPageBreak(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context);
    if (handleJS(dataItem,dataItemDesign.getOnPageBreak(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onPageBreak(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context,RunningState.PAGEBREAK);
    if (handleJS(dataItem,dataItemDesign.getOnPageBreak(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onPageBreak(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}
Program: 70524
Project: 70524
Buggy source:
private static IDynamicTextInstance createDynamicTextInstance(IContent content,ExecutionContext context){
  return new DynamicTextInstance(content,context);
}

Fixed version (ground truth):
private static IDynamicTextInstance createDynamicTextInstance(IContent content,ExecutionContext context,RunningState runningState){
  return new DynamicTextInstance(content,context,runningState);
}
Program: 70525
Project: 70525
Buggy source:
public static void handleOnCreate(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context);
    if (handleJS(text,textItemDesign.getOnCreate(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onCreate(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnCreate(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context,RunningState.CREATE);
    if (handleJS(text,textItemDesign.getOnCreate(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onCreate(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}
Program: 70526
Project: 70526
Buggy source:
public static void handleOnRender(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context);
    if (handleJS(text,textItemDesign.getOnRender(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onRender(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnRender(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context,RunningState.RENDER);
    if (handleJS(text,textItemDesign.getOnRender(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onRender(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}
Program: 70527
Project: 70527
Buggy source:
public static void handleOnPageBreak(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context);
    if (handleJS(text,textItemDesign.getOnPageBreak(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onPageBreak(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IContent content,ExecutionContext context){
  ReportItemDesign textItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(textItemDesign)) {
    return;
  }
  try {
    IDynamicTextInstance text=createDynamicTextInstance(content,context,RunningState.PAGEBREAK);
    if (handleJS(text,textItemDesign.getOnPageBreak(),context).didRun())     return;
    IDynamicTextEventHandler eh=getEventHandler(textItemDesign,context);
    if (eh != null)     eh.onPageBreak(text,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,textItemDesign.getHandle());
  }
}
Program: 70528
Project: 70528
Buggy source:
public Object visitTable(ITableContent table,Object value){
  ExecutionContext context=(ExecutionContext)value;
  Object genBy=table.getGenerateBy();
  if (genBy instanceof TableItemDesign)   return new TableInstance(table,context);
 else   if (genBy instanceof GridItemDesign)   return new GridInstance(table,context);
  return null;
}

Fixed version (ground truth):
public Object visitTable(ITableContent table,Object value){
  ExecutionContext context=(ExecutionContext)value;
  Object genBy=table.getGenerateBy();
  if (genBy instanceof TableItemDesign)   return new TableInstance(table,context,runningState);
 else   if (genBy instanceof GridItemDesign)   return new GridInstance(table,context,runningState);
  return null;
}
Program: 70529
Project: 70529
Buggy source:
public Object visitLabel(ILabelContent label,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new LabelInstance(label,context);
}

Fixed version (ground truth):
public Object visitLabel(ILabelContent label,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new LabelInstance(label,context,runningState);
}
Program: 70530
Project: 70530
Buggy source:
public Object visitCell(ICellContent cell,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new CellInstance(cell,context,false);
}

Fixed version (ground truth):
public Object visitCell(ICellContent cell,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new CellInstance(cell,context,runningState,false);
}
Program: 70531
Project: 70531
Buggy source:
public Object visitList(IListContent list,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ListInstance(list,context);
}

Fixed version (ground truth):
public Object visitList(IListContent list,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ListInstance(list,context,runningState);
}
Program: 70532
Project: 70532
Buggy source:
public Object visitForeign(IForeignContent foreign,Object value){
  ExecutionContext context=(ExecutionContext)value;
  if (IForeignContent.HTML_TYPE.equals(foreign.getRawType()) || IForeignContent.TEXT_TYPE.equals(foreign.getRawType()) || IForeignContent.TEMPLATE_TYPE.equals(foreign.getRawType()))   return new TextItemInstance(foreign,context);
  return null;
}

Fixed version (ground truth):
public Object visitForeign(IForeignContent foreign,Object value){
  ExecutionContext context=(ExecutionContext)value;
  if (IForeignContent.HTML_TYPE.equals(foreign.getRawType()) || IForeignContent.TEXT_TYPE.equals(foreign.getRawType()) || IForeignContent.TEMPLATE_TYPE.equals(foreign.getRawType()))   return new TextItemInstance(foreign,context,runningState);
  return null;
}
Program: 70533
Project: 70533
Buggy source:
public Object visitText(ITextContent text,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new TextItemInstance(text,context);
}

Fixed version (ground truth):
public Object visitText(ITextContent text,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new TextItemInstance(text,context,runningState);
}
Program: 70534
Project: 70534
Buggy source:
public Object visitData(IDataContent data,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new DataItemInstance(data,context);
}

Fixed version (ground truth):
public Object visitData(IDataContent data,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new DataItemInstance(data,context,runningState);
}
Program: 70535
Project: 70535
Buggy source:
public Object visitContent(IContent content,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ReportElementInstance(content,context);
}

Fixed version (ground truth):
public Object visitContent(IContent content,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ReportElementInstance(content,context,runningState);
}
Program: 70536
Project: 70536
Buggy source:
public Object visitImage(IImageContent image,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ImageInstance(image,context);
}

Fixed version (ground truth):
public Object visitImage(IImageContent image,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new ImageInstance(image,context,runningState);
}
Program: 70537
Project: 70537
Buggy source:
public static IReportElementInstance getInstance(IElement element,ExecutionContext context) throws BirtException {
  if (element == null)   return null;
  if (element instanceof IContent) {
    return (IReportElementInstance)instanceBuilder.visit((IContent)element,context);
  }
  return null;
}

Fixed version (ground truth):
public static IReportElementInstance getInstance(IElement element,ExecutionContext context,RunningState runningState) throws BirtException {
  if (element == null)   return null;
  if (element instanceof IContent) {
    instanceBuilder.setRunningState(runningState);
    return (IReportElementInstance)instanceBuilder.visit((IContent)element,context);
  }
  return null;
}
Program: 70538
Project: 70538
Buggy source:
public Object visitRow(IRowContent row,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new RowInstance(row,context);
}

Fixed version (ground truth):
public Object visitRow(IRowContent row,Object value){
  ExecutionContext context=(ExecutionContext)value;
  return new RowInstance(row,context,runningState);
}
Program: 70539
Project: 70539
Buggy source:
public static void handleOnCreate(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context);
    if (handleJS(grid,gridDesign.getOnCreate(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onCreate(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnCreate(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnCreate(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context,RunningState.CREATE);
    if (handleJS(grid,gridDesign.getOnCreate(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onCreate(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}
Program: 70540
Project: 70540
Buggy source:
public static void handleOnRender(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context);
    if (handleJS(grid,gridDesign.getOnRender(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onRender(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnRender(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnRender(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context,RunningState.RENDER);
    if (handleJS(grid,gridDesign.getOnRender(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onRender(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}
Program: 70541
Project: 70541
Buggy source:
public static void handleOnPageBreak(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context);
    if (handleJS(grid,gridDesign.getOnPageBreak(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onPageBreak(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context,RunningState.PAGEBREAK);
    if (handleJS(grid,gridDesign.getOnPageBreak(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onPageBreak(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}
Program: 70542
Project: 70542
Buggy source:
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedWidth > 0) {
      this.width=specifiedWidth;
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  textAlign=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}
Program: 70544
Project: 70544
Buggy source:
protected IContent cloneContent(IContent content,long pageNumber,long totalPageNumber){
  IContent newContent=content.cloneContent(false);
  if (newContent.getContentType() == IContent.AUTOTEXT_CONTENT) {
    IAutoTextContent autoText=(IAutoTextContent)newContent;
    int type=autoText.getType();
    if (type == IAutoTextContent.PAGE_NUMBER || type == IAutoTextContent.UNFILTERED_PAGE_NUMBER) {
      String pattern=autoText.getComputedStyle().getNumberFormat();
      NumberFormatter nf=new NumberFormatter(pattern);
      autoText.setText(nf.format(pageNumber));
    }
  }
  Iterator iter=content.getChildren().iterator();
  while (iter.hasNext()) {
    IContent child=(IContent)iter.next();
    IContent newChild=cloneContent(child,pageNumber,totalPageNumber);
    newChild.setParent(newContent);
    newContent.getChildren().add(newChild);
  }
  return newContent;
}

Fixed version (ground truth):
protected IContent cloneContent(IContent parent,IContent content,long pageNumber,long totalPageNumber){
  IContent newContent=content.cloneContent(false);
  newContent.setParent(parent);
  if (newContent.getContentType() == IContent.AUTOTEXT_CONTENT) {
    IAutoTextContent autoText=(IAutoTextContent)newContent;
    int type=autoText.getType();
    if (type == IAutoTextContent.PAGE_NUMBER || type == IAutoTextContent.UNFILTERED_PAGE_NUMBER) {
      String pattern=autoText.getComputedStyle().getNumberFormat();
      NumberFormatter nf=new NumberFormatter(pattern);
      autoText.setText(nf.format(pageNumber));
    }
  }
  Iterator iter=content.getChildren().iterator();
  while (iter.hasNext()) {
    IContent child=(IContent)iter.next();
    IContent newChild=cloneContent(newContent,child,pageNumber,totalPageNumber);
    newChild.setParent(newContent);
    newContent.getChildren().add(newChild);
  }
  return newContent;
}
Program: 70545
Project: 70545
Buggy source:
protected IPageContent createPageContent(IPageContent pageContent,long pageNumber,long totalPageNumber){
  return (IPageContent)cloneContent(pageContent,pageNumber,totalPageNumber);
}

Fixed version (ground truth):
protected IPageContent createPageContent(IPageContent pageContent,long pageNumber,long totalPageNumber){
  return (IPageContent)cloneContent((IContent)pageContent.getParent(),pageContent,pageNumber,totalPageNumber);
}