nus-yam/ex-repair huggingface dataset:
Program: 75669
Project: 75669
Buggy source:
/** 
 * Return the expression for the given binding column based on the given element
 * @param baseElement the base element
 * @param column the binding column
 * @return the expression for the column
 */
public static String getBindingexpression(DesignElementHandle baseElement,ComputedColumnHandle column){
  String exp=IReportElementConstants.BINDING_COLUMN_PREFIX;
  if (baseElement instanceof ExtendedItemHandle && ((ExtendedItemHandle)baseElement).getExtensionName().equals("String_Node_Str")) {
    exp=ExpressionUtil.DATA_INDICATOR;
  }
  for (int i=0; i < getBindingLevel(column.getElementHandle(),baseElement); i++) {
    exp+=IReportElementConstants.OUTER_BINDING_COLUMN_PREFIX;
  }
  exp+="String_Node_Str" + DEUtil.escape(column.getName()) + "String_Node_Str";
  return exp;
}

Fixed version (ground truth):
/** 
 * Return the expression for the given binding column based on the given element
 * @param baseElement the base element
 * @param column the binding column
 * @return the expression for the column
 */
public static String getBindingexpression(DesignElementHandle baseElement,ComputedColumnHandle column){
  String exp=IReportElementConstants.BINDING_COLUMN_PREFIX;
  if (isCrosstabElement(baseElement)) {
    exp=ExpressionUtil.DATA_INDICATOR;
  }
  for (int i=0; i < getBindingLevel(column.getElementHandle(),baseElement); i++) {
    exp+=IReportElementConstants.OUTER_BINDING_COLUMN_PREFIX;
  }
  exp+="String_Node_Str" + DEUtil.escape(column.getName()) + "String_Node_Str";
  return exp;
}
Program: 75671
Project: 75671
Buggy source:
/** 
 * Checks if current series can show outside values.
 * @return
 */
protected boolean isShowOutside(){
  return getAxis().getScale().isShowOutside();
}

Fixed version (ground truth):
/** 
 * Checks if current series can show outside values.
 * @return
 */
protected boolean isShowOutside(){
  return getAxis().isPercent() ? false : getAxis().getScale().isShowOutside();
}
Program: 75678
Project: 75678
Buggy source:
/** 
 * @param dirName
 * @param managerName
 * @throws IOException
 * @throws DataException
 */
private void create(String dirName,String managerName) throws IOException, DataException {
  documentObjectMap=new HashMap();
  File file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!new File(dirName).exists()) {
      new File(dirName).mkdirs();
    }
    if (!file.createNewFile()) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
    }
  }
  objectFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  objectFile.setLength(0);
  file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!file.createNewFile()) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
    }
  }
  OatFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  OatFile.setLength(0);
  file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!file.createNewFile()) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
    }
  }
  dataFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  dataFile.setLength(0);
}

Fixed version (ground truth):
/** 
 * @param dirName
 * @param managerName
 * @throws IOException
 * @throws DataException
 */
private void create(String dirName,String managerName) throws IOException, DataException {
  documentObjectMap=new HashMap();
  File file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!new File(dirName).exists()) {
      new File(dirName).mkdirs();
    }
    try {
      if (!file.createNewFile()) {
        throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
      }
    }
 catch (    IOException e) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,e,file.getAbsolutePath());
    }
  }
  objectFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  objectFile.setLength(0);
  file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!file.createNewFile()) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
    }
  }
  OatFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  OatFile.setLength(0);
  file=new File(dirName + File.separatorChar + managerName+ "String_Node_Str");
  if (!file.exists()) {
    if (!file.createNewFile()) {
      throw new DataException(ResourceConstants.OLAPFILE_CREATE_FAIL,file.getAbsolutePath());
    }
  }
  dataFile=new BufferedRandomAccessFile(file,"String_Node_Str",1024);
  dataFile.setLength(0);
}
Program: 75679
Project: 75679
Buggy source:
/** 
 * Moves down one segment from its current segment of the iterator.
 * @return
 * @throws IOException
 */
