nus-yam/ex-repair huggingface dataset:
Program: 77258
Project: 77258
Buggy source:
/** 
 * Checks if the text is a data content in table header/footer or table group header/footer and uses the query of the table.
 * @param text the text content.
 */
private boolean isAggregatable(ITextContent text){
  Object generateBy=text.getGenerateBy();
  DataItemDesign data=(DataItemDesign)generateBy;
  if (data.getQuery() != null) {
    return false;
  }
  IElement parent=text.getParent();
  while (parent != null) {
    if (parent instanceof IContent) {
      IContent content=(IContent)parent;
      ReportItemDesign design=(ReportItemDesign)content.getGenerateBy();
      if (design.getQuery() != null) {
        return false;
      }
    }
    if (parent instanceof IBandContent) {
      IBandContent bandContent=(IBandContent)parent;
      BandDesign bandDesing=(BandDesign)bandContent.getGenerateBy();
      if (bandDesing.getBandType() == BandDesign.BAND_HEADER || bandDesing.getBandType() == BandDesign.BAND_FOOTER || bandDesing.getBandType() == BandDesign.GROUP_HEADER || bandDesing.getBandType() == BandDesign.GROUP_FOOTER) {
        IElement bandParent=bandContent.getParent();
        if (bandParent instanceof IGroupContent) {
          bandParent=bandParent.getParent();
        }
        if (bandParent instanceof ITableContent) {
          return true;
        }
      }
    }
    parent=parent.getParent();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the text is a data content in table header/footer or table group header/footer and uses the query of the table.
 * @param text the text content.
 */
private boolean isAggregatable(ITextContent text){
  Object generateBy=text.getGenerateBy();
  DataItemDesign data=(DataItemDesign)generateBy;
  if (data.getQuery() != null) {
    return false;
  }
  IElement parent=text.getParent();
  while (parent != null) {
    if (parent instanceof IContent) {
      IContent content=(IContent)parent;
      ReportItemDesign design=(ReportItemDesign)content.getGenerateBy();
      if (design.getQuery() != null) {
        return false;
      }
    }
    if (parent instanceof IBandContent) {
      IBandContent bandContent=(IBandContent)parent;
      BandDesign bandDesing=(BandDesign)bandContent.getGenerateBy();
      if (bandDesing.getBandType() == BandDesign.BAND_HEADER || bandDesing.getBandType() == BandDesign.BAND_FOOTER || bandDesing.getBandType() == BandDesign.GROUP_HEADER || bandDesing.getBandType() == BandDesign.GROUP_FOOTER) {
        IElement bandParent=bandContent.getParent();
        while (bandParent instanceof IGroupContent) {
          bandParent=bandParent.getParent();
        }
        if (bandParent instanceof ITableContent) {
          return true;
        }
      }
    }
    parent=parent.getParent();
  }
  return false;
}
Program: 77260
Project: 77260
Buggy source:
/** 
 * Creates an ParameterDefinition with the given report parameter.
 * @param paramDefn the ROM report parameter.
 * @return the created ParameterDefinition
 */
ParameterDefinition updateParameterDefinitionFromReportParam(ParameterDefinition paramDefn,ScalarParameterHandle paramHandle){
}

Fixed version (ground truth):
/** 
 * Creates an ParameterDefinition with the given report parameter.
 * @param paramDefn the ROM report parameter.
 * @return the created ParameterDefinition
 */
ParameterDefinition updateParameterDefinitionFromReportParam(ParameterDefinition paramDefn,ScalarParameterHandle paramHandle,DataSetDesign dataSetDesign){
}
Program: 77264
Project: 77264
Buggy source:
/** 
 * Gets the resource folder.
 * @param request the request to retrieve
 * @return the resource folder of the request
 */
public static String getResourceFolder(HttpServletRequest request){
  String resourceFolder=null;
  resourceFolder=getParameter(request,PARAM_RESOURCE_FOLDER);
  if (resourceFolder == null || resourceFolder.trim().length() <= 0)   resourceFolder=birtResourceFolder;
  return resourceFolder;
}

Fixed version (ground truth):
/** 
 * Get the resource folder.
 * @param request the request to retrieve
 * @return the resource folder of the request
 */
public static String getResourceFolder(HttpServletRequest request){
  String resourceFolder=null;
  resourceFolder=getParameter(request,PARAM_RESOURCE_FOLDER);
  if (resourceFolder == null || resourceFolder.trim().length() <= 0)   resourceFolder=birtResourceFolder;
  return resourceFolder;
}
Program: 77265
Project: 77265
Buggy source:
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param context Servlet Context
 */
public synchronized static void initParameters(ServletContext context){
  if (isInitContext)   return;
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  documentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=context.getRealPath("String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  if (documentFolder == null || documentFolder.trim().length() <= 0)   documentFolder=workingFolder;
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  isDocumentFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER_ACCESS_ONLY)).booleanValue();
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  birtResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  clearDocuments();
  isInitContext=true;
}

Fixed version (ground truth):
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param context Servlet Context
 */
public synchronized static void initParameters(ServletContext context){
  if (isInitContext)   return;
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  documentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=getRealPath(context,"String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  if (documentFolder == null || documentFolder.trim().length() <= 0)   documentFolder=workingFolder;
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  isDocumentFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER_ACCESS_ONLY)).booleanValue();
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  birtResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  clearDocuments();
  isInitContext=true;
}
Program: 77266
Project: 77266
Buggy source:
/** 
 * Process the parameter definition for some special case
 * @param defn
 * @param parameters
 */
private static void proccessParamDefn(ParameterDefinition defn,DataSetParameters parameters){
  if (defn.getAttributes().getName() == null || defn.getAttributes().getName().trim().equals("String_Node_Str"))   defn.getAttributes().setName(SQLUtility.getUniqueName(parameters));
  if (defn.getAttributes().getNativeDataTypeCode() == Types.NULL) {
    defn.getAttributes().setNativeDataTypeCode(Types.CHAR);
  }
}

Fixed version (ground truth):
/** 
 * Process the parameter definition for some special case
 * @param defn
 * @param parameters
 */
private static void proccessParamDefn(ParameterDefinition defn,DataSetParameters parameters){
  if (defn.getAttributes().getNativeDataTypeCode() == Types.NULL) {
    defn.getAttributes().setNativeDataTypeCode(Types.CHAR);
  }
}
Program: 77267
Project: 77267
Buggy source:
private boolean needColumnFilter(ICellContent cell){
  DetailRowState state=(DetailRowState)detailRowStateStack.peek();
  if (cell.getColumnInstance() == null) {
    return false;
  }
  return state.isStartOfDetail && cell.getColumnInstance().hasDataItemsInDetail() && displayFilterIcon&& HTMLUtil.getFilterConditions(cell).size() > 0;
}

Fixed version (ground truth):
private boolean needColumnFilter(ICellContent cell){
  DetailRowState state=(DetailRowState)detailRowStateStack.peek();
  IColumn columnInstance=cell.getColumnInstance();
  if (columnInstance == null) {
    return false;
  }
  return state.isStartOfDetail && columnInstance.hasDataItemsInDetail() && displayFilterIcon&& HTMLUtil.getFilterConditions(cell).size() > 0;
}
Program: 77268
Project: 77268
Buggy source:
/** 
 * Gets filter conditions of the column which contains the specified cell.
 * @param cell the cell.
 * @return the column filter conditions.
 */
public static List getFilterConditions(ICellContent cell){
  IRowContent row=(IRowContent)cell.getParent();
  IBandContent band=(IBandContent)row.getParent();
  IElement parentOfBand=band.getParent();
  while (!(parentOfBand instanceof ITableContent) && parentOfBand != null) {
    parentOfBand=parentOfBand.getParent();
  }
  ITableContent tableContent=(ITableContent)parentOfBand;
  TableHandle tableHandle=(TableHandle)((TableItemDesign)tableContent.getGenerateBy()).getHandle();
  return (tableHandle.getFilters(cell.getColumn()));
}

Fixed version (ground truth):
/** 
 * Gets filter conditions of the column which contains the specified cell.
 * @param cell the cell.
 * @return the column filter conditions. Empty list is returned when thecolumn has no filter conditions.
 */
public static List getFilterConditions(ICellContent cell){
  IRowContent row=(IRowContent)cell.getParent();
  ITableContent table=row.getTable();
  List filters=null;
  if (table != null) {
    Object genBy=table.getGenerateBy();
    if (genBy instanceof TableItemDesign) {
      TableHandle tableHandle=(TableHandle)((TableItemDesign)genBy).getHandle();
      filters=tableHandle.getFilters(cell.getColumn());
    }
  }
  return filters == null ? Collections.EMPTY_LIST : filters;
}
Program: 77269
Project: 77269
Buggy source:
/** 
 * Get the aggregate value
 * @param aggrIndex
 * @return
 * @throws DataException
 */
private Object getAggregateValue(int aggrIndex) throws DataException {
  AggrExprInfo aggrInfo=getAggrInfo(aggrIndex);
  if (this.odiResult.getRowCount() == 0) {
    if (aggrInfo.aggregation.getName().equalsIgnoreCase("String_Node_Str"))     return new Integer(0);
 else     return null;
  }
  try {
    int groupIndex;
    if (aggrInfo.aggregation.getType() == IAggregation.SUMMARY_AGGR) {
      if (aggrInfo.groupLevel == 0)       groupIndex=0;
 else       groupIndex=this.odiResult.getCurrentGroupIndex(aggrInfo.groupLevel);
    }
 else {
      groupIndex=this.odiResult.getCurrentResultIndex();
    }
    return this.aggrValues[aggrIndex].get(groupIndex);
  }
 catch (  DataException e) {
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Get the aggregate value
 * @param aggrIndex
 * @return
 * @throws DataException
 */
private Object getAggregateValue(int aggrIndex) throws DataException {
  AggrExprInfo aggrInfo=getAggrInfo(aggrIndex);
  if (this.odiResult.getRowCount() == 0) {
    if (aggrInfo.aggregation.getName().equalsIgnoreCase(BuiltInAggregationFactory.TOTAL_COUNT_FUNC) || aggrInfo.aggregation.getName().equalsIgnoreCase(BuiltInAggregationFactory.TOTAL_COUNTDISTINCT_FUNC))     return new Integer(0);
 else     return null;
  }
  try {
    int groupIndex;
    if (aggrInfo.aggregation.getType() == IAggregation.SUMMARY_AGGR) {
      if (aggrInfo.groupLevel == 0)       groupIndex=0;
 else       groupIndex=this.odiResult.getCurrentGroupIndex(aggrInfo.groupLevel);
    }
 else {
      groupIndex=this.odiResult.getCurrentResultIndex();
    }
    return this.aggrValues[aggrIndex].get(groupIndex);
  }
 catch (  DataException e) {
    throw e;
  }
}
Program: 77271
Project: 77271
Buggy source:
/** 
 * Check whether there is columnReferenceExpression in aggregation. If so, return true. else return false;
 * @return
 */
public static boolean hasAggregationInExpr(IBaseExpression expression){
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    return hasAggregation(text);
  }
 else   if (expression instanceof IConditionalExpression) {
    String expr=getExprText(((IConditionalExpression)expression).getExpression());
    String oprand1=getExprText(((IConditionalExpression)expression).getOperand1());
    String oprand2=getExprText(((IConditionalExpression)expression).getOperand2());
    return hasAggregation(expr) || hasAggregation(oprand1) || hasAggregation(oprand2);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether there is columnReferenceExpression in aggregation. If so, return true. else return false;
 * @return
 */
public static boolean hasAggregationInExpr(IBaseExpression expression){
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    return ExpressionUtil.hasAggregation(text);
  }
 else   if (expression instanceof IConditionalExpression) {
    String expr=getExprText(((IConditionalExpression)expression).getExpression());
    String oprand1=getExprText(((IConditionalExpression)expression).getOperand1());
    String oprand2=getExprText(((IConditionalExpression)expression).getOperand2());
    return ExpressionUtil.hasAggregation(expr) || ExpressionUtil.hasAggregation(oprand1) || ExpressionUtil.hasAggregation(oprand2);
  }
  return false;
}
Program: 77273
Project: 77273
Buggy source:
public IReportDocument openReportDocument(String systemId,IDocArchiveReader archive,Map options) throws EngineException {
  ReportDocumentReader reader=new ReportDocumentReader(systemId,engine,archive);
  if (options != null) {
    options=new HashMap();
  }
  intializeModuleOptions(options);
  reader.setModuleOptions(options);
  return reader;
}

Fixed version (ground truth):
public IReportDocument openReportDocument(String systemId,IDocArchiveReader archive,Map options) throws EngineException {
  ReportDocumentReader reader=new ReportDocumentReader(systemId,engine,archive);
  if (options == null) {
    options=new HashMap();
  }
  intializeModuleOptions(options);
  reader.setModuleOptions(options);
  return reader;
}
Program: 77274
Project: 77274
Buggy source:
/** 
 * @param expr
 * @return
 */
private static boolean checkColumnRefInAggregation(CompiledExpression expr){
  int type=expr.getType();
switch (type) {
case CompiledExpression.TYPE_DIRECT_COL_REF:
case CompiledExpression.TYPE_CONSTANT_EXPR:
case CompiledExpression.TYPE_INVALID_EXPR:
    return false;
case CompiledExpression.TYPE_SINGLE_AGGREGATE:
{
    Iterator args=((AggregateExpression)expr).getArguments().iterator();
    while (args.hasNext()) {
      if (flattenExpression((CompiledExpression)args.next()))       return true;
      break;
    }
    break;
  }
case CompiledExpression.TYPE_COMPLEX_EXPR:
{
  Iterator col=((ComplexExpression)expr).getSubExpressions().iterator();
  while (col.hasNext()) {
    if (checkColumnRefInAggregation((CompiledExpression)col.next()))     return true;
  }
  break;
}
}
return false;
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 */
private static boolean checkColumnRefInAggregation(CompiledExpression expr){
  int type=expr.getType();
switch (type) {
case CompiledExpression.TYPE_DIRECT_COL_REF:
case CompiledExpression.TYPE_CONSTANT_EXPR:
case CompiledExpression.TYPE_INVALID_EXPR:
    return false;
case CompiledExpression.TYPE_SINGLE_AGGREGATE:
{
    Iterator args=((AggregateExpression)expr).getArguments().iterator();
    while (args.hasNext()) {
      return true;
    }
    break;
  }
case CompiledExpression.TYPE_COMPLEX_EXPR:
{
  Iterator col=((ComplexExpression)expr).getSubExpressions().iterator();
  while (col.hasNext()) {
    if (checkColumnRefInAggregation((CompiledExpression)col.next()))     return true;
  }
  break;
}
}
return false;
}
Program: 77275
Project: 77275
Buggy source:
/** 
 * @param query
 * @return
 */
private static boolean hasAggregationOnRowObjects(Iterator it){
  while (it.hasNext()) {
    Object o=it.next();
    if (ExpressionCompilerUtil.hasRowExprInAggregation((IBaseExpression)o)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param query
 * @return
 */
private static boolean hasAggregationOnRowObjects(Iterator it){
  while (it.hasNext()) {
    Object o=it.next();
    if (ExpressionCompilerUtil.hasAggregationInExpr((IBaseExpression)o)) {
      return true;
    }
  }
  return false;
}
Program: 77277
Project: 77277
Buggy source:
private static String generateFileName(String logDirectory,String logPrefix){
  File logDir=new File(logDirectory);
  if ((logDir.isDirectory() && !logDir.isAbsolute()) || logDirectory.startsWith("String_Node_Str")) {
    try {
      URL url=OdaJdbcDriver.getInstallDirectory();
      if (url != null) {
        String driverHomeDir=url.getPath();
        logDir=new File(driverHomeDir,logDirectory);
        logDirectory=logDir.getPath();
      }
    }
 catch (    OdaException e) {
    }
catch (    IOException e) {
    }
  }
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  String logfileName=(logDirectory.endsWith("String_Node_Str") || logDirectory.endsWith("String_Node_Str")) ? logDirectory : logDirectory + "String_Node_Str";
  logfileName+=logPrefix + "String_Node_Str";
  Timestamp timestamp=new Timestamp(System.currentTimeMillis());
  logfileName+=dateFormat.format(timestamp) + "String_Node_Str";
  return logfileName;
}

Fixed version (ground truth):
private static String generateFileName(String logDirectory,String logPrefix){
  File logDir=new File(logDirectory);
  if ((logDir.isDirectory() && !logDir.isAbsolute()) || logDirectory.startsWith("String_Node_Str")) {
    try {
      URL url=OdaJdbcDriver.getInstallDirectory();
      if (url != null) {
        String driverHomeDir=url.getPath();
        logDir=new File(driverHomeDir,getQualifiedLogDir(logDirectory));
        if (!logDir.exists()) {
          logDir.mkdir();
        }
        logDirectory=logDir.getPath();
      }
    }
 catch (    OdaException e) {
    }
catch (    IOException e) {
    }
  }
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  String logfileName=(logDirectory.endsWith("String_Node_Str") || logDirectory.endsWith("String_Node_Str")) ? logDirectory : logDirectory + File.separator;
  logfileName+=logPrefix + "String_Node_Str";
  Timestamp timestamp=new Timestamp(System.currentTimeMillis());
  logfileName+=dateFormat.format(timestamp) + "String_Node_Str";
  return logfileName;
}
Program: 77278
Project: 77278
Buggy source:
/** 
 * @param filterDefn1
 * @param filterDefn2
 * @return
 */
private static boolean isEqualGroup(IGroupDefinition groupDefn1,IGroupDefinition groupDefn2){
  if (groupDefn1 == groupDefn2)   return true;
  if (groupDefn1 == null || groupDefn2 == null)   return false;
  return isEqualStr(groupDefn1.getName(),groupDefn2.getName()) && isEqualStr(groupDefn1.getKeyColumn(),groupDefn2.getKeyColumn()) && isEqualStr(groupDefn1.getKeyExpression(),groupDefn2.getKeyExpression())&& groupDefn1.getSortDirection() == groupDefn2.getSortDirection();
}

Fixed version (ground truth):
/** 
 * @param filterDefn1
 * @param filterDefn2
 * @return
 */
private static boolean isEqualGroup(IGroupDefinition groupDefn1,IGroupDefinition groupDefn2){
  if (groupDefn1 == groupDefn2)   return true;
  if (groupDefn1 == null || groupDefn2 == null)   return false;
  return isEqualStr(groupDefn1.getName(),groupDefn2.getName()) && isEqualStr(groupDefn1.getKeyColumn(),groupDefn2.getKeyColumn()) && isEqualStr(groupDefn1.getKeyExpression(),groupDefn2.getKeyExpression())&& groupDefn1.getSortDirection() == groupDefn2.getSortDirection() && QueryDefnUtil.isCompatibleSQs(groupDefn1.getSubqueries(),groupDefn2.getSubqueries());
}
Program: 77280
Project: 77280
Buggy source:
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   setNativeType(modelParam.getNativeDataType().intValue());
  setType(ModelAdapter.adaptModelDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  if (modelParam instanceof OdaDataSetParameterHandle && ((OdaDataSetParameterHandle)modelParam).getParamName() != null) {
    setDefaultInputValue(PARAMS_PREFIX + "String_Node_Str" + ((OdaDataSetParameterHandle)modelParam).getParamName()+ "String_Node_Str");
  }
 else   setDefaultInputValue(modelParam.getDefaultValue());
}

Fixed version (ground truth):
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   setNativeType(modelParam.getNativeDataType().intValue());
  setType(ModelAdapter.adaptModelDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  if (modelParam instanceof OdaDataSetParameterHandle && ((OdaDataSetParameterHandle)modelParam).getParamName() != null) {
    setDefaultInputValue(ExpressionUtil.createParameterExpression(((OdaDataSetParameterHandle)modelParam).getParamName()));
  }
 else   setDefaultInputValue(modelParam.getDefaultValue());
}
Program: 77283
Project: 77283
Buggy source:
/** 
 * Open report design by using the input stream
 * @param name the system Id of the report design
 * @param reportStream -the input stream
 * @param options the config options in the report design
 * @return IReportRunnable
 * @throws EngineException
 */
public IReportRunnable openReportDesign(InputStream reportStream,Map options) throws EngineException {
  return engine.openReportDesign(null,reportStream,options);
}

Fixed version (ground truth):
/** 
 * Open report design by using the input stream
 * @param systemId the system Id of the report design
 * @param reportStream -the input stream
 * @param options the config options in the report design
 * @return IReportRunnable
 * @throws EngineException
 */
public IReportRunnable openReportDesign(String systemId,InputStream reportStream,Map options) throws EngineException {
  return engine.openReportDesign(systemId,reportStream,options);
}
Program: 77284
Project: 77284
Buggy source:
/** 
 * Populate the whole tree until all the leaves have no child.
 * @param root
 */
private static void populateRoot(ATreeNode root){
  Object[] toBeIterated=root.getChildren();
  for (int i=0; i < toBeIterated.length; i++) {
    Object value=((ATreeNode)toBeIterated[i]).getDataType();
    List container=new ArrayList();
    findNodeWithValue(root,value.toString(),container);
    for (int j=0; j < container.size(); j++) {
      if (((ATreeNode)container.get(j)).getChildren().length == 0) {
        Object[] os=((ATreeNode)toBeIterated[i]).getChildren();
        for (int k=0; k < os.length; k++) {
          if (!(((ATreeNode)os[k]).getDataType() != null && ((ATreeNode)os[k]).getDataType().equals(((ATreeNode)container.get(j)).getDataType())))           ((ATreeNode)container.get(j)).addChild(os[k]);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Populate the whole tree until all the leaves have no child.
 * @param root
 */
private static void populateRoot(ATreeNode root){
  Object[] toBeIterated=root.getChildren();
  for (int i=0; i < toBeIterated.length; i++) {
    Object value=((ATreeNode)toBeIterated[i]).getDataType();
    List container=new ArrayList();
    findNodeWithValue(root,value.toString(),container,new VisitingRecorder());
    for (int j=0; j < container.size(); j++) {
      if (((ATreeNode)container.get(j)).getChildren().length == 0) {
        Object[] os=((ATreeNode)toBeIterated[i]).getChildren();
        for (int k=0; k < os.length; k++) {
          if (!(((ATreeNode)os[k]).getDataType() != null && ((ATreeNode)os[k]).getDataType().equals(((ATreeNode)container.get(j)).getDataType())))           ((ATreeNode)container.get(j)).addChild(os[k]);
        }
      }
    }
  }
}
Program: 77285
Project: 77285
Buggy source:
/** 
 * Starting from a tree node, find all nodes with given value, and put it to container.
 * @param root
 * @param value
 * @param container
 */
private static void findNodeWithValue(ATreeNode root,String value,List container){
  if (root.getDataType() != null && root.getDataType().equals(value))   container.add(root);
  Object[] children=root.getChildren();
  for (int i=0; i < children.length; i++) {
    findNodeWithValue((ATreeNode)children[i],value,container);
  }
}

Fixed version (ground truth):
/** 
 * Starting from a tree node, find all nodes with given value, and put it to container.
 * @param root
 * @param value
 * @param container
 */
private static void findNodeWithValue(ATreeNode root,String value,List container,VisitingRecorder vr){
  if (root.getType() == ATreeNode.ELEMENT_TYPE && !vr.visit(root.getValue().toString()))   return;
  if (root.getDataType() != null && root.getDataType().equals(value))   container.add(root);
  Object[] children=root.getChildren();
  for (int i=0; i < children.length; i++) {
    findNodeWithValue((ATreeNode)children[i],value,container,vr);
  }
}
Program: 77287
Project: 77287
Buggy source:
/** 
 * @param node
 * @param complexTypesRoot
 * @param group
 * @throws OdaException
 */
private static void addElementToNode(ATreeNode node,ATreeNode complexTypesRoot,XSModelGroupImpl group) throws OdaException {
  XSObjectList list=group.getParticles();
  for (int j=0; j < list.getLength(); j++) {
    if (((XSParticleDecl)list.item(j)).getTerm() instanceof XSModelGroupImpl) {
      addElementToNode(node,complexTypesRoot,(XSModelGroupImpl)((XSParticleDecl)list.item(j)).getTerm());
      continue;
    }
    ATreeNode childNode=new ATreeNode();
    childNode.setValue(((XSParticleDecl)list.item(j)).getTerm().getName());
    String dataType=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition().getName();
    if (dataType == null || dataType.length() == 0)     dataType=childNode.getValue().toString();
    childNode.setDataType(dataType);
    childNode.setType(ATreeNode.ELEMENT_TYPE);
    XSTypeDefinition xstype=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition();
    if ((!dataType.equals("String_Node_Str")) && xstype instanceof XSComplexTypeDecl) {
      if (xstype.getName() == null)       addParticleAndAttributeInfo(childNode,(XSComplexTypeDecl)xstype,complexTypesRoot);
      ATreeNode n=findComplexElement(complexTypesRoot,dataType);
      if (n != null) {
        childNode.addChild(n.getChildren());
      }
    }
    node.addChild(childNode);
  }
}

Fixed version (ground truth):
/** 
 * @param node
 * @param complexTypesRoot
 * @param group
 * @throws OdaException
 */
private static void addElementToNode(ATreeNode node,ATreeNode complexTypesRoot,XSModelGroupImpl group,VisitingRecorder vr) throws OdaException {
  if (!vr.visit(node.getValue().toString()))   return;
  XSObjectList list=group.getParticles();
  for (int j=0; j < list.getLength(); j++) {
    if (((XSParticleDecl)list.item(j)).getTerm() instanceof XSModelGroupImpl) {
      addElementToNode(node,complexTypesRoot,(XSModelGroupImpl)((XSParticleDecl)list.item(j)).getTerm(),vr);
      continue;
    }
    ATreeNode childNode=new ATreeNode();
    childNode.setValue(((XSParticleDecl)list.item(j)).getTerm().getName());
    String dataType=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition().getName();
    if (dataType == null || dataType.length() == 0)     dataType=childNode.getValue().toString();
    childNode.setDataType(dataType);
    childNode.setType(ATreeNode.ELEMENT_TYPE);
    XSTypeDefinition xstype=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition();
    if ((!dataType.equals("String_Node_Str")) && xstype instanceof XSComplexTypeDecl) {
      if (xstype.getName() == null)       addParticleAndAttributeInfo(childNode,(XSComplexTypeDecl)xstype,complexTypesRoot,vr);
      ATreeNode n=findComplexElement(complexTypesRoot,dataType);
      if (n != null) {
        childNode.addChild(n.getChildren());
      }
    }
    node.addChild(childNode);
  }
}
Program: 77288
Project: 77288
Buggy source:
/** 
 * Add the particles and attributes that defined in an implicitly defined ComplexType to the node.
 * @param node
 * @param complexType
 * @throws OdaException 
 */
private static void addParticleAndAttributeInfo(ATreeNode node,XSComplexTypeDecl complexType,ATreeNode complexTypesRoot) throws OdaException {
  XSParticle particle=complexType.getParticle();
  if (particle != null) {
    addElementToNode(node,complexTypesRoot,(XSModelGroupImpl)particle.getTerm());
  }
  if (!includeAttribute)   return;
  XSAttributeGroupDecl group=complexType.getAttrGrp();
  if (group != null) {
    XSObjectList list=group.getAttributeUses();
    for (int j=0; j < list.getLength(); j++) {
      ATreeNode childNode=new ATreeNode();
      childNode.setValue(((XSAttributeUseImpl)list.item(j)).getAttrDeclaration().getName());
      childNode.setType(ATreeNode.ATTRIBUTE_TYPE);
      node.addChild(childNode);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add the particles and attributes that defined in an implicitly defined ComplexType to the node.
 * @param node
 * @param complexType
 * @throws OdaException 
 */
private static void addParticleAndAttributeInfo(ATreeNode node,XSComplexTypeDecl complexType,ATreeNode complexTypesRoot,VisitingRecorder vr) throws OdaException {
  if (!vr.visit(node.getValue().toString()))   return;
  XSParticle particle=complexType.getParticle();
  if (particle != null) {
    addElementToNode(node,complexTypesRoot,(XSModelGroupImpl)particle.getTerm(),vr);
  }
  if (!includeAttribute)   return;
  XSAttributeGroupDecl group=complexType.getAttrGrp();
  if (group != null) {
    XSObjectList list=group.getAttributeUses();
    for (int j=0; j < list.getLength(); j++) {
      ATreeNode childNode=new ATreeNode();
      childNode.setValue(((XSAttributeUseImpl)list.item(j)).getAttrDeclaration().getName());
      childNode.setType(ATreeNode.ATTRIBUTE_TYPE);
      node.addChild(childNode);
    }
  }
}
Program: 77290
Project: 77290
Buggy source:
protected Value resolveProperty(int index){
  CSSStylableElement parent=(CSSStylableElement)cell.getParent();
  IStyle pcs=null;
  if (parent != null) {
    pcs=parent.getComputedStyle();
  }
  IStyle s=cell.getStyle();
  Value sv=s == null ? null : (Value)s.getProperty(index);
  if (sv == null && columnStyle != null) {
    if (engine.isInheritedProperty(index) == false) {
      if (isBackgroundProperties(index)) {
        Value rowValue=null;
        if (rowStyle != null) {
          rowValue=(Value)rowStyle.getProperty(index);
        }
        if (rowValue == null) {
          sv=(Value)columnStyle.getProperty(index);
        }
      }
 else       if (index == STYLE_VERTICAL_ALIGN) {
        if (rowStyle != null) {
          sv=(Value)rowStyle.getProperty(index);
        }
        if (sv == null) {
          sv=(Value)columnStyle.getProperty(index);
        }
      }
 else {
        sv=(Value)columnStyle.getProperty(index);
      }
    }
  }
  Value cv=engine.resolveStyle(elt,index,sv,pcs);
  return cv;
}

Fixed version (ground truth):
protected Value resolveProperty(int index){
  CSSStylableElement parent=(CSSStylableElement)cell.getParent();
  IStyle pcs=null;
  if (parent != null) {
    pcs=parent.getComputedStyle();
  }
  IStyle s=cell.getStyle();
  Value sv=s == null ? null : (Value)s.getProperty(index);
  if (sv == null && columnStyle != null) {
    if (engine.isInheritedProperty(index) == false) {
      if (isBackgroundProperties(index)) {
        Value rowValue=null;
        if (rowStyle != null) {
          rowValue=(Value)rowStyle.getProperty(index);
        }
        if (rowValue == null) {
          sv=(Value)columnStyle.getProperty(index);
        }
      }
 else       if (index == STYLE_VERTICAL_ALIGN) {
        if (rowStyle != null) {
          sv=(Value)rowStyle.getProperty(index);
        }
        if (sv == null) {
          sv=(Value)columnStyle.getProperty(index);
        }
      }
 else {
        sv=(Value)columnStyle.getProperty(index);
      }
    }
 else {
      sv=(Value)rowStyle.getProperty(index);
      if (sv == null) {
        sv=(Value)columnStyle.getProperty(index);
      }
    }
  }
  Value cv=engine.resolveStyle(elt,index,sv,pcs);
  return cv;
}
Program: 77293
Project: 77293
Buggy source:
public URL getResource(String name){
  URL url=super.getResource(name);
  if (url == null) {
    return loader.getResource(name);
  }
  return url;
}

Fixed version (ground truth):
public URL getResource(String name){
  URL url=ApplicationClassLoader.class.getClassLoader().getResource(name);
  if (url == null) {
    if (loader == null) {
      createWrappedClassLoaders();
    }
    return loader.getResource(name);
  }
  return null;
}
Program: 77294
Project: 77294
Buggy source:
protected void createClassLoaderFromDesign(){
  IReportRunnable runnable=context.getRunnable();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    ArrayList urls=new ArrayList();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
    }
    if (urls.size() != 0) {
      URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
      ClassLoader parent=appClassLoader == null ? systemClassLoader : appClassLoader;
      designClassLoader=new URLClassLoader(jarUrls,parent);
    }
  }
}

Fixed version (ground truth):
protected ClassLoader createClassLoaderFromDesign(ClassLoader parent){
  IReportRunnable runnable=context.getRunnable();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    ArrayList urls=new ArrayList();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
    }
    if (urls.size() != 0) {
      URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
      return new URLClassLoader(jarUrls,parent);
    }
  }
  return parent;
}
Program: 77295
Project: 77295
Buggy source:
protected void createClassLoaderFromProperty(){
  systemClassLoader=ExecutionContext.class.getClassLoader();
  ArrayList urls=new ArrayList();
  for (int i=0; i < classPathes.length; i++) {
    String classPath=System.getProperty(classPathes[i]);
    if (classPath != null && classPath.length() != 0) {
      String[] jars=classPath.split(PROPERTYSEPARATOR,-1);
      if (jars != null && jars.length != 0) {
        for (int j=0; j < jars.length; j++) {
          File file=new File(jars[j]);
          try {
            urls.add(file.toURL());
          }
 catch (          MalformedURLException e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
  if (urls.size() != 0) {
    systemClassLoader=new URLClassLoader((URL[])urls.toArray(new URL[0]),systemClassLoader);
  }
}

Fixed version (ground truth):
protected ClassLoader createClassLoaderFromProperty(ClassLoader parent){
  ArrayList urls=new ArrayList();
  for (int i=0; i < classPathes.length; i++) {
    String classPath=System.getProperty(classPathes[i]);
    if (classPath != null && classPath.length() != 0) {
      String[] jars=classPath.split(PROPERTYSEPARATOR,-1);
      if (jars != null && jars.length != 0) {
        for (int j=0; j < jars.length; j++) {
          File file=new File(jars[j]);
          try {
            urls.add(file.toURL());
          }
 catch (          MalformedURLException e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
  if (urls.size() != 0) {
    return new URLClassLoader((URL[])urls.toArray(new URL[0]),parent);
  }
  return parent;
}
Program: 77296
Project: 77296
Buggy source:
public Class loadClass(String className) throws ClassNotFoundException {
  try {
    return super.loadClass(className);
  }
 catch (  ClassNotFoundException ex) {
    return loader.loadClass(className);
  }
}

Fixed version (ground truth):
public Class loadClass(String className) throws ClassNotFoundException {
  try {
    return Class.forName(className);
  }
 catch (  ClassNotFoundException ex) {
    if (loader == null) {
      createWrappedClassLoaders();
    }
    return loader.loadClass(className);
  }
}
Program: 77297
Project: 77297
Buggy source:
protected void createWrappedClassLoaders(){
}

Fixed version (ground truth):
protected void createWrappedClassLoaders(){
  ClassLoader root=getAppClassLoader();
  if (root == null) {
    root=ExecutionContext.class.getClassLoader();
  }
  loader=createClassLoaderFromProperty(root);
  loader=createClassLoaderFromDesign(loader);
}
Program: 77299
Project: 77299
Buggy source:
public boolean addArea(IArea area){
  assert(area instanceof RowArea);
  RowArea row=(RowArea)area;
  lastRowArea=row;
  return super.addArea(area);
}

Fixed version (ground truth):
public boolean addArea(IArea area){
  if (area instanceof RowArea) {
    lastRowArea=(RowArea)area;
  }
  return super.addArea(area);
}
Program: 77300
Project: 77300
Buggy source:
/** 
 * Sort the group array according to the values in sortKeys[] of GroupBoundaryInfo intances. within them.
 * @param groupArray
 */
void sortGroupBoundaryInfos(ArrayList[] groupArray){
  for (int i=0; i < groupArray.length; i++) {
    Object[] toBeSorted=new Object[groupArray[i].size()];
    for (int j=0; j < toBeSorted.length; j++) {
      toBeSorted[j]=groupArray[i].get(j);
    }
    Arrays.sort(toBeSorted,new GroupBoundaryInfoComparator());
    groupArray[i].clear();
    for (int j=0; j < toBeSorted.length; j++) {
      groupArray[i].add(toBeSorted[j]);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sort the group array according to the values in sortKeys[] of GroupBoundaryInfo intances. within them.
 * @param groupArray
 */
void sortGroupBoundaryInfos(List[] groupArray){
  for (int i=0; i < groupArray.length; i++) {
    Object[] toBeSorted=new Object[groupArray[i].size()];
    for (int j=0; j < toBeSorted.length; j++) {
      toBeSorted[j]=groupArray[i].get(j);
    }
    Arrays.sort(toBeSorted,new GroupBoundaryInfoComparator());
    groupArray[i].clear();
    for (int j=0; j < toBeSorted.length; j++) {
      groupArray[i].add(toBeSorted[j]);
    }
  }
}
Program: 77301
Project: 77301
Buggy source:
/** 
 * This method is used to filter out the GroupBoundaryInfo instances that are marked as "not accepted" from GroupBoundaryInfos.
 * @param groupArray
 * @return
 */
ArrayList[] filterGroupBoundaryInfos(ArrayList[] groupArray){
  ArrayList[] result=new ArrayList[groupArray.length];
  for (int i=0; i < result.length; i++) {
    result[i]=new ArrayList();
  }
  for (int i=0; i < groupArray.length; i++) {
    for (int j=0; j < groupArray[i].size(); j++) {
      if (((GroupBoundaryInfo)groupArray[i].get(j)).isAccpted()) {
        result[i].add(groupArray[i].get(j));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method is used to filter out the GroupBoundaryInfo instances that are marked as "not accepted" from GroupBoundaryInfos.
 * @param groupArray
 * @return
 */
List[] filterGroupBoundaryInfos(List[] groupArray){
  List[] result=new List[groupArray.length];
  for (int i=0; i < result.length; i++) {
    result[i]=new CachedList(GroupBoundaryInfo.getCreator());
  }
  for (int i=0; i < groupArray.length; i++) {
    for (int j=0; j < groupArray[i].size(); j++) {
      if (((GroupBoundaryInfo)groupArray[i].get(j)).isAccpted()) {
        result[i].add(groupArray[i].get(j));
      }
    }
  }
  return result;
}
Program: 77302
Project: 77302
Buggy source:
/** 
 * Releases the palette viewer from the edit domain
 * @see Page#dispose()
 */
public void dispose(){
  super.dispose();
  tree.dispose();
  treeCommon.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the palette viewer from the edit domain
 * @see Page#dispose()
 */
public void dispose(){
  tree.dispose();
  super.dispose();
}
Program: 77303
Project: 77303
Buggy source:
/** 
 * Creates the palette viewer and its control.
 * @see Page#createControl(org.eclipse.swt.widgets.Composite)
 */
public void createControl(Composite parent){
  if (getViewer() == null) {
    return;
  }
  tree=new Tree(parent,SWT.NONE);
  treeCommon.setTree(tree);
  treeCommon.setExpressionViewer(getViewer());
  treeCommon.createDefaultExpressionTree(SessionHandleAdapter.getInstance().getReportDesignHandle().getVisibleDataSets());
  treeCommon.addMouseTrackListener();
  treeCommon.addMouseListener();
  treeCommon.addDragSupportToTree();
  treeCommon.addDropSupportToViewer();
  tree.setToolTipText("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates the palette viewer and its control.
 * @see Page#createControl(org.eclipse.swt.widgets.Composite)
 */
public void createControl(Composite parent){
  if (getViewer() == null) {
    return;
  }
  tree=new Tree(parent,SWT.NONE);
  treeCommon.setTree(tree);
  treeCommon.setExpressionViewer(getViewer());
  treeCommon.createDefaultExpressionTree(SessionHandleAdapter.getInstance().getReportDesignHandle().getVisibleDataSets());
  treeCommon.addMouseTrackListener();
  treeCommon.addMouseListener();
  treeCommon.addDragSupportToTree();
  treeCommon.addDropSupportToViewer();
  tree.setToolTipText("String_Node_Str");
  tree.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      treeCommon.removeDropSupportToViewer();
    }
  }
);
}
Program: 77304
Project: 77304
Buggy source:
/** 
 * Adds drop support to viewer.Must set viewer before execution.
 */
public void addDropSupportToViewer(){
  Assert.isNotNull(expressionViewer);
  final StyledText text=expressionViewer.getTextWidget();
  dropTarget=new DropTarget(text,DND.DROP_COPY | DND.DROP_DEFAULT);
  dropTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
  dropTarget.addDropListener(new DropTargetAdapter(){
    public void dragEnter(    DropTargetEvent event){
      text.setFocus();
      if (event.detail == DND.DROP_DEFAULT)       event.detail=DND.DROP_COPY;
      if (event.detail != DND.DROP_COPY)       event.detail=DND.DROP_NONE;
    }
    public void dragOver(    DropTargetEvent event){
      event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_INSERT_BEFORE;
    }
    public void dragOperationChanged(    DropTargetEvent event){
      dragEnter(event);
    }
    public void drop(    DropTargetEvent event){
      if (event.data instanceof String)       insertText((String)event.data);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Adds drop support to viewer.Must set viewer before execution.
 */
public void addDropSupportToViewer(){
  Assert.isNotNull(expressionViewer);
  if (dropTarget == null || dropTarget.isDisposed()) {
    final StyledText text=expressionViewer.getTextWidget();
    dropTarget=new DropTarget(text,DND.DROP_COPY | DND.DROP_DEFAULT);
    dropTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
    dropTargetAdapter=new DropTargetAdapter(){
      public void dragEnter(      DropTargetEvent event){
        text.setFocus();
        if (event.detail == DND.DROP_DEFAULT)         event.detail=DND.DROP_COPY;
        if (event.detail != DND.DROP_COPY)         event.detail=DND.DROP_NONE;
      }
      public void dragOver(      DropTargetEvent event){
        event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_INSERT_BEFORE;
      }
      public void dragOperationChanged(      DropTargetEvent event){
        dragEnter(event);
      }
      public void drop(      DropTargetEvent event){
        if (event.data instanceof String)         insertText((String)event.data);
      }
    }
;
    dropTarget.addDropListener(dropTargetAdapter);
  }
}
Program: 77305
Project: 77305
Buggy source:
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle binding){
  String name=binding.getName();
  String expr=binding.getExpression();
  String type=binding.getDataType();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=new ScriptExpression(expr,dbType);
  dbExpr.setGroupName(binding.getAggregrateOn());
  transfer.getResultSetExpressions().put(name,dbExpr);
}

Fixed version (ground truth):
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle binding){
  String name=binding.getName();
  String expr=binding.getExpression();
  String type=binding.getDataType();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=new ScriptExpression(expr,dbType);
  dbExpr.setGroupName(binding.getAggregateOn());
  transfer.getResultSetExpressions().put(name,dbExpr);
}
Program: 77306
Project: 77306
Buggy source:
/** 
 * @param group a grouping in a list
 * @param handle handle to a grouping element
 */
protected void handleListingGroup(GroupDesign group,GroupHandle handle,Object value){
  IGroupDefinition groupDefn=handleGroup(group,handle);
  pushQuery(groupDefn);
  handleListingBand(group.getHeader(),value);
  handleListingBand(group.getFooter(),value);
  popQuery();
}

Fixed version (ground truth):
/** 
 * @param group a grouping in a list
 * @param handle handle to a grouping element
 */
protected void handleListingGroup(GroupDesign group,GroupHandle handle,Object value){
  IGroupDefinition groupDefn=handleGroup(group,handle);
  pushQuery(groupDefn);
  transformExpressions(group);
  handleListingBand(group.getHeader(),value);
  handleListingBand(group.getFooter(),value);
  popQuery();
}
Program: 77308
Project: 77308
Buggy source:
public boolean compose(){
  boolean hasMore;
  while (hasMore=hasMore() && !PDFTextLM.this.needPause()) {
    handleNext();
  }
  return hasMore;
}

Fixed version (ground truth):
public boolean compose(){
  boolean hasMore;
  while ((hasMore=hasMore()) && !PDFTextLM.this.needPause()) {
    handleNext();
  }
  return hasMore;
}