nus-yam/ex-repair huggingface dataset:
Program: 76966
Project: 76966
Buggy source:
/** 
 * Refresh the border data as per the current border setting and existing border setting, using the CSS2.0 border collision algorithm: if the style is none, always lose; then compare the width, greater win; if width is equal, compare the style, less win; or keep the original. This is the part 1 of the algorithm.
 */
public static void refreshBorderData(int[] data,int style,int width,int color,int rowIndex,int colIndex){
  assert(data.length > 4);
  if (style != 0) {
    if (width > data[1] || data[0] == 0) {
      data[0]=style;
      data[1]=width;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
    }
 else     if (width == data[1] && style < data[0]) {
      data[0]=style;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
    }
  }
 else   if (data[0] == 0) {
    data[1]=1;
  }
}

Fixed version (ground truth):
/** 
 * Refresh the border data as per the current border setting and existing border setting, using the CSS2.0 border collision algorithm: if the style is none, always lose; then compare the width, greater win; if width is equal, compare the style, less win; or keep the original. This is the part 1 of the algorithm.
 */
public static void refreshBorderData(int[] data,int style,int width,int color,int rowIndex,int colIndex,int type){
  assert(data.length > 5);
  if (style != 0) {
    if (data[0] == 0) {
      data[0]=style;
      data[1]=width;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
      data[5]=type;
      return;
    }
    if (type > data[5]) {
      data[0]=style;
      data[1]=width;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
      data[5]=type;
    }
 else     if (type < data[5]) {
      return;
    }
    if (width > data[1] || data[0] == 0) {
      data[0]=style;
      data[1]=width;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
      data[5]=type;
    }
 else     if (width == data[1] && style < data[0]) {
      data[0]=style;
      data[2]=color;
      data[3]=rowIndex;
      data[4]=colIndex;
      data[5]=type;
    }
  }
 else   if (data[0] == 0) {
    data[1]=1;
  }
}
Program: 76968
Project: 76968
Buggy source:
protected void updateBaseBorder(DesignElementHandle handle,BaseBorder border){
  border.bottomColor=handle.getPropertyHandle(StyleHandle.BORDER_BOTTOM_COLOR_PROP).getIntValue();
  border.bottomStyle=handle.getPropertyHandle(StyleHandle.BORDER_BOTTOM_STYLE_PROP).getStringValue();
  border.bottomWidth=handle.getPropertyHandle(StyleHandle.BORDER_BOTTOM_WIDTH_PROP).getStringValue();
  border.topColor=handle.getPropertyHandle(StyleHandle.BORDER_TOP_COLOR_PROP).getIntValue();
  border.topStyle=handle.getPropertyHandle(StyleHandle.BORDER_TOP_STYLE_PROP).getStringValue();
  border.topWidth=handle.getPropertyHandle(StyleHandle.BORDER_TOP_WIDTH_PROP).getStringValue();
  border.leftColor=handle.getPropertyHandle(StyleHandle.BORDER_LEFT_COLOR_PROP).getIntValue();
  border.leftStyle=handle.getPropertyHandle(StyleHandle.BORDER_LEFT_STYLE_PROP).getStringValue();
  border.leftWidth=handle.getPropertyHandle(StyleHandle.BORDER_LEFT_WIDTH_PROP).getStringValue();
  border.rightColor=handle.getPropertyHandle(StyleHandle.BORDER_RIGHT_COLOR_PROP).getIntValue();
  border.rightStyle=handle.getPropertyHandle(StyleHandle.BORDER_RIGHT_STYLE_PROP).getStringValue();
  border.rightWidth=handle.getPropertyHandle(StyleHandle.BORDER_RIGHT_WIDTH_PROP).getStringValue();
}

Fixed version (ground truth):
protected void updateBaseBorder(DesignElementHandle handle,BaseBorder border){
  updateBottomBorder(handle,border);
  updateTopBorder(handle,border);
  updateLeftBorder(handle,border);
  updateRightBorder(handle,border);
}
Program: 76969
Project: 76969
Buggy source:
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  if (data instanceof Object[] && ((Object[])data)[0] instanceof ThemeHandle) {
    if (getCurrentTarget() instanceof ModuleHandle) {
      if (Policy.TRACING_DND_DRAG) {
        System.out.println("String_Node_Str" + getCurrentTarget());
      }
      return ApplyTheme((ThemeHandle)((Object[])data)[0],(ModuleHandle)getCurrentTarget());
    }
 else {
      return false;
    }
  }
  if (getCurrentOperation() == DND.DROP_MOVE) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return moveData(data,getCurrentTarget());
  }
 else   if (getCurrentOperation() == DND.DROP_COPY) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return copyData(data,getCurrentTarget());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @see ViewerDropAdapter#performDrop(Object)
 */
public boolean performDrop(Object data){
  if (data instanceof Object[] && ((Object[])data)[0] instanceof ThemeHandle) {
    if (getCurrentTarget() instanceof ModuleHandle) {
      if (Policy.TRACING_DND_DRAG) {
        System.out.println("String_Node_Str" + getCurrentTarget());
      }
      return ApplyTheme((ThemeHandle)((Object[])data)[0],(ModuleHandle)getCurrentTarget());
    }
 else {
      return false;
    }
  }
  if (getCurrentOperation() == DND.DROP_MOVE) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return moveData(data,getCurrentTarget());
  }
 else   if (getCurrentOperation() == DND.DROP_COPY || getCurrentOperation() == DND.DROP_LINK) {
    if (Policy.TRACING_DND_DRAG) {
      System.out.println("String_Node_Str" + getCurrentTarget());
    }
    return copyData(data,getCurrentTarget());
  }
  return false;
}
Program: 76970
Project: 76970
Buggy source:
public void run(){
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(getSelectedObjects().getFirstElement()));
  }
  doRename();
}

Fixed version (ground truth):
public void run(){
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(getSelectedObjects().getFirstElement()));
  }
  if (selectedItem != null) {
    doRename();
  }
}
Program: 76974
Project: 76974
Buggy source:
private String[] getDocumentBookmarks(IReportDocument rdoc){
  List bookmarks=rdoc.getBookmarks();
  String[] bookmarkArray=new String[bookmarks.size()];
  int i=0;
  for (Iterator iter=bookmarks.iterator(); iter.hasNext(); ) {
    bookmarkArray[i]="String_Node_Str" + iter.next() + "String_Node_Str";
    i++;
  }
  return bookmarkArray;
}

Fixed version (ground truth):
private List getDocumentBookmarks(IReportDocument rdoc){
  List bookmarks=rdoc.getBookmarks();
  return bookmarks;
}
Program: 76975
Project: 76975
Buggy source:
/** 
 * Service provided by the fragment. This is the entry point of engine framgent. It generally includes a JSP page to render a certain part of web viewer.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, BirtException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  if (attrBean != null && !attrBean.isMissingParameter() && !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase(attrBean.getFormat())) {
    this.doPreService(request,response);
    this.doService(request,response);
    this.doPostService(request,response);
  }
 else {
    super.doPreService(request,response);
    super.doService(request,response);
    String target=super.doPostService(request,response);
    if (target != null && target.length() > 0) {
      RequestDispatcher rd=request.getRequestDispatcher(target);
      rd.include(request,response);
    }
  }
}

Fixed version (ground truth):
/** 
 * Service provided by the fragment. This is the entry point of engine framgent. It generally includes a JSP page to render a certain part of web viewer.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 */
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, BirtException {
  BaseAttributeBean attrBean=(BaseAttributeBean)request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
  if (attrBean != null && !attrBean.isMissingParameter() && !this.__checkHTMLFormat(request)) {
    this.doPreService(request,response);
    this.doService(request,response);
    this.doPostService(request,response);
  }
 else {
    super.doPreService(request,response);
    super.doService(request,response);
    String target=super.doPostService(request,response);
    if (target != null && target.length() > 0) {
      RequestDispatcher rd=request.getRequestDispatcher(target);
      rd.include(request,response);
    }
  }
}
Program: 76977
Project: 76977
Buggy source:
protected boolean layoutChildren(){
  repeatHeader();
  boolean hasNext=super.layoutChildren();
  tableEmitter.resolveAll();
  tableEmitter.flush();
  return hasNext;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  repeatHeader();
  boolean hasNext=super.layoutChildren();
  if (!isOutput) {
    startContent();
  }
  tableEmitter.resolveAll();
  tableEmitter.flush();
  return hasNext;
}
Program: 76978
Project: 76978
Buggy source:
public void run(){
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(getSelectedObjects().getFirstElement()));
  }
  if (tool != null) {
    tool.doRename();
  }
}

Fixed version (ground truth):
public void run(){
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(getSelectedObjects().getFirstElement()));
  }
  doRename();
}
Program: 76979
Project: 76979
Buggy source:
/** 
 * Create a new rename action under the specific viewer with the given text
 * @param sourceViewer the source viewer
 * @param text the text of the action
 */
public RenameAction(TreeViewer sourceViewer,String text){
  super(sourceViewer,text);
  setAccelerator(SWT.F2);
  if (isEnabled()) {
    tool=new RenameInlineTool(getSelectedItems()[0]);
  }
}

Fixed version (ground truth):
/** 
 * Create a new rename action under the specific viewer with the given text
 * @param sourceViewer the source viewer
 * @param text the text of the action
 */
public RenameAction(TreeViewer sourceViewer,String text){
  super(sourceViewer,text);
  setAccelerator(SWT.F2);
  if (isEnabled()) {
    selectedItem=getSelectedItems()[0];
  }
}
Program: 76980
Project: 76980
Buggy source:
/** 
 * Change default value format from design file. <p> <ul> <li>if data type is <code>PARAM_TYPE_DATETIME</code>, then convert old ISO8601 datetime format to standard format.</li> </li> </ul>
 * @param dataType the parameter data type
 * @param defaultValue the default value from design file
 * @return
 */
public static String getDefaultValue(String dataType,String defaultValue){
  if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
    Date obj=null;
    try {
      obj=DateFormatISO8601.parse(defaultValue);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return getDisplayValue(obj);
  }
  return defaultValue;
}

Fixed version (ground truth):
/** 
 * Change default value format from design file. <p> <ul> <li>if data type is <code>PARAM_TYPE_DATETIME</code>, then convert old ISO8601 datetime format to standard format.</li> </li> </ul>
 * @param dataType the parameter data type
 * @param defaultValue the default value from design file
 * @return
 */
public static String getDefaultValue(String dataType,String defaultValue){
  if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
    Date obj=null;
    try {
      obj=DateFormatISO8601.parse(defaultValue);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return getDisplayValue(obj);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equalsIgnoreCase(dataType)) {
    return getDisplayValue(Boolean.valueOf(defaultValue));
  }
  return defaultValue;
}
Program: 76982
Project: 76982
Buggy source:
private List getDocumentBookmarks(IReportDocument rdoc){
  List bookmarks=rdoc.getBookmarks();
  return bookmarks;
}

Fixed version (ground truth):
private String[] getDocumentBookmarks(IReportDocument rdoc){
  List bookmarks=rdoc.getBookmarks();
  String[] bookmarkArray=new String[bookmarks.size() + 1];
  bookmarkArray[0]="String_Node_Str";
  int i=1;
  for (Iterator iter=bookmarks.iterator(); iter.hasNext(); ) {
    bookmarkArray[i]="String_Node_Str" + iter.next() + "String_Node_Str";
    i++;
  }
  return bookmarkArray;
}
Program: 76983
Project: 76983
Buggy source:
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSetExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSet)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else   if (provider instanceof OdaExtensibilityProvider) {
    if (extensionID != null) {
      String newExtensionID=((OdaExtensibilityProvider)provider).convertDataSetExtensionID(extensionID);
      if (!extensionID.equals(newExtensionID)) {
        setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSetExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSet)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSetExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}
Program: 76984
Project: 76984
Buggy source:
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSourceExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSource)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else   if (provider instanceof OdaExtensibilityProvider) {
    if (extensionID != null) {
      String newExtensionID=((OdaExtensibilityProvider)provider).convertDataSourceExtensionID(extensionID);
      if (!extensionID.equals(newExtensionID)) {
        setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSourceExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSource)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSourceExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}
Program: 76985
Project: 76985
Buggy source:
/** 
 * compile the expression
 * @param expression
 * @return List contains all column reference
 * @throws BirtException
 */
static List compileColumnExpression(String expression,boolean rowMode) throws BirtException {
  if (expression == null || expression.trim().length() == 0)   return new ArrayList();
  if (rowMode)   ROW_INDICATOR=ROW_COLUMN_INDICATOR;
 else   ROW_INDICATOR=DATASETROW_INDICATOR;
  List columnExprList=new ArrayList();
  columnExprList.clear();
  Context context=Context.enter();
  try {
    ScriptOrFnNode tree=instance.parse(expression,context);
    instance.CompiledExprFromTree(expression,context,tree,columnExprList);
  }
 catch (  Exception ex) {
    throw new CoreException(instance.pluginId,ResourceConstants.INVALID_EXPRESSION,ex);
  }
 finally {
    Context.exit();
  }
  return columnExprList;
}

Fixed version (ground truth):
/** 
 * compile the expression
 * @param expression
 * @return List contains all column reference
 * @throws BirtException
 */
static List compileColumnExpression(ExpressionParserUtility util,String expression,boolean rowMode) throws BirtException {
  if (expression == null || expression.trim().length() == 0)   return new ArrayList();
  if (rowMode)   util.ROW_INDICATOR=ROW_COLUMN_INDICATOR;
 else   util.ROW_INDICATOR=DATASETROW_INDICATOR;
  List columnExprList=new ArrayList();
  columnExprList.clear();
  Context context=Context.enter();
  try {
    ScriptOrFnNode tree=util.parse(expression,context);
    util.CompiledExprFromTree(expression,context,tree,columnExprList);
  }
 catch (  Exception ex) {
    throw new CoreException(util.pluginId,ResourceConstants.INVALID_EXPRESSION,ex);
  }
 finally {
    Context.exit();
  }
  return columnExprList;
}
Program: 76986
Project: 76986
Buggy source:
static boolean isDirectColumnRef(String expression,boolean mode) throws BirtException {
  isDirectColumnRef=false;
  compileColumnExpression(expression,mode);
  return isDirectColumnRef;
}

Fixed version (ground truth):
static boolean isDirectColumnRef(String expression,boolean mode) throws BirtException {
  ExpressionParserUtility util=new ExpressionParserUtility();
  util.isDirectColumnRef=false;
  compileColumnExpression(util,expression,mode);
  return util.isDirectColumnRef;
}
Program: 76987
Project: 76987
Buggy source:
/** 
 * @return
 * @throws BirtException 
 */
static boolean hasAggregation(String expression,boolean mode) throws BirtException {
  hasAggregation=false;
  compileColumnExpression(expression,mode);
  return hasAggregation;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws BirtException 
 */
static boolean hasAggregation(String expression,boolean mode) throws BirtException {
  ExpressionParserUtility util=new ExpressionParserUtility();
  util.hasAggregation=false;
  compileColumnExpression(util,expression,mode);
  return util.hasAggregation;
}
Program: 76988
Project: 76988
Buggy source:
/** 
 * Extract all column expression info
 * @param oldExpression
 * @param mode if true, it means to compile the "row" expression.else extract "dataSetRow" expression
 * @return
 * @throws BirtException
 */
public static List extractColumnExpressions(String oldExpression,boolean mode) throws BirtException {
  if (oldExpression == null || oldExpression.trim().length() == 0)   return new ArrayList();
  return ExpressionParserUtility.compileColumnExpression(oldExpression,mode);
}

Fixed version (ground truth):
/** 
 * Extract all column expression info
 * @param oldExpression
 * @param mode if true, it means to compile the "row" expression.else extract "dataSetRow" expression
 * @return
 * @throws BirtException
 */
public static List extractColumnExpressions(String oldExpression,boolean mode) throws BirtException {
  if (oldExpression == null || oldExpression.trim().length() == 0)   return new ArrayList();
  return ExpressionParserUtility.compileColumnExpression(new ExpressionParserUtility(),oldExpression,mode);
}
Program: 76989
Project: 76989
Buggy source:
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)   return;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    String tempDirStr=DataEngineContextExt.getInstance().getTmpdir();
    tempDtEDir=new File(tempDirStr,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDirStr,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdir();
    tempDtEDir.deleteOnExit();
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * @return temp root dir directory
 */
private void createTempRootDir(){
  if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)   return;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdir();
    tempDtEDir.deleteOnExit();
  }
  try {
    tempRootDirStr=tempDtEDir.getCanonicalPath();
  }
 catch (  IOException e) {
  }
}
Program: 76990
Project: 76990
Buggy source:
/** 
 * construction
 */
CacheMapManager(){
  this.cacheMap=new HashMap();
  this.folderUtil=new FolderUtil();
}

Fixed version (ground truth):
/** 
 * construction
 */
CacheMapManager(String tempDir){
  this.cacheMap=new HashMap();
  this.folderUtil=new FolderUtil();
  this.tempDir=tempDir;
}
Program: 76991
Project: 76991
Buggy source:
/** 
 * @return session temp dir
 */
private String createSessionTempDir(){
  this.createTempRootDir();
  String sessionTempDirStr;
  final String prefix="String_Node_Str";
  String[] filesName=new File(tempRootDirStr).list();
  Arrays.sort(filesName,new Comparator(){
    public int compare(    Object o1,    Object o2){
      String f1=(String)o1;
      String f2=(String)o2;
      int index1=f1.indexOf(prefix);
      int index2=f2.indexOf(prefix);
      if (index1 < 0 || index2 < 0)       return 0;
      Integer i1=Integer.valueOf(f1.substring(index1 + prefix.length()));
      Integer i2=Integer.valueOf(f2.substring(index2 + prefix.length()));
      return i1.compareTo(i2);
    }
  }
);
  int maxIndex=-1;
  for (int i=filesName.length - 1; i >= 0; i--) {
    int index=filesName[i].indexOf(prefix);
    if (index == 0) {
      maxIndex=Integer.valueOf(filesName[i].substring(index + prefix.length())).intValue();
      break;
    }
  }
  maxIndex++;
  sessionTempDirStr=tempRootDirStr + File.separator + prefix+ maxIndex;
  File file=new File(sessionTempDirStr);
  file.mkdir();
  return sessionTempDirStr;
}

Fixed version (ground truth):
/** 
 * @return session temp dir
 */
private String createSessionTempDir(){
  this.createTempRootDir();
  final String prefix="String_Node_Str";
synchronized (cacheCounter2) {
    String sessionTempDir=tempRootDirStr + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2;
    cacheCounter2=new Integer(cacheCounter2.intValue() + 1);
    File sessionDirFile=new File(sessionTempDir);
    int x=0;
    while (sessionDirFile.exists()) {
      x++;
      sessionTempDir=tempRootDirStr + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2+ "String_Node_Str"+ x;
      sessionDirFile=new File(sessionTempDir);
    }
    sessionDirFile.mkdir();
    sessionDirFile.deleteOnExit();
    return sessionTempDir;
  }
}
Program: 76992
Project: 76992
Buggy source:
public IResultIterator execute(IEventHandler eventHandler) throws DataException {
  if (customDataSet == null) {
    return new CachedResultSet(this,resultMetadata,resultObjsIterator,groupingLevel,eventHandler);
  }
 else {
    if (DataSetCacheManager.getInstance().doesSaveToCache() == false)     return new CachedResultSet(this,customDataSet,eventHandler);
 else     return new CachedResultSet(this,resultMetadata,new DataSetResultCache(customDataSet,resultMetadata),eventHandler);
  }
}

Fixed version (ground truth):
public IResultIterator execute(IEventHandler eventHandler) throws DataException {
  if (customDataSet == null) {
    return new CachedResultSet(this,resultMetadata,resultObjsIterator,groupingLevel,eventHandler,session);
  }
 else {
    if (this.session.getDataSetCacheManager().doesSaveToCache() == false)     return new CachedResultSet(this,customDataSet,eventHandler,session);
 else     return new CachedResultSet(this,resultMetadata,new DataSetResultCache(customDataSet,resultMetadata,session),eventHandler,session);
  }
}
Program: 76993
Project: 76993
Buggy source:
/** 
 * Construction
 */
private DataSetCacheManager(){
  dataSourceDesign=null;
  dataSetDesign=null;
  cacheOption=DEFAULT;
  alwaysCacheRowCount=0;
  cacheMapManager=new CacheMapManager();
}

Fixed version (ground truth):
/** 
 * Construction
 */
public DataSetCacheManager(String tempDir){
  dataSourceDesign=null;
  dataSetDesign=null;
  cacheOption=DEFAULT;
  alwaysCacheRowCount=0;
  cacheMapManager=new CacheMapManager(tempDir);
}
Program: 76994
Project: 76994
Buggy source:
public ICandidateQuery newCandidateQuery(){
  return new CandidateQuery();
}

Fixed version (ground truth):
public ICandidateQuery newCandidateQuery(){
  return new CandidateQuery(this.session);
}
Program: 76995
Project: 76995
Buggy source:
/** 
 * @param driverName
 * @param connProperties
 */
DataSource(String driverName,Map connProperties){
  this.driverName=driverName;
  if (connProperties != null)   this.connectionProps.putAll(connProperties);
}

Fixed version (ground truth):
/** 
 * @param driverName
 * @param connProperties
 */
DataSource(String driverName,Map connProperties,DataEngineSession session){
  this.driverName=driverName;
  if (connProperties != null)   this.connectionProps.putAll(connProperties);
  this.session=session;
}
Program: 76996
Project: 76996
Buggy source:
public IDataSourceQuery newQuery(String queryType,String queryText) throws DataException {
  return new DataSourceQuery(this,queryType,queryText);
}

Fixed version (ground truth):
public IDataSourceQuery newQuery(String queryType,String queryText) throws DataException {
  return new DataSourceQuery(this,queryType,queryText,this.session);
}
Program: 76997
Project: 76997
Buggy source:
public Collection getSelectionListForCascadingGroup(IViewerReportDesignHandle design,String groupName,Object[] groupKeys,InputOptions options) throws ReportServiceException {
  IGetParameterDefinitionTask task=null;
  try {
    task=getParameterDefinitionTask(design,options);
    if (task != null) {
      ViewerAttributeBean bean=getViewerAttrBean(options);
      if (bean != null)       task.setParameterValues(bean.getParameters());
      task.evaluateQuery(groupName);
      Collection selectionList=task.getSelectionListForCascadingGroup(groupName,groupKeys);
      return convertEngineParameterSelectionChoice(selectionList);
    }
  }
  finally {
    if (task != null)     task.close();
  }
  return null;
}

Fixed version (ground truth):
public Collection getSelectionListForCascadingGroup(IViewerReportDesignHandle design,String groupName,Object[] groupKeys,InputOptions options) throws ReportServiceException {
  IGetParameterDefinitionTask task=null;
  try {
    task=getParameterDefinitionTask(design,options);
    if (task != null) {
      ViewerAttributeBean bean=getViewerAttrBean(options);
      if (bean != null)       task.setParameterValues(bean.getParameters());
      HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
      BirtUtility.addTask(request,task);
      task.evaluateQuery(groupName);
      Collection selectionList=task.getSelectionListForCascadingGroup(groupName,groupKeys);
      return convertEngineParameterSelectionChoice(selectionList);
    }
  }
  finally {
    if (task != null)     task.close();
  }
  return null;
}
Program: 76998
Project: 76998
Buggy source:
public Collection getParameterSelectionList(IViewerReportDesignHandle design,InputOptions runOptions,String paramName) throws ReportServiceException {
  IGetParameterDefinitionTask task=null;
  try {
    task=getParameterDefinitionTask(design,runOptions);
    if (task != null) {
      ViewerAttributeBean bean=getViewerAttrBean(runOptions);
      if (bean != null)       task.setParameterValues(bean.getParameters());
      Collection selectionList=task.getSelectionList(paramName);
      return convertEngineParameterSelectionChoice(selectionList);
    }
  }
  finally {
    if (task != null)     task.close();
  }
  return null;
}

Fixed version (ground truth):
public Collection getParameterSelectionList(IViewerReportDesignHandle design,InputOptions runOptions,String paramName) throws ReportServiceException {
  IGetParameterDefinitionTask task=null;
  try {
    task=getParameterDefinitionTask(design,runOptions);
    if (task != null) {
      ViewerAttributeBean bean=getViewerAttrBean(runOptions);
      if (bean != null)       task.setParameterValues(bean.getParameters());
      HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
      BirtUtility.addTask(request,task);
      Collection selectionList=task.getSelectionList(paramName);
      return convertEngineParameterSelectionChoice(selectionList);
    }
  }
  finally {
    if (task != null)     task.close();
  }
  return null;
}
Program: 77001
Project: 77001
Buggy source:
/** 
 * Constructor.
 * @param context
 * @param operation
 * @param response
 */
public AbstractBaseActionHandler(IContext context,Operation operation,GetUpdatedObjectsResponse response){
  this.context=context;
  this.operation=operation;
  this.response=response;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param context
 * @param operation
 * @param response
 */
public AbstractBaseActionHandler(IContext context,Operation operation,GetUpdatedObjectsResponse response){
  this.context=context;
  this.operation=operation;
  this.response=response;
  this.updateTaskId();
}
Program: 77002
Project: 77002
Buggy source:
void layout(IReportItemExecutor executor,IContentEmitter output);

Fixed version (ground truth):
void layout(ILayoutManager parent,IReportItemExecutor executor,IContentEmitter output);
Program: 77003
Project: 77003
Buggy source:
/** 
 * output the content.
 */
protected void start(){
  if (emitter != null) {
    ContentEmitterUtil.startContent(content,emitter);
  }
}

Fixed version (ground truth):
/** 
 * output the content.
 */
protected abstract void start();
Program: 77004
Project: 77004
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(true);
      engine.layout(header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(true);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}
Program: 77005
Project: 77005
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IListContent list=(IListContent)content;
    if (list.isHeaderRepeat()) {
      IBandContent header=list.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IListContent list=(IListContent)content;
    if (list.isHeaderRepeat()) {
      IBandContent header=list.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}
Program: 77006
Project: 77006
Buggy source:
protected void start(){
  if (pageContent == null) {
    MasterPageDesign pageDesign=getMasterPage(report);
    pageNumber=pageNumber + 1;
    context.setPageNumber(pageNumber);
    pageContent=reportExecutor.createPage(pageNumber,pageDesign);
    if (emitter != null) {
      emitter.startPage(pageContent);
    }
  }
}

Fixed version (ground truth):
protected void start(){
  if (pageContent == null) {
    MasterPageDesign pageDesign=getMasterPage(report);
    pageNumber=pageNumber + 1;
    context.setPageNumber(pageNumber);
    pageContent=reportExecutor.createPage(pageNumber,pageDesign);
    if (emitter != null) {
      emitter.startPage(pageContent);
    }
  }
  isOutput=true;
}
Program: 77007
Project: 77007
Buggy source:
public void layout(IContent content,IContentEmitter output){
  IReportItemExecutor executor=new DOMReportItemExecutor(content);
  layout(executor,output);
  executor.close();
}

Fixed version (ground truth):
public void layout(ILayoutManager parent,IContent content,IContentEmitter output){
  IReportItemExecutor executor=new DOMReportItemExecutor(content);
  layout(parent,executor,output);
  executor.close();
}
Program: 77008
Project: 77008
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    ITableContent table=(ITableContent)content;
    if (table.isHeaderRepeat()) {
      IBandContent header=table.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}
Program: 77009
Project: 77009
Buggy source:
public void layout(IContent content,IContentEmitter output){
  IReportItemExecutor executor=new DOMReportItemExecutor(content);
  layout(executor,output);
  executor.close();
}

Fixed version (ground truth):
public void layout(ILayoutManager parent,IContent content,IContentEmitter output){
  IReportItemExecutor executor=new DOMReportItemExecutor(content);
  layout(parent,executor,output);
  executor.close();
}
Program: 77010
Project: 77010
Buggy source:
public boolean isInheritedProperty(){
  return true;
}

Fixed version (ground truth):
public boolean isInheritedProperty(){
  return false;
}
Program: 77011
Project: 77011
Buggy source:
protected boolean isHidden(){
  if (content != null) {
    IStyle style=content.getComputedStyle();
    if (!IStyle.NONE_VALUE.equals(style.getProperty(IStyle.STYLE_DISPLAY))) {
      ListValue formats=(ListValue)style.getProperty(IStyle.STYLE_VISIBLE_FORMAT);
      if (formats.getLength() == 0) {
        return false;
      }
 else {
        String format=context.getFormat();
        for (int i=0; i < formats.getLength(); i++) {
          String hiddenFormat=formats.item(i).getCssText();
          if (format.equalsIgnoreCase(hiddenFormat) || BIRTConstants.BIRT_ALL_VALUE.equalsIgnoreCase(hiddenFormat)) {
            return true;
          }
        }
        return false;
      }
    }
 else {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean isHidden(){
  if (content != null) {
    IStyle style=content.getComputedStyle();
    if (!IStyle.NONE_VALUE.equals(style.getProperty(IStyle.STYLE_DISPLAY))) {
      return isHiddenByVisibility();
    }
 else {
      return true;
    }
  }
  return false;
}
Program: 77012
Project: 77012
Buggy source:
protected boolean isHidden(){
  if (columnWidth == 0 || !tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return super.isHidden();
}

Fixed version (ground truth):
protected boolean isHidden(){
  if (columnWidth == 0 || !tableLM.isCellVisible(cellContent)) {
    return true;
  }
  return isHiddenByVisibility();
}
Program: 77016
Project: 77016
Buggy source:
void setExtension(int extension,Object value);

Fixed version (ground truth):
/** 
 * Set the extension of the content. Only 2 extension supported so far <li>0: document extension</li> <li>1: layout extension</li>
 * @param extension extension type
 * @param value extension value
 * @throws ArrayIndexOutOfBoundsException if index is outof range {0,1}
 */
void setExtension(int extension,Object value);
Program: 77017
Project: 77017
Buggy source:
public void setExtension(int extension,Object value){
}

Fixed version (ground truth):
public void setExtension(int extension,Object value){
  if (extensions == null) {
    extensions=new Object[LAST_EXTENSION];
  }
  extensions[extension]=value;
}
Program: 77018
Project: 77018
Buggy source:
DataIterator(IExtractionResults results,IResultIterator iterator,String[] selectedColumns){
  this.results=results;
  this.iterator=iterator;
  this.selectedColumns=selectedColumns;
}

Fixed version (ground truth):
DataIterator(IExtractionResults results,IResultIterator iterator){
  this.results=results;
  this.iterator=iterator;
}
Program: 77019
Project: 77019
Buggy source:
ExtractionResults(IResultIterator resultIterator,IResultMetaData metaData,String[] selectedColumns){
  this.selectedColumns=selectedColumns;
  this.resultIterator=resultIterator;
  this.metaData=metaData;
}

Fixed version (ground truth):
ExtractionResults(IResultIterator resultIterator,IResultMetaData metaData,String[] selectedColumns){
  this.resultIterator=resultIterator;
  if (null == selectedColumns) {
    this.metaData=metaData;
  }
 else {
    this.metaData=new ResultMetaData(metaData,selectedColumns);
  }
}
Program: 77020
Project: 77020
Buggy source:
public IDataIterator nextResultIterator() throws BirtException {
  if (iterator == null) {
    if (null == resultIterator && null != queryResults) {
      resultIterator=queryResults.getResultIterator();
    }
    this.iterator=new DataIterator(this,resultIterator,selectedColumns);
  }
  return iterator;
}

Fixed version (ground truth):
public IDataIterator nextResultIterator() throws BirtException {
  if (iterator == null) {
    if (null == resultIterator && null != queryResults) {
      resultIterator=queryResults.getResultIterator();
    }
    this.iterator=new DataIterator(this,resultIterator);
  }
  return iterator;
}
Program: 77021
Project: 77021
Buggy source:
public int getColumnType(int index) throws BirtException {
  index=getColumnIndex(index);
  MetaDataEntry entry=(MetaDataEntry)metaEntries.get(index);
  return entry.type;
}

Fixed version (ground truth):
public int getColumnType(int index) throws BirtException {
  index=getColumnIndex(index);
  if (null != parentMetaData) {
    return parentMetaData.getColumnType(index);
  }
 else {
    MetaDataEntry entry=(MetaDataEntry)metaEntries.get(index);
    return entry.type;
  }
}
Program: 77022
Project: 77022
Buggy source:
public String getColumnName(int index) throws BirtException {
  index=getColumnIndex(index);
  MetaDataEntry entry=(MetaDataEntry)metaEntries.get(index);
  return entry.name;
}

Fixed version (ground truth):
public String getColumnName(int index) throws BirtException {
  index=getColumnIndex(index);
  if (null != parentMetaData) {
    return parentMetaData.getColumnName(index);
  }
 else {
    MetaDataEntry entry=(MetaDataEntry)metaEntries.get(index);
    return entry.name;
  }
}
Program: 77023
Project: 77023
Buggy source:
public ResultMetaData(IBaseQueryDefinition query){
  initializeMetaData(query);
  this.selectedColumns=null;
}

Fixed version (ground truth):
public ResultMetaData(IResultMetaData parentMetaData,String[] selectedColumns){
  this.parentMetaData=parentMetaData;
  this.selectedColumns=selectedColumns;
}
Program: 77024
Project: 77024
Buggy source:
private int getColumnIndex(int index) throws BirtException {
  if (selectedColumns == null) {
    return index;
  }
  String name=selectedColumns[index];
  for (int i=0; i < metaEntries.size(); i++) {
    MetaDataEntry entry=(MetaDataEntry)metaEntries.get(i);
    if (entry.name.equals(name)) {
      return i;
    }
  }
  throw new EngineException("String_Node_Str");
}

Fixed version (ground truth):
private int getColumnIndex(int index) throws BirtException {
  if (selectedColumns == null) {
    return index;
  }
  String name=selectedColumns[index];
  if (null != parentMetaData) {
    for (int i=0; i < parentMetaData.getColumnCount(); i++) {
      String columnName=parentMetaData.getColumnName(i);
      if (columnName.equals(name)) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < metaEntries.size(); i++) {
      MetaDataEntry entry=(MetaDataEntry)metaEntries.get(i);
      if (entry.name.equals(name)) {
        return i;
      }
    }
  }
  throw new EngineException("String_Node_Str");
}
Program: 77025
Project: 77025
Buggy source:
public int getColumnCount(){
  if (selectedColumns != null) {
    return selectedColumns.length;
  }
  return metaEntries.size();
}

Fixed version (ground truth):
public int getColumnCount(){
  if (selectedColumns != null) {
    return selectedColumns.length;
  }
  if (null != parentMetaData) {
    return parentMetaData.getColumnCount();
  }
  return metaEntries.size();
}
Program: 77026
Project: 77026
Buggy source:
void layout(IReportItemExecutor executor,IContentEmitter output);

Fixed version (ground truth):
void layout(ILayoutManager parent,IReportItemExecutor executor,IContentEmitter output);
Program: 77027
Project: 77027
Buggy source:
/** 
 * output the content.
 */
protected void start(){
  if (emitter != null) {
    ContentEmitterUtil.startContent(content,emitter);
  }
}

Fixed version (ground truth):
/** 
 * output the content.
 */
protected abstract void start();
Program: 77028
Project: 77028
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(true);
      engine.layout(header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      boolean skipPageHint=context.getSkipPageHint();
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(true);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setSkipPageHint(skipPageHint);
    }
  }
  isFirstLayout=false;
}
Program: 77029
Project: 77029
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IListContent list=(IListContent)content;
    if (list.isHeaderRepeat()) {
      IBandContent header=list.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (!isFirstLayout) {
    IListContent list=(IListContent)content;
    if (list.isHeaderRepeat()) {
      IBandContent header=list.getHeader();
      if (header != null) {
        boolean pageBreak=context.allowPageBreak();
        boolean skipPageHint=context.getSkipPageHint();
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(true);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setSkipPageHint(skipPageHint);
      }
    }
  }
  isFirstLayout=false;
}