private boolean nextSegment() throws IOException {
  if (stopSign.isStopped()) {
    return false;
  }
  if (!traversalor.next()) {
    return false;
  }
  currentSubDim=traversalor.getIntArray();
  currentSegment=factTable.getDocumentManager().openDocumentObject(FTSUDocumentObjectNamingUtil.getDocumentObjectName(NamingUtil.getFactTableName(factTable.getName()),getSubDimensionIndex()));
  for (int i=0; i < dimensionIndex.length; i++) {
    if (dimensionIndex[i] != -1) {
      SelectedSubDimension selectedSubDimension=((SelectedSubDimension)selectedSubDim[i].get(currentSubDim[i]));
      selectedPosOfCurSegment[i]=new int[selectedSubDimension.end - selectedSubDimension.start + 1];
      for (int j=0; j < selectedSubDimension.end - selectedSubDimension.start + 1; j++) {
        selectedPosOfCurSegment[i][j]=((Integer)selectedPos[dimensionIndex[i]].get(j)).intValue();
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Moves down one segment from its current segment of the iterator.
 * @return
 * @throws IOException
 */
private boolean nextSegment() throws IOException {
  if (stopSign.isStopped()) {
    return false;
  }
  if (!traversalor.next()) {
    return false;
  }
  currentSubDim=traversalor.getIntArray();
  currentSegment=factTable.getDocumentManager().openDocumentObject(FTSUDocumentObjectNamingUtil.getDocumentObjectName(NamingUtil.getFactTableName(factTable.getName()),getSubDimensionIndex()));
  for (int i=0; i < dimensionIndex.length; i++) {
    if (dimensionIndex[i] != -1) {
      SelectedSubDimension selectedSubDimension=((SelectedSubDimension)selectedSubDim[i].get(currentSubDim[i]));
      selectedPosOfCurSegment[i]=new int[selectedSubDimension.end - selectedSubDimension.start + 1];
      for (int j=0; j < selectedSubDimension.end - selectedSubDimension.start + 1; j++) {
        selectedPosOfCurSegment[i][j]=((Integer)selectedPos[dimensionIndex[i]].get(selectedSubDimension.start + j)).intValue();
      }
    }
  }
  return true;
}
Program: 75681
Project: 75681
Buggy source:
public ParameterDefinition(long id,String name,String pattern,String displayFormat,String displayName,String helpText,String promptText,int dataType,String valueExpr,int controlType,boolean hidden,boolean allowNull,boolean allowBlank,boolean isRequired,boolean mustMatch,boolean concealValue,ParameterGroupDefinition group,Collection selectionList){
  this.id=id;
  this.name=name;
  this.pattern=pattern;
  this.displayFormat=displayFormat;
  this.displayName=displayName;
  this.helpText=helpText;
  this.promptText=promptText;
  this.dataType=dataType;
  this.valueExpr=valueExpr;
  this.controlType=controlType;
  this.hidden=hidden;
  this.allowNull=allowNull;
  this.allowBlank=allowBlank;
  this.isRequired=isRequired;
  this.mustMatch=mustMatch;
  this.concealValue=concealValue;
  this.group=group;
  this.selectionList=selectionList;
}

Fixed version (ground truth):
public ParameterDefinition(long id,String name,String pattern,String displayFormat,String displayName,String helpText,String promptText,int dataType,String valueExpr,int controlType,boolean hidden,boolean allowNull,boolean allowBlank,boolean isRequired,boolean mustMatch,boolean concealValue,boolean distinct,ParameterGroupDefinition group,Collection selectionList){
  this.id=id;
  this.name=name;
  this.pattern=pattern;
  this.displayFormat=displayFormat;
  this.displayName=displayName;
  this.helpText=helpText;
  this.promptText=promptText;
  this.dataType=dataType;
  this.valueExpr=valueExpr;
  this.controlType=controlType;
  this.hidden=hidden;
  this.allowNull=allowNull;
  this.allowBlank=allowBlank;
  this.isRequired=isRequired;
  this.mustMatch=mustMatch;
  this.concealValue=concealValue;
  this.distinct=distinct;
  this.group=group;
  this.selectionList=selectionList;
}
Program: 75697
Project: 75697
Buggy source:
/** 
 * @param name
 * @param dimensions
 * @param factTable
 * @param measureColumns
 * @param stopSign
 * @return
 * @throws IOException
 * @throws BirtException
 */
public void createCube(String name,IDimension[] dimensions,IDatasetIterator factTable,String[] measureColumns,StopSign stopSign) throws IOException, BirtException {
  if (stopSign == null) {
    stopSign=new StopSign();
  }
  Cube cube=new Cube(name,documentManager);
  cube.create(dimensions,factTable,measureColumns,stopSign);
  cube.close();
  documentManager.flush();
}

Fixed version (ground truth):
/** 
 * @param name
 * @param dimensions
 * @param factTable
 * @param measureColumns
 * @param stopSign
 * @return
 * @throws IOException
 * @throws BirtException
 */
public void createCube(String name,String[][] keyColumnNames,IDimension[] dimensions,IDatasetIterator factTable,String[] measureColumns,StopSign stopSign) throws IOException, BirtException {
  if (stopSign == null) {
    stopSign=new StopSign();
  }
  Cube cube=new Cube(name,documentManager);
  cube.create(keyColumnNames,dimensions,factTable,measureColumns,stopSign);
  cube.close();
  documentManager.flush();
}
Program: 75698
Project: 75698
Buggy source:
/** 
 * @param dimension
 * @param iterator
 * @param measureColumnName
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void create(IDimension[] dimension,IDatasetIterator iterator,String[] measureColumnName,StopSign stopSign) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getCubeDocName(name));
  documentObject.writeString(name);
  documentObject.writeInt(dimension.length);
  for (int i=0; i < dimension.length; i++) {
    documentObject.writeString(dimension[i].getName());
  }
  this.dimension=dimension;
  Dimension[] tDimensions=new Dimension[dimension.length];
  for (int i=0; i < tDimensions.length; i++) {
    tDimensions[i]=(Dimension)dimension[i];
  }
  FactTableAccessor factTableConstructor=new FactTableAccessor(documentManager);
  factTable=factTableConstructor.saveFactTable(name,iterator,tDimensions,measureColumnName,stopSign);
  documentObject.close();
  documentManager.flush();
}

Fixed version (ground truth):
/** 
 * @param dimension
 * @param iterator
 * @param measureColumnName
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void create(String[][] keyColumnNames,IDimension[] dimension,IDatasetIterator iterator,String[] measureColumnName,StopSign stopSign) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getCubeDocName(name));
  documentObject.writeString(name);
  documentObject.writeInt(dimension.length);
  for (int i=0; i < dimension.length; i++) {
    documentObject.writeString(dimension[i].getName());
  }
  this.dimension=dimension;
  Dimension[] tDimensions=new Dimension[dimension.length];
  for (int i=0; i < tDimensions.length; i++) {
    tDimensions[i]=(Dimension)dimension[i];
  }
  FactTableAccessor factTableConstructor=new FactTableAccessor(documentManager);
  factTable=factTableConstructor.saveFactTable(name,keyColumnNames,iterator,tDimensions,measureColumnName,stopSign);
  documentObject.close();
  documentManager.flush();
}
Program: 75700
Project: 75700
Buggy source:
/** 
 * @return
 */
private Vector populateValueVector(AggrSortDefinition aggrSortDefinition){
  Set valueSet=new HashSet();
  if (aggrSortDefinition != null) {
    boolean aggrSortDirection=aggrSortDefinition.getDirection();
    if (aggrSortDirection)     aggrSortType=IDimensionSortDefn.SORT_ASC;
 else     aggrSortType=IDimensionSortDefn.SORT_DESC;
  }
  for (int i=0; i < this.rs.length(); i++) {
    try {
      this.rs.seek(i);
    }
 catch (    IOException e) {
    }
    valueSet.add(this.rs.getLevelKeyValue(levelIndex)[0]);
  }
  final int sortType=this.rs.getSortType(levelIndex);
  Object[] value=valueSet.toArray();
  Arrays.sort(value,new Comparator(){
    public int compare(    final Object arg0,    final Object arg1){
      if (sortType == IDimensionSortDefn.SORT_ASC || sortType == IDimensionSortDefn.SORT_UNDEFINED)       return ((Comparable)arg0).compareTo(arg1);
 else       return ((Comparable)arg0).compareTo(arg1) * -1;
    }
  }
);
  Vector v=new Vector();
  v.addAll(Arrays.asList(value));
  return v;
}

Fixed version (ground truth):
/** 
 * @return
 */
private Vector populateValueVector(AggrSortDefinition aggrSortDefinition){
  Set valueSet=new HashSet();
  if (aggrSortDefinition != null) {
    boolean aggrSortDirection=aggrSortDefinition.getDirection();
    if (aggrSortDirection)     aggrSortType=IDimensionSortDefn.SORT_ASC;
 else     aggrSortType=IDimensionSortDefn.SORT_DESC;
  }
  for (int i=0; i < this.rs.length(); i++) {
    try {
      this.rs.seek(i);
    }
 catch (    IOException e) {
    }
    valueSet.add(this.rs.getLevelKeyValue(levelIndex)[this.rs.getLevelKeyColCount(levelIndex) - 1]);
  }
  final int sortType=this.rs.getSortType(levelIndex);
  Object[] value=valueSet.toArray();
  Arrays.sort(value,new Comparator(){
    public int compare(    final Object arg0,    final Object arg1){
      if (sortType == IDimensionSortDefn.SORT_ASC || sortType == IDimensionSortDefn.SORT_UNDEFINED)       return ((Comparable)arg0).compareTo(arg1);
 else       return ((Comparable)arg0).compareTo(arg1) * -1;
    }
  }
);
  Vector v=new Vector();
  v.addAll(Arrays.asList(value));
  return v;
}
Program: 75702
Project: 75702
Buggy source:
/** 
 * Handle HTTP POST method.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 * @return
 */
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (!__authenticate(request,response)) {
    return;
  }
  IContext context=null;
  try {
    context=__getContext(request,response);
  }
 catch (  BirtException e) {
    __handleNonSoapException(request,response,e);
    return;
  }
  try {
    __doPost(context);
    String requestType=request.getHeader(ParameterAccessor.HEADER_REQUEST_TYPE);
    if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(requestType)) {
      super.doPost(request,response);
    }
 else {
      doGet(request,response);
    }
  }
 catch (  BirtException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Handle HTTP POST method.
 * @param request incoming http request
 * @param response http response
 * @exception ServletException
 * @exception IOException
 * @return
 */
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (!__authenticate(request,response)) {
    return;
  }
  StringBuilder builder=new StringBuilder();
  Iterator it=request.getParameterMap().keySet().iterator();
  while (it.hasNext()) {
    String paramName=(String)it.next();
    if (paramName != null && paramName.startsWith("String_Node_Str")) {
      String paramValue=ParameterAccessor.urlEncode(ParameterAccessor.getParameter(request,paramName),ParameterAccessor.UTF_8_ENCODE);
      builder.append("String_Node_Str" + paramName + "String_Node_Str"+ paramValue);
    }
  }
  String soapURL=request.getRequestURL().toString();
  if (request.getQueryString() != null) {
    soapURL+="String_Node_Str" + request.getQueryString() + builder.toString();
  }
 else {
    builder.deleteCharAt(0);
    soapURL+="String_Node_Str" + builder.toString();
  }
  request.setAttribute("String_Node_Str",soapURL);
  IContext context=null;
  try {
    context=__getContext(request,response);
  }
 catch (  BirtException e) {
    __handleNonSoapException(request,response,e);
    return;
  }
  try {
    __doPost(context);
    String requestType=request.getHeader(ParameterAccessor.HEADER_REQUEST_TYPE);
    if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(requestType)) {
      super.doPost(request,response);
    }
 else {
      doGet(request,response);
    }
  }
 catch (  BirtException e) {
    e.printStackTrace();
  }
}
Program: 75703
Project: 75703
Buggy source:
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static String getReferencedScriptObject(String expr,String objectName){
  Context cx=Context.enter();
  CompilerEnvirons ce=new CompilerEnvirons();
  Parser p=new Parser(ce,cx.getErrorReporter());
  ScriptOrFnNode tree=p.parse(expr,null,0);
  return getScriptObjectName(tree,objectName);
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static String getReferencedScriptObject(String expr,String objectName){
  if (expr == null)   return null;
  Context cx=Context.enter();
  CompilerEnvirons ce=new CompilerEnvirons();
  Parser p=new Parser(ce,cx.getErrorReporter());
  ScriptOrFnNode tree=p.parse(expr,null,0);
  return getScriptObjectName(tree,objectName);
}
Program: 75704
Project: 75704
Buggy source:
/** 
 * Utility method to acquire referable bindings, either in cube filter or cube sort.
 * @param targetLevel
 * @param bindings
 * @param isSort
 * @return
 * @throws AdapterException
 */
public abstract List getReferableBindings(String targetLevel,ICubeQueryDefinition cubeQueryDefn,boolean isSort) throws AdapterException ;

Fixed version (ground truth):
/** 
 * Utility method to acquire referable bindings, either in cube filter or cube sort.
 * @param targetLevel
 * @param bindings
 * @param isSort
 * @return
 * @throws AdapterException
 */
public List getReferableBindings(String targetLevel,ICubeQueryDefinition cubeQueryDefn,boolean isSort) throws AdapterException ;
Program: 75705
Project: 75705
Buggy source:
/** 
 * Return a list of ILevelDefinition instances that referenced by 
 * @param targetLevel
 * @param bindingExpr
 * @param queryDefn
 * @return
 * @throws AdapterException
 */
public abstract List getReferencedLevels(String targetLevel,String bindingExpr,ICubeQueryDefinition queryDefn) throws AdapterException ;

Fixed version (ground truth):
/** 
 * Return a list of ILevelDefinition instances that referenced by 
 * @param targetLevel
 * @param bindingExpr
 * @param queryDefn
 * @return
 * @throws AdapterException
 */
public List getReferencedLevels(String targetLevel,String bindingExpr,ICubeQueryDefinition queryDefn) throws AdapterException ;
Program: 75706
Project: 75706
Buggy source:
protected void repeatHeader(){
  if (!isFirstLayout) {
    IGroupContent group=(IGroupContent)content;
    IBandContent header=group.getHeader();
    if (group.isHeaderRepeat() && header != null) {
      boolean pageBreak=context.allowPageBreak();
      context.setAllowPageBreak(false);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.continueContent(null);
    }
  }
  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 isEmpty=context.isPageEmpty();
      context.setPageEmpty(true);
      context.setAllowPageBreak(false);
      engine.layout(this,header,emitter);
      context.setAllowPageBreak(pageBreak);
      context.setPageEmpty(isEmpty);
      context.continueContent(null);
    }
  }
  isFirstLayout=false;
}
Program: 75707
Project: 75707
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();
        context.setAllowPageBreak(pageBreak);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.continueContent(null);
      }
    }
  }
  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 isEmpty=context.isPageEmpty();
        context.setPageEmpty(true);
        context.setAllowPageBreak(pageBreak);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setPageEmpty(isEmpty);
        context.continueContent(null);
      }
    }
  }
  isFirstLayout=false;
}
Program: 75708
Project: 75708
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();
        context.setAllowPageBreak(false);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.continueContent(null);
      }
    }
  }
  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 isEmpty=context.isPageEmpty();
        context.setPageEmpty(true);
        context.setAllowPageBreak(false);
        engine.layout(this,header,emitter);
        context.setAllowPageBreak(pageBreak);
        context.setPageEmpty(isEmpty);
        context.continueContent(null);
      }
    }
  }
  isFirstLayout=false;
}
Program: 75710
Project: 75710
Buggy source:
/** 
 * @return
 * @throws IOException
 * @throws DataException
 */
IDiskArray getResult() throws IOException, DataException {
  if (currentResultObj != null && accumulators != null) {
    currentResultObj.setAggregationValues(new Object[accumulators.length]);
    for (int i=0; i < accumulators.length; i++) {
      accumulators[i].finish();
      currentResultObj.getAggregationValues()[i]=accumulators[i].getValue();
      accumulators[i].start();
    }
  }
  if (currentResultObj != null)   result.add(currentResultObj);
 else   result.add(new AggregationResultRow());
  return this.result;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 * @throws DataException
 */
IDiskArray getResult() throws IOException, DataException {
  if (currentResultObj != null && accumulators != null) {
    currentResultObj.setAggregationValues(new Object[accumulators.length]);
    for (int i=0; i < accumulators.length; i++) {
      accumulators[i].finish();
      currentResultObj.getAggregationValues()[i]=accumulators[i].getValue();
      accumulators[i].start();
    }
  }
  if (currentResultObj != null)   result.add(currentResultObj);
  return this.result;
}
Program: 75712
Project: 75712
Buggy source:
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION).getChoices();
}

Fixed version (ground truth):
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices().getChoices();
}
Program: 75713
Project: 75713
Buggy source:
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION));
}

Fixed version (ground truth):
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices());
}
Program: 75723
Project: 75723
Buggy source:
private List getEdgeSort(int edgeType){
  List l=this.defn.getSorts();
  List result=new ArrayList();
  for (int i=0; i < l.size(); i++) {
    if (!(l.get(i) instanceof ICubeSortDefinition))     continue;
    ICubeSortDefinition sort=(ICubeSortDefinition)l.get(i);
    if (this.defn.getEdge(edgeType).getDimensions().contains(sort.getTargetLevel().getHierarchy().getDimension())) {
      result.add(sort);
    }
  }
  Collections.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      int level1=((ICubeSortDefinition)arg0).getTargetLevel().getHierarchy().getLevels().indexOf(((ICubeSortDefinition)arg0).getTargetLevel());
      int level2=((ICubeSortDefinition)arg1).getTargetLevel().getHierarchy().getLevels().indexOf(((ICubeSortDefinition)arg1).getTargetLevel());
      if (level1 == level2)       return 0;
 else       if (level1 < level2)       return -1;
 else       return 1;
    }
  }
);
  return result;
}

Fixed version (ground truth):
private List getEdgeSort(int edgeType){
  List l=this.defn.getSorts();
  List result=new ArrayList();
  for (int i=0; i < l.size(); i++) {
    ICubeSortDefinition sort=(ICubeSortDefinition)l.get(i);
    if (this.defn.getEdge(edgeType).getDimensions().contains(sort.getTargetLevel().getHierarchy().getDimension())) {
      result.add(sort);
    }
  }
  Collections.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      int level1=((ICubeSortDefinition)arg0).getTargetLevel().getHierarchy().getLevels().indexOf(((ICubeSortDefinition)arg0).getTargetLevel());
      int level2=((ICubeSortDefinition)arg1).getTargetLevel().getHierarchy().getLevels().indexOf(((ICubeSortDefinition)arg1).getTargetLevel());
      if (level1 == level2)       return 0;
 else       if (level1 < level2)       return -1;
 else       return 1;
    }
  }
);
  return result;
}
Program: 75727
Project: 75727
Buggy source:
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION).getChoices();
}

Fixed version (ground truth):
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices().getChoices();
}
Program: 75728
Project: 75728
Buggy source:
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION));
}

Fixed version (ground truth):
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices());
}
Program: 75729
Project: 75729
Buggy source:
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION).getChoices();
}

Fixed version (ground truth):
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices().getChoices();
}
Program: 75730
Project: 75730
Buggy source:
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION));
}

Fixed version (ground truth):
public String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices());
}
Program: 75733
Project: 75733
Buggy source:
/** 
 * Get methods with specified comparator
 * @param classInfo
 * @param comp The comparator
 * @return List of methods
 */
public static List getMethods(IClassInfo classInfo,Comparator comp){
  List methods=new ArrayList(classInfo.getMethods());
  Collections.sort(methods,comp);
  return methods;
}

Fixed version (ground truth):
/** 
 * Get methods with specified comparator
 * @param classInfo
 * @param comp The comparator
 * @return List of methods
 */
public static List getMethods(IClassInfo classInfo,Comparator comp){
  List methods=classInfo.getMethods();
  Collections.sort(methods,comp);
  return methods;
}
Program: 75734
Project: 75734
Buggy source:
/** 
 * Get classes with specified comparator
 * @param comp the coparator
 * @return List of classes
 */
public static List getClasses(Comparator comp){
  List classes=new ArrayList(getMetaDataDictionary().getClasses());
  Collections.sort(classes,comp);
  classes.remove(TOTAL_CLASS);
  return classes;
}

Fixed version (ground truth):
/** 
 * Get classes with specified comparator
 * @param comp the coparator
 * @return List of classes
 */
public static List getClasses(Comparator comp){
  List classes=getMetaDataDictionary().getClasses();
  Collections.sort(classes,comp);
  return classes;
}
Program: 75735
Project: 75735
Buggy source:
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION).getChoices();
}

Fixed version (ground truth):
private IChoice[] getFunctions(){
  return DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices().getChoices();
}
Program: 75736
Project: 75736
Buggy source:
private String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_MEASURE_FUNCTION));
}

Fixed version (ground truth):
private String getFunctionDisplayName(String name){
  return ChoiceSetFactory.getDisplayNameFromChoiceSet(name,DEUtil.getMetaDataDictionary().getElement(ReportDesignConstants.MEASURE_ELEMENT).getProperty(IMeasureModel.FUNCTION_PROP).getAllowedChoices());
}
Program: 75737
Project: 75737
Buggy source:
public IContent execute(){
  if (executed) {
    return content;
  }
  context.setExecutingMasterPage(true);
  context.setPageNumber(pageNumber);
  executed=true;
  try {
    long pageNo=pageNumber;
    PageHintReader hintReader=manager.getPageHintReader();
    long totalPage=hintReader.getTotalPage();
    if (pageNumber > totalPage) {
      pageNo=totalPage;
    }
    IPageHint hint=hintReader.getPageHint(pageNo);
    pageOffset=hint.getOffset();
    CachedReportContentReaderV3 pageReader=manager.getPageReader();
    content=pageReader.loadContent(pageOffset);
    InstanceID iid=content.getInstanceID();
    long id=iid.getComponentID();
    masterPage=(SimpleMasterPageDesign)context.getReport().getReportItemByID(id);
    content.setGenerateBy(design);
    IPageContent pageContent=(IPageContent)content;
    pageContent.setPageNumber(pageNumber);
    return content;
  }
 catch (  IOException ex) {
    context.addException(new EngineException(ex.getLocalizedMessage(),ex));
  }
  return null;
}

Fixed version (ground truth):
public IContent execute(){
  if (executed) {
    return content;
  }
  context.setExecutingMasterPage(true);
  context.setPageNumber(pageNumber);
  executed=true;
  try {
    long pageNo=pageNumber;
    PageHintReader hintReader=manager.getPageHintReader();
    long totalPage=hintReader.getTotalPage();
    if (pageNumber > totalPage) {
      pageNo=totalPage;
    }
    IPageHint hint=hintReader.getPageHint(pageNo);
    pageOffset=hint.getOffset();
    CachedReportContentReaderV3 pageReader=manager.getPageReader();
    content=pageReader.loadContent(pageOffset);
    InstanceID iid=content.getInstanceID();
    long id=iid.getComponentID();
    masterPage=(SimpleMasterPageDesign)context.getReport().getReportItemByID(id);
    content.setGenerateBy(masterPage);
    IPageContent pageContent=(IPageContent)content;
    pageContent.setPageNumber(pageNumber);
    return content;
  }
 catch (  IOException ex) {
    context.addException(new EngineException(ex.getLocalizedMessage(),ex));
  }
  return null;
}
Program: 75739
Project: 75739
Buggy source:
protected Object3D getObjectFromEvent(Object event){
  if (event instanceof WrappedInstruction) {
    event=((WrappedInstruction)event).getEvent();
  }
  if (event instanceof I3DRenderEvent) {
    try {
      if (event instanceof Area3DRenderEvent) {
        return ((I3DRenderEvent)((Area3DRenderEvent)event).getElement(0)).getObject3D();
      }
 else {
        return ((I3DRenderEvent)event).getObject3D();
      }
    }
 catch (    ChartException ex) {
      throw new RuntimeException(ex);
    }
  }
 else {
    throw new IllegalArgumentException();
  }
}

Fixed version (ground truth):
protected Object3D getObjectFromEvent(Object event){
  if (event instanceof WrappedInstruction) {
    event=((WrappedInstruction)event).getEvent();
  }
  if (event instanceof I3DRenderEvent) {
    if (event instanceof Area3DRenderEvent) {
      return ((I3DRenderEvent)((Area3DRenderEvent)event).getElement(0)).getObject3D();
    }
 else {
      return ((I3DRenderEvent)event).getObject3D();
    }
  }
 else {
    throw new IllegalArgumentException();
  }
}
Program: 75741
Project: 75741
Buggy source:
/** 
 * Returns if current object is totally aside the given object. "outside" is along the direction of the viewer vector.
 */
protected boolean testAside(Object3D comparedObj,boolean outside,Engine3D engine){
  int thisPointsNumber=viewVa.length;
  int comparedPointsNumber=comparedObj.getViewerVectors().length;
  Vector[] thisPoints=viewVa;
  Vector[] comparedPoints=comparedObj.getViewerVectors();
  if (thisPointsNumber == 0 || comparedPointsNumber == 0) {
    return true;
  }
  if (thisPointsNumber < 3 && comparedPointsNumber < 3) {
    return true;
  }
  Vector normal=null;
  Vector ov=viewVa[0];
  double d=0;
  if (thisPointsNumber < 3 || comparedPointsNumber < 3) {
    return true;
  }
 else {
    normal=new Vector(getNormal());
    d=-normal.scalarProduct(ov);
    return testPolygon(normal,d,comparedObj,outside);
  }
}

Fixed version (ground truth):
/** 
 * Returns if current object is totally aside the given object. "outside" is along the direction of the viewer vector.
 */
protected boolean testAside(Object3D comparedObj,boolean outside,Engine3D engine){
  int thisPointsNumber=viewVa.length;
  int comparedPointsNumber=comparedObj.getViewerVectors().length;
  if (thisPointsNumber == 0 || comparedPointsNumber == 0) {
    return true;
  }
  if (thisPointsNumber < 3 && comparedPointsNumber < 3) {
    return true;
  }
  Vector normal=null;
  Vector ov=viewVa[0];
  double d=0;
  if (thisPointsNumber < 3 || comparedPointsNumber < 3) {
    return true;
  }
 else {
    normal=new Vector(getNormal());
    d=-normal.scalarProduct(ov);
    return testPolygon(normal,d,comparedObj,outside);
  }
}
Program: 75745
Project: 75745
Buggy source:
private ICubeQueryDefinition createCubeQueryDefinition(){
  ICubeQueryDefinition cubeQuery=CubeElementFactory.createCubeQuery("String_Node_Str");
  IEdgeDefinition columnEdge=cubeQuery.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  cubeQuery.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dimension1=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dimension1.createHierarchy("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  return cubeQuery;
}

Fixed version (ground truth):
private ICubeQueryDefinition createCubeQueryDefinition(){
  ICubeQueryDefinition cubeQuery=new CubeElementFactory().createCubeQuery("String_Node_Str");
  IEdgeDefinition columnEdge=cubeQuery.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  cubeQuery.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dimension1=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dimension1.createHierarchy("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  return cubeQuery;
}
Program: 75746
Project: 75746
Buggy source:
/** 
 * Gets the width of the specified word.
 * @param word the word
 * @return the points of the width
 */
public float getWordWidth(String word){
  if (bf == null)   return 0;
  return bf.getWidthPoint(word,fontSize);
}

Fixed version (ground truth):
/** 
 * Gets the width of the specified word.
 * @param word the word
 * @return the points of the width
 */
public float getWordWidth(String word){
  if (bf == null || word == null)   return 0;
  return bf.getWidthPoint(word,fontSize);
}
Program: 75747
Project: 75747
Buggy source:
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getCubeMeasureName());
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}

Fixed version (ground truth):
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getIndex());
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}
Program: 75748
Project: 75748
Buggy source:
/** 
 * @return
 */
int getVersion(){
  int version=this.getLatestVersion();
  if (dataEngineContext.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=VERSION_2_0;
    return version;
  }
  try {
    DataInputStream is=new DataInputStream(dataEngineContext.getInputStream(null,null,DataEngineContext.VERSION_INFO_STREAM));
    version=IOUtil.readInt(is);
  }
 catch (  DataException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return version;
}

Fixed version (ground truth):
/** 
 * @return
 */
int getVersion(){
  int version=this.getLatestVersion();
  if (dataEngineContext.hasInStream(null,null,DataEngineContext.VERSION_INFO_STREAM) == false) {
    version=VERSION_2_0;
    return version;
  }
  try {
    DataInputStream is=new DataInputStream(dataEngineContext.getInputStream(null,null,DataEngineContext.VERSION_INFO_STREAM));
    version=IOUtil.readInt(is);
    is.close();
  }
 catch (  DataException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return version;
}
Program: 75752
Project: 75752
Buggy source:
/** 
 * Get methods with specified comparator
 * @param classInfo
 * @param comp The comparator
 * @return List of methods
 */
public static List getMethods(IClassInfo classInfo,Comparator comp){
  List methods=classInfo.getMethods();
  Collections.sort(methods,comp);
  return methods;
}

Fixed version (ground truth):
/** 
 * Get methods with specified comparator
 * @param classInfo
 * @param comp The comparator
 * @return List of methods
 */
public static List getMethods(IClassInfo classInfo,Comparator comp){
  List methods=new ArrayList(classInfo.getMethods());
  Collections.sort(methods,comp);
  return methods;
}
Program: 75753
Project: 75753
Buggy source:
/** 
 * Get classes with specified comparator
 * @param comp the coparator
 * @return List of classes
 */
public static List getClasses(Comparator comp){
  List classes=getMetaDataDictionary().getClasses();
  Collections.sort(classes,comp);
  return classes;
}

Fixed version (ground truth):
/** 
 * Get classes with specified comparator
 * @param comp the coparator
 * @return List of classes
 */
public static List getClasses(Comparator comp){
  List classes=new ArrayList(getMetaDataDictionary().getClasses());
  Collections.sort(classes,comp);
  classes.remove(TOTAL_CLASS);
  return classes;
}
Program: 75755
Project: 75755
Buggy source:
protected void initialize(){
  boolean isNewArea=(root == null);
  createRoot();
  if (isNewArea) {
    IStyle areaStyle=root.getStyle();
    validateBoxProperty(areaStyle,parent.getCurrentMaxContentWidth(),context.getMaxHeight());
    setOffsetX(root.getContentX());
    setOffsetY(isFirst ? root.getContentY() : 0);
    int maxWidth=parent.getCurrentMaxContentWidth();
    int leftWidth=maxWidth - parent.getCurrentIP();
    calculateSpecifiedWidth();
    int width=0;
    if (specifiedWidth > 0) {
      width=Math.min(specifiedWidth,maxWidth);
    }
 else {
      if (leftWidth > maxWidth / 4) {
        width=leftWidth;
      }
 else {
        width=maxWidth;
      }
    }
    root.setAllocatedWidth(width);
    setCurrentBP(0);
    setCurrentIP(0);
  }
  maxAvaWidth=root.getContentWidth();
  root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  maxAvaHeight=root.getContentHeight();
}

Fixed version (ground truth):
protected void initialize(){
  boolean isNewArea=(root == null);
  createRoot();
  if (isNewArea) {
    IStyle areaStyle=root.getStyle();
    validateBoxProperty(areaStyle,parent.getCurrentMaxContentWidth(),context.getMaxHeight());
    setOffsetX(root.getContentX());
    setOffsetY(isFirst ? root.getContentY() : 0);
    int maxWidth=parent.getCurrentMaxContentWidth();
    calculateSpecifiedWidth();
    int width=maxWidth;
    if (specifiedWidth > 0) {
      width=Math.min(specifiedWidth,maxWidth);
    }
    root.setAllocatedWidth(width);
    setCurrentBP(0);
    setCurrentIP(0);
  }
  maxAvaWidth=root.getContentWidth();
  root.setAllocatedHeight(parent.getCurrentMaxContentHeight());
  maxAvaHeight=root.getContentHeight();
}
Program: 75756
Project: 75756
Buggy source:
protected void processForeignData(IForeignContent foreign){
  if (foreign.getChildren() != null && foreign.getChildren().size() > 0) {
    return;
  }
  HashMap styleMap=new HashMap();
  HTMLStyleProcessor htmlProcessor=new HTMLStyleProcessor(report);
  Object rawValue=foreign.getRawValue();
  Document doc=null;
  if (null != rawValue) {
    doc=new TextParser().parse(foreign.getRawValue().toString(),(String)textTypeMapping.get(foreign.getRawType()));
  }
  Element body=null;
  if (doc != null) {
    Node node=doc.getFirstChild();
    if (node instanceof Element) {
      body=(Element)node;
    }
  }
  if (body != null) {
    htmlProcessor.execute(body,styleMap);
    processNodes(body,checkEscapeSpace(doc),styleMap,foreign);
  }
}

Fixed version (ground truth):
protected void processForeignData(IForeignContent foreign){
  if (foreign.getChildren() != null && foreign.getChildren().size() > 0) {
    return;
  }
  HashMap styleMap=new HashMap();
  HTMLStyleProcessor htmlProcessor=new HTMLStyleProcessor(report);
  Object rawValue=foreign.getRawValue();
  Document doc=null;
  if (null != rawValue) {
    doc=new TextParser().parse(foreign.getRawValue().toString(),(String)textTypeMapping.get(foreign.getRawType()));
  }
  Element body=null;
  if (doc != null) {
    Node node=doc.getFirstChild();
    if (node instanceof Element) {
      body=(Element)node;
    }
  }
  if (body != null) {
    htmlProcessor.execute(body,styleMap);
    IContainerContent container=new ContainerContent((ReportContent)foreign.getReportContent());
    addChild(foreign,container);
    processNodes(body,checkEscapeSpace(doc),styleMap,container);
  }
}
Program: 75758
Project: 75758
Buggy source:
/** 
 * Outputs the A element
 * @param ele the A element instance
 */
protected void handleAnchor(Element ele,IContent content){
  if (ele.getAttribute("String_Node_Str").trim().length() != 0) {
    content.setBookmark(ele.getAttribute("String_Node_Str"));
  }
 else {
    content.setBookmark(ele.getAttribute("String_Node_Str"));
  }
  if (ele.getAttribute("String_Node_Str").length() > 0) {
    String href=ele.getAttribute("String_Node_Str");
    if (null != href && !"String_Node_Str".equals(href)) {
      ActionContent action=new ActionContent();
      if (href.startsWith("String_Node_Str")) {
        action.setBookmark(href.substring(1));
      }
 else {
        action.setHyperlink(href,ele.getAttribute("String_Node_Str"));
      }
      content.setHyperlinkAction(action);
      this.action=action;
    }
  }
}

Fixed version (ground truth):
/** 
 * Outputs the A element
 * @param ele the A element instance
 */
protected void handleAnchor(Element ele,IContent content){
  if (ele.getAttribute("String_Node_Str").trim().length() != 0) {
    content.setBookmark(ele.getAttribute("String_Node_Str"));
  }
 else {
    content.setBookmark(ele.getAttribute("String_Node_Str"));
  }
  if (ele.getAttribute("String_Node_Str").length() > 0) {
    String href=ele.getAttribute("String_Node_Str");
    if (null != href && !"String_Node_Str".equals(href)) {
      ActionContent action=new ActionContent();
      if (href.startsWith("String_Node_Str")) {
        action.setBookmark(href.substring(1));
      }
 else {
        String target=ele.getAttribute("String_Node_Str");
        if ("String_Node_Str".equals(target)) {
          target="String_Node_Str";
        }
        action.setHyperlink(href,target);
      }
      this.action=action;
    }
  }
}
Program: 75760
Project: 75760
Buggy source:
public void end(IReportContent report){
  try {
    lb.flush(true,engine);
    ExcelWriter writer=new ExcelWriter(out);
    writer.writeDeclarations();
    writer.declareStyles(engine.getStyleIDMap());
    writer.startSheet();
    writer.startTable(width);
    writeDatas(writer);
    writer.endTable();
    writer.closeSheet();
    for (int i=0; i < charts.size(); i++) {
      File temp=(File)charts.get(i);
      writer.insert(temp);
      temp.delete();
    }
    writer.close(true);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void end(IReportContent report){
  try {
    lb.flush(true,engine);
    ExcelWriter writer=new ExcelWriter(out);
    writer.writeDeclarations();
    writer.declareStyles(engine.getStyleIDMap());
    writer.startSheet();
    writer.startTable(width);
    writeDatas(writer);
    writer.endTable();
    writer.closeSheet();
    for (int i=0; i < charts.size(); i++) {
      File temp=(File)charts.get(i);
      writer.insert(temp);
      temp.delete();
    }
    writer.close(true);
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    throw new RuntimeException(e);
  }
}
Program: 75762
Project: 75762
Buggy source:
public void calculateTopStyles(){
  if (styles.size() != 0 && istop) {
    Span span=(Span)spans.peek();
    int start=((Integer)pos.peek()).intValue();
    applyContainerTopBorder(span,start);
    istop=false;
  }
}

Fixed version (ground truth):
public void calculateTopStyles(){
  if (styles.size() > 0) {
    StyleEntry style=(StyleEntry)styles.peek();
    if (((Boolean)style2top.get(style)).booleanValue()) {
      Span span=(Span)spans.peek();
      int start=((Integer)pos.peek()).intValue();
      applyContainerTopBorder(span,start);
      style2top.put(style,Boolean.FALSE);
    }
  }
}
Program: 75763
Project: 75763
Buggy source:
public void addContainerStyle(IStyle style,Span span,int start){
  StyleEntry entry=initStyle(style,span);
  spans.push(span);
  styles.push(entry);
  pos.push(new Integer(start));
  istop=true;
}

Fixed version (ground truth):
public void addContainerStyle(IStyle style,Span span,int start){
  StyleEntry entry=initStyle(style,span);
  spans.push(span);
  styles.push(entry);
  pos.push(new Integer(start));
  style2top.put(entry,Boolean.TRUE);
}
Program: 75764
Project: 75764
Buggy source:
public void calculateBottomStyles(){
  Span span=(Span)spans.pop();
  StyleEntry entry=(StyleEntry)styles.pop();
  int col=span.getCol();
  int cp=dataMap.getListSize(col) - 1;
  for (int i=0; i < span.getColSpan() + 1; i++) {
    StyleBuilder.applyBottomBorder(entry,((Data)dataMap.get(i + col,cp)).style);
  }
  istop=true;
}

Fixed version (ground truth):
public void calculateBottomStyles(){
  Span span=(Span)spans.pop();
  StyleEntry entry=(StyleEntry)styles.pop();
  int col=span.getCol();
  int cp=dataMap.getListSize(col) - 1;
  for (int i=0; i < span.getColSpan() + 1; i++) {
    StyleBuilder.applyBottomBorder(entry,((Data)dataMap.get(i + col,cp)).style);
  }
  style2top.remove(entry);
}