nus-yam/ex-repair huggingface dataset:
Program: 73355
Project: 73355
Buggy source:
private void applyContainerTopBorder(Rule rule,int pos){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  StyleEntry entry=container.getStyle();
  int col=engine.getAxis().getCoordinate(rule.getStart());
  int span=engine.getAxis().getCoordinate(rule.getEnd()) - col;
  for (int i=col; i < span + col; i++) {
    Data data=engine.getData(i,pos);
    if (data == null || data == engine.waste) {
      continue;
    }
    StyleBuilder.applyTopBorder(entry,data.style);
  }
}

Fixed version (ground truth):
private void applyContainerTopBorder(Rule rule,int pos){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  StyleEntry entry=container.getStyle();
  int col=engine.getAxis().getCoordinateIndex(rule.getStart());
  int span=engine.getAxis().getCoordinateIndex(rule.getEnd()) - col;
  for (int i=col; i < span + col; i++) {
    Data data=engine.getData(i,pos);
    if (data == null || data == engine.waste) {
      continue;
    }
    StyleBuilder.applyTopBorder(entry,data.style);
  }
}
Program: 73356
Project: 73356
Buggy source:
public void calculateBottomStyles(){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  Rule rule=container.getRule();
  StyleEntry entry=container.getStyle();
  if (entry.isStart()) {
    calculateTopStyles();
  }
  int start=rule.getStart();
  int col=engine.getAxis().getCoordinate(start);
  int span=engine.getAxis().getCoordinate(rule.getEnd()) - col;
  int cp=engine.getColumnSize(col);
  cp=cp > 0 ? cp - 1 : 0;
  for (int i=0; i < span; i++) {
    Data data=engine.getData(i + col,cp);
    if (data == null) {
      continue;
    }
    StyleBuilder.applyBottomBorder(entry,data.style);
  }
}

Fixed version (ground truth):
public void calculateBottomStyles(){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  Rule rule=container.getRule();
  StyleEntry entry=container.getStyle();
  if (entry.isStart()) {
    calculateTopStyles();
  }
  int start=rule.getStart();
  int col=engine.getAxis().getCoordinateIndex(start);
  int span=engine.getAxis().getCoordinateIndex(rule.getEnd()) - col;
  int cp=engine.getColumnSize(col);
  cp=cp > 0 ? cp - 1 : 0;
  for (int i=0; i < span; i++) {
    Data data=engine.getData(i + col,cp);
    if (data == null) {
      continue;
    }
    StyleBuilder.applyBottomBorder(entry,data.style);
  }
}
Program: 73357
Project: 73357
Buggy source:
public void addCoordinates(int[] values){
  for (int i=0; i < values.length; i++) {
    addCoordinate(values[i]);
  }
}

Fixed version (ground truth):
public void addCoordinates(int[] values){
  for (int i=0; i < values.length; i++) {
    addCoordinateWithoutSort(values[i]);
  }
  Collections.sort(naxis);
}
Program: 73358
Project: 73358
Buggy source:
public void addCoordinate(int value){
  Integer index=new Integer(value);
  if (!naxis.contains(index)) {
    naxis.add(index);
    Collections.sort(naxis);
  }
}

Fixed version (ground truth):
public void addCoordinate(int value){
  if (addCoordinateWithoutSort(value)) {
    Collections.sort(naxis);
  }
}
Program: 73359
Project: 73359
Buggy source:
public int[] getRange(int start,int end){
  int sp=getCoordinate(start);
  int ep=getCoordinate(end);
  List list=naxis.subList(sp,ep + 1);
  Integer[] values=new Integer[list.size()];
  values=(Integer[])list.toArray(values);
  int[] pos=new int[values.length];
  for (int i=0; i < pos.length; i++) {
    pos[i]=values[i].intValue();
  }
  return pos;
}

Fixed version (ground truth):
/** 
 * Gets a subset of naxis.
 * @param start
 * @param end
 * @return
 */
public int[] getRange(int start,int end){
  int sp=getCoordinateIndex(start);
  int ep=getCoordinateIndex(end);
  List list=naxis.subList(sp,ep + 1);
  Integer[] values=new Integer[list.size()];
  values=(Integer[])list.toArray(values);
  int[] pos=new int[values.length];
  for (int i=0; i < pos.length; i++) {
    pos[i]=values[i].intValue();
  }
  return pos;
}
Program: 73360
Project: 73360
Buggy source:
private void synchronous(){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int end=rule.getEnd();
  int startcol=axis.getCoordinate(start);
  int endcol=axis.getCoordinate(end);
  int max=0;
  int len[]=new int[endcol - startcol];
  for (int i=startcol; i < endcol; i++) {
    int columnsize=cache.getColumnSize(i);
    len[i - startcol]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startcol; i < endcol; i++) {
    int rowspan=max - len[i - startcol];
    int last=len[i - startcol] - 1;
    if (rowspan > 0) {
      Object data=null;
      Object upstair=cache.getData(i,last);
      if (upstair != null && upstair != waste) {
        Data predata=(Data)upstair;
        int rs=predata.getRowSpan() + rowspan;
        predata.setRowSpan(rs);
        data=predata;
      }
 else {
        data=waste;
      }
      for (int p=0; p < rowspan; p++) {
        cache.addData(i,data);
      }
    }
  }
}

Fixed version (ground truth):
private void synchronous(){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int end=rule.getEnd();
  int startcol=axis.getCoordinateIndex(start);
  int endcol=axis.getCoordinateIndex(end);
  int max=0;
  int len[]=new int[endcol - startcol];
  for (int i=startcol; i < endcol; i++) {
    int columnsize=cache.getColumnSize(i);
    len[i - startcol]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startcol; i < endcol; i++) {
    int rowspan=max - len[i - startcol];
    int last=len[i - startcol] - 1;
    if (rowspan > 0) {
      Object data=null;
      Object upstair=cache.getData(i,last);
      if (upstair != null && upstair != waste) {
        Data predata=(Data)upstair;
        int rs=predata.getRowSpan() + rowspan;
        predata.setRowSpan(rs);
        data=predata;
      }
 else {
        data=waste;
      }
      for (int p=0; p < rowspan; p++) {
        cache.addData(i,data);
      }
    }
  }
}
Program: 73361
Project: 73361
Buggy source:
public void addTable(TableInfo table,IStyle style){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int[] npos=new int[table.getColumnCount() + 1];
  npos[0]=start;
  for (int i=1; i <= table.getColumnCount(); i++) {
    npos[i]=npos[i - 1] + table.getColumnWidth(i - 1);
  }
  int[] scale=axis.getRange(start,rule.getEnd());
  for (int i=0; i < scale.length - 1; i++) {
    int sp=scale[i];
    int se=scale[i + 1];
    int[] range=inRange(sp,se,npos);
    if (range.length > 0) {
      int pos=axis.getCoordinate(sp);
      cache.insertColumns(pos,range.length);
      for (int j=0; j < range.length; j++) {
        axis.addCoordinate(range[j]);
      }
    }
  }
  XlsContainer container=createContainer(rule,style);
  XlsTable tcontainer=new XlsTable(table,container);
  addContainer(tcontainer);
  tables.push(tcontainer);
}

Fixed version (ground truth):
public void addTable(TableInfo table,IStyle style){
  Rule rule=getCurrentContainer().getRule();
  int start=rule.getStart();
  int[] npos=new int[table.getColumnCount() + 1];
  npos[0]=start;
  for (int i=1; i <= table.getColumnCount(); i++) {
    npos[i]=npos[i - 1] + table.getColumnWidth(i - 1);
  }
  int[] scale=axis.getRange(start,rule.getEnd());
  for (int i=0; i < scale.length - 1; i++) {
    int sp=scale[i];
    int se=scale[i + 1];
    int[] range=inRange(sp,se,npos);
    if (range.length > 0) {
      int pos=axis.getCoordinateIndex(sp);
      cache.insertColumns(pos,range.length);
      for (int j=0; j < range.length; j++) {
        axis.addCoordinate(range[j]);
      }
    }
  }
  XlsContainer container=createContainer(rule,style);
  XlsTable tcontainer=new XlsTable(table,container);
  addContainer(tcontainer);
  tables.push(tcontainer);
}
Program: 73362
Project: 73362
Buggy source:
public void addContainer(XlsContainer container){
  getCurrentContainer().setEmpty(false);
  int col=axis.getCoordinate(container.getRule().getStart());
  int pos=cache.getColumnSize(col);
  container.setStart(pos);
  containers.push(container);
}

Fixed version (ground truth):
public void addContainer(XlsContainer container){
  getCurrentContainer().setEmpty(false);
  int col=axis.getCoordinateIndex(container.getRule().getStart());
  int pos=cache.getColumnSize(col);
  container.setStart(pos);
  containers.push(container);
}
Program: 73363
Project: 73363
Buggy source:
private void addData(Data data){
  getCurrentContainer().setEmpty(false);
  int col=axis.getCoordinate(data.getRule().getStart());
  int span=axis.getCoordinate(data.getRule().getEnd()) - col;
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    addDatatoCache(i,waste);
  }
}

Fixed version (ground truth):
private void addData(Data data){
  getCurrentContainer().setEmpty(false);
  int col=axis.getCoordinateIndex(data.getRule().getStart());
  int span=axis.getCoordinateIndex(data.getRule().getEnd()) - col;
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    addDatatoCache(i,waste);
  }
}
Program: 73364
Project: 73364
Buggy source:
public Data[] getRow(int rownum){
  Object[] row=cache.getRowData(rownum);
  List data=new ArrayList();
  int width=Math.min(row.length,MAX_COLUMN - 1);
  for (int i=0; i < width; i++) {
    if (waste == row[i]) {
      continue;
    }
    Data d=(Data)row[i];
    if (d.isProcessed()) {
      continue;
    }
    HyperlinkDef def=d.getHyperlinkDef();
    if (def != null && def.getType() == IHyperlinkAction.ACTION_BOOKMARK) {
      def.setUrl((String)links.get(def.getUrl()));
    }
    d.setProcessed(true);
    data.add(row[i]);
  }
  Data[] rowdata=new Data[data.size()];
  data.toArray(rowdata);
  return rowdata;
}

Fixed version (ground truth):
public Data[] getRow(int rownum){
  Object[] row=cache.getRowData(rownum);
  List data=new ArrayList();
  int width=Math.min(row.length,MAX_COLUMN - 1);
  for (int i=0; i < width; i++) {
    if (waste == row[i]) {
      continue;
    }
    Data d=(Data)row[i];
    if (d.isProcessed()) {
      continue;
    }
    d.setProcessed(true);
    data.add(row[i]);
  }
  Data[] rowdata=new Data[data.size()];
  data.toArray(rowdata);
  return rowdata;
}
Program: 73365
Project: 73365
Buggy source:
public void complete(){
  int rowcount=cache.getMaxRow();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      if (row[j] == waste) {
        continue;
      }
      Data d=(Data)row[j];
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      Rule rule=d.getRule();
      int start=axis.getCoordinate(rule.getStart()) + 1;
      int end=axis.getCoordinate(rule.getEnd()) + 1;
      end=Math.min(end,MAX_COLUMN);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}

Fixed version (ground truth):
public void complete(){
  int rowcount=cache.getMaxRow();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      if (row[j] == waste) {
        continue;
      }
      Data d=(Data)row[j];
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      Rule rule=d.getRule();
      int start=axis.getCoordinateIndex(rule.getStart()) + 1;
      int end=axis.getCoordinateIndex(rule.getEnd()) + 1;
      end=Math.min(end,MAX_COLUMN);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}
Program: 73366
Project: 73366
Buggy source:
/** 
 * @param cubeHandle
 * @param appContext
 * @param stopSign
 * @throws BirtException
 */
private void materializeCube(CubeHandle cubeHandle,Map appContext,StopSign stopSign) throws BirtException {
  if (stopSign == null)   stopSign=new StopSign();
  int mode=this.sessionContext.getDataEngineContext().getMode();
  try {
    CubeMaterializer cubeMaterializer=null;
    if (appContext == null)     appContext=sessionContext.getAppContext();
    if (mode == DataEngineContext.DIRECT_PRESENTATION) {
      int size=0;
      if (appContext != null) {
        Integer value=DataTypeUtil.toInteger(appContext.get(DataEngine.IN_MEMORY_CUBE_SIZE));
        if (value != null && value.intValue() > 0) {
          size=value.intValue();
        }
      }
      cubeMaterializer=createCubeMaterializer(cubeHandle,size);
      createCube((TabularCubeHandle)cubeHandle,cubeMaterializer,appContext,stopSign);
      cubeMaterializer.close();
    }
 else     if (mode == DataEngineContext.MODE_GENERATION) {
      cubeMaterializer=createCubeMaterializer(cubeHandle,0);
      createCube((TabularCubeHandle)cubeHandle,cubeMaterializer,appContext,stopSign);
      cubeMaterializer.saveCubeToReportDocument(cubeHandle.getQualifiedName(),this.sessionContext.getDocumentWriter(),null);
      cubeMaterializer.close();
    }
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param cubeHandle
 * @param appContext
 * @param stopSign
 * @throws BirtException
 */
private void materializeCube(CubeHandle cubeHandle,Map appContext,StopSign stopSign) throws BirtException {
  if (stopSign == null)   stopSign=new StopSign();
  int mode=this.sessionContext.getDataEngineContext().getMode();
  try {
    CubeMaterializer cubeMaterializer=null;
    if (appContext == null)     appContext=sessionContext.getAppContext();
    if (mode == DataEngineContext.DIRECT_PRESENTATION) {
      int size=0;
      if (appContext != null) {
        Integer value=DataTypeUtil.toInteger(appContext.get(DataEngine.IN_MEMORY_CUBE_SIZE));
        if (value != null && value.intValue() > 0) {
          size=value.intValue();
        }
      }
      cubeMaterializer=createCubeMaterializer(cubeHandle,size);
      createCube((TabularCubeHandle)cubeHandle,cubeMaterializer,appContext,stopSign);
      cubeMaterializer.close();
    }
 else     if (mode == DataEngineContext.MODE_GENERATION) {
      cubeMaterializer=createCubeMaterializer(cubeHandle,0);
      createCube((TabularCubeHandle)cubeHandle,cubeMaterializer,appContext,stopSign);
      cubeMaterializer.saveCubeToReportDocument(cubeHandle.getQualifiedName(),this.sessionContext.getDocumentWriter(),null);
      cubeMaterializer.close();
    }
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.EXCEPTION_ERROR,e);
  }
}
Program: 73367
Project: 73367
Buggy source:
/** 
 * Test disable some column binding on diskCache.
 * @throws Exception
 */
public void testDiskCacheColumnBinding() throws Exception {
  String initialStr=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  incomprehensiveColumnBinding();
  System.setProperty("String_Node_Str",initialStr == null ? "String_Node_Str" : initialStr);
}

Fixed version (ground truth):
/** 
 * Test disable some column binding on diskCache.
 * @throws Exception
 */
public void testDiskCacheColumnBinding() throws Exception {
  String initialStr=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  incomprehensiveColumnBinding();
  if (initialStr == null)   System.clearProperty("String_Node_Str");
 else   System.setProperty("String_Node_Str",initialStr);
}
Program: 73368
Project: 73368
Buggy source:
public int getSubQueryStartingIndex() throws DataException {
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}

Fixed version (ground truth):
public int getSubQueryStartingIndex() throws DataException {
  if (!subQueryOnGroup)   return this.parentIterator.getCurrentResultIndex();
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}
Program: 73369
Project: 73369
Buggy source:
/** 
 * This is used for PRESENTATION, the data in report document as the CachedResultSet.
 * @return
 * @throws DataException
 */
IExprResultSet loadExprResultSet() throws DataException {
  if (streamManager.isSecondRD() == true && streamManager.isSubquery() == true)   return new ExprResultSet2(tempDir,streamManager,version,streamManager.isSecondRD());
  return new ExprResultSet(tempDir,streamManager,version,streamManager.isSecondRD(),(streamManager.isSubquery() || this.version < VersionManager.VERSION_2_2_1_3) ? null : this.loadDataSetData());
}

Fixed version (ground truth):
/** 
 * This is used for PRESENTATION, the data in report document as the CachedResultSet.
 * @return
 * @throws DataException
 */
IExprResultSet loadExprResultSet(int rowIdStartingIndex) throws DataException {
  if (streamManager.isSecondRD() == true && streamManager.isSubquery() == true)   return new ExprResultSet2(tempDir,streamManager,version,streamManager.isSecondRD(),rowIdStartingIndex);
  return new ExprResultSet(tempDir,streamManager,version,streamManager.isSecondRD(),(streamManager.isSubquery() || this.version < VersionManager.VERSION_2_2_1_3) ? null : this.loadDataSetData(),streamManager.isSubquery() ? rowIdStartingIndex : 0);
}
Program: 73370
Project: 73370
Buggy source:
/** 
 * @throws DataException
 */
private void prepare() throws DataException {
  String rootID=QueryResultIDUtil.get1PartID(this.queryResultID);
  String selfID=QueryResultIDUtil.get2PartID(this.queryResultID);
  if (selfID == null)   selfID=this.queryResultID;
  RDLoad valueLoader=RDUtil.newLoad(tempDir,this.context,new QueryResultInfo(rootID,null,selfID,this.subQueryName,this.currParentIndex));
  if (this.subQueryName != null)   subQueryIndex=valueLoader.getSubQueryIndex(currParentIndex);
  this.exprResultSet=valueLoader.loadExprResultSet();
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void prepare() throws DataException {
  String rootID=QueryResultIDUtil.get1PartID(this.queryResultID);
  String selfID=QueryResultIDUtil.get2PartID(this.queryResultID);
  if (selfID == null)   selfID=this.queryResultID;
  RDLoad valueLoader=RDUtil.newLoad(tempDir,this.context,new QueryResultInfo(rootID,null,selfID,this.subQueryName,this.currParentIndex));
  int rowIdStartingIndex=0;
  if (this.subQueryName != null) {
    subQueryIndex=valueLoader.getSubQueryIndex(currParentIndex);
    rowIdStartingIndex=currParentIndex;
  }
  this.exprResultSet=valueLoader.loadExprResultSet(rowIdStartingIndex);
}
Program: 73371
Project: 73371
Buggy source:
public int getCurrentId(){
  return this.exprResultReader.getRowId();
}

Fixed version (ground truth):
public int getCurrentId(){
  return this.rowIdStartingIndex + this.exprResultReader.getRowId();
}
Program: 73372
Project: 73372
Buggy source:
/** 
 * @param streamManager
 * @param rdGroupUtil
 * @throws DataException
 */
public ExprResultSet(String tempDir,StreamManager streamManager,int version,boolean isBasedOnSecondRD,DataSetResultSet dataSetResultSet) throws DataException {
  this.tempDir=tempDir;
  this.streamManager=streamManager;
  this.version=version;
  this.isBasedOnSecondRD=isBasedOnSecondRD;
  this.dataSetResultSet=dataSetResultSet;
  this.prepare();
  this.rdGroupUtil.setCacheProvider(new CacheProviderImpl(this));
}

Fixed version (ground truth):
/** 
 * @param streamManager
 * @param rdGroupUtil
 * @throws DataException
 */
public ExprResultSet(String tempDir,StreamManager streamManager,int version,boolean isBasedOnSecondRD,DataSetResultSet dataSetResultSet,int rowIdStartingIndex) throws DataException {
  this.tempDir=tempDir;
  this.streamManager=streamManager;
  this.version=version;
  this.isBasedOnSecondRD=isBasedOnSecondRD;
  this.dataSetResultSet=dataSetResultSet;
  this.rowIdStartingIndex=rowIdStartingIndex;
  this.prepare();
  this.rdGroupUtil.setCacheProvider(new CacheProviderImpl(this));
}
Program: 73373
Project: 73373
Buggy source:
/** 
 * @param streamManager
 * @param rdGroupUtil
 * @param version
 * @param isBasedOnSecondRD
 * @throws DataException
 */
public ExprResultSet2(String tempDir,StreamManager streamManager,int version,boolean isBasedOnSecondRD) throws DataException {
  super(tempDir,streamManager,version,isBasedOnSecondRD,null);
}

Fixed version (ground truth):
/** 
 * @param streamManager
 * @param rdGroupUtil
 * @param version
 * @param isBasedOnSecondRD
 * @throws DataException
 */
public ExprResultSet2(String tempDir,StreamManager streamManager,int version,boolean isBasedOnSecondRD,int rowIdStartingIndex) throws DataException {
  super(tempDir,streamManager,version,isBasedOnSecondRD,null,rowIdStartingIndex);
}
Program: 73374
Project: 73374
Buggy source:
public PDFTableRegionLM getTableRegionLayout(){
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setReport(context.getReport());
  con.setMaxHeight(context.getMaxHeight());
  con.setMaxWidth(context.getMaxWidth());
  con.setAllowPageBreak(false);
  if (regionLayout == null) {
    regionLayout=new TableAreaLayout(tableContent,layoutInfo,startCol,endCol);
  }
  return new PDFTableRegionLM(con,tableContent,layoutInfo,regionLayout);
}

Fixed version (ground truth):
public PDFTableRegionLM getTableRegionLayout(){
  PDFReportLayoutEngine engine=context.getLayoutEngine();
  PDFLayoutEngineContext con=new PDFLayoutEngineContext(engine);
  con.setFactory(new PDFLayoutManagerFactory(con));
  con.setFormat(context.getFormat());
  con.setLocale(context.getLocale());
  con.setReport(context.getReport());
  con.setMaxHeight(context.getMaxHeight());
  con.setMaxWidth(context.getMaxWidth());
  con.setAllowPageBreak(false);
  if (regionLayout == null) {
    regionLayout=new TableAreaLayout(tableContent,layoutInfo,startCol,endCol);
  }
  return new PDFTableRegionLM(con,tableContent,layoutInfo,regionLayout);
}
Program: 73375
Project: 73375
Buggy source:
public Collection getSelectionTreeForCascadingGroup(String parameterGroupName){
  CascadingParameterGroupHandle parameterGroup=getCascadingParameterGroup(parameterGroupName);
  if (parameterGroup == null)   return Collections.EMPTY_LIST;
  SlotHandle parameters=parameterGroup.getParameters();
  int parameterCount=parameters.getCount();
  if (DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(parameterGroup.getDataSetMode())) {
    IResultIterator resultIterator=getResultSetOfCascadingGroup(parameterGroup);
    if (resultIterator == null) {
      return Collections.EMPTY_LIST;
    }
    Collection selectionTree=populateToSelectionTree(resultIterator,parameterGroup);
    close(resultIterator);
    return selectionTree;
  }
 else {
    ParameterHelper[] parameterHelpers=getParameterHelpers(parameterGroup);
    ChoiceListCache cache=new ChoiceListCache(parameterHelpers);
    assert(parameterCount > 0);
    return getSelectionTree(parameters,parameterHelpers,cache,new Object[0]);
  }
}

Fixed version (ground truth):
public Collection getSelectionTreeForCascadingGroup(String parameterGroupName){
  try {
    switchToOsgiClassLoader();
    return doGetSelectionTreeForCascadingGroup(parameterGroupName);
  }
  finally {
    switchClassLoaderBack();
  }
}
Program: 73376
Project: 73376
Buggy source:
public Collection getSelectionList(String name){
  usingParameterValues();
  ReportDesignHandle report=(ReportDesignHandle)this.runnable.getDesignHandle();
  ScalarParameterHandle parameter=(ScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return Collections.EMPTY_LIST;
  }
  String selectionType=parameter.getValueType();
  String dataType=parameter.getDataType();
  boolean fixedOrder=parameter.isFixedOrder();
  boolean sortByLabel="String_Node_Str".equalsIgnoreCase(parameter.getSortBy());
  boolean sortDirectionValue="String_Node_Str".equalsIgnoreCase(parameter.getSortDirection());
  if (DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC.equals(selectionType)) {
    CascadingParameterGroupHandle group=null;
    if (isCascadingParameter(parameter)) {
      group=getCascadingGroup(parameter);
    }
    if (group != null) {
      if (DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(group.getDataSetMode())) {
        return getCascadingParameterList(parameter);
      }
 else {
        if (parameter.getDataSetName() != null) {
          return getChoicesFromParameterQuery(parameter);
        }
      }
    }
 else {
      if (parameter.getDataSetName() != null) {
        return getChoicesFromParameterQuery(parameter);
      }
    }
  }
 else   if (DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC.equals(selectionType)) {
    Iterator iter=parameter.choiceIterator();
    ArrayList choices=new ArrayList();
    while (iter.hasNext()) {
      SelectionChoiceHandle choice=(SelectionChoiceHandle)iter.next();
      String label=report.getMessage(choice.getLabelKey(),locale);
      if (label == null) {
        label=choice.getLabel();
      }
      Object value=convertToType(choice.getValue(),dataType);
      choices.add(new SelectionChoice(label,value));
    }
    if (!fixedOrder)     Collections.sort(choices,new SelectionChoiceComparator(sortByLabel,parameter.getPattern(),sortDirectionValue,ULocale.forLocale(locale)));
    return choices;
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public Collection getSelectionList(String name){
  try {
    switchToOsgiClassLoader();
    return doGetSelectionList(name);
  }
  finally {
    switchClassLoaderBack();
  }
}
Program: 73377
Project: 73377
Buggy source:
public void run() throws EngineException {
  try {
    changeStatusToRunning();
    doRun();
  }
  finally {
    changeStatusToStopped();
  }
}

Fixed version (ground truth):
public void run() throws EngineException {
  try {
    switchToOsgiClassLoader();
    changeStatusToRunning();
    doRun();
  }
  finally {
    changeStatusToStopped();
    switchClassLoaderBack();
  }
}
Program: 73379
Project: 73379
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  Platform.setPlatform(null);
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  Platform.setPlatform(null);
  Platform.setContextClassLoader(null);
}
Program: 73380
Project: 73380
Buggy source:
/** 
 * This method is called upon plug-in activation.
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  Platform.setPlatform(new EclipsePlatform(context));
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation.
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  Platform.setPlatform(new EclipsePlatform(context));
  Platform.setContextClassLoader(Thread.currentThread().getContextClassLoader());
}
Program: 73381
Project: 73381
Buggy source:
/** 
 * Returns the list of editparts which are conceptually at the same level of navigation as the currently focused editpart. By default, these are the siblings of the focused part. <p> This implementation returns a list that contains the EditPart that has focus. </p>
 * @return a list of navigation editparts
 */
List getNavigationSiblings(){
  EditPart focusPart=getFocusEditPart();
  if (focusPart.getParent() != null)   return focusPart.getParent().getChildren();
  List list=new ArrayList();
  list.add(focusPart);
  return list;
}

Fixed version (ground truth):
/** 
 * Returns the list of editparts which are conceptually at the same level of navigation as the currently focused editpart. By default, these are the siblings of the focused part. <p> This implementation returns a list that contains the EditPart that has focus. </p>
 * @return a list of navigation editparts
 */
protected List getNavigationSiblings(){
  EditPart focusPart=getFocusEditPart();
  if (focusPart.getParent() != null)   return focusPart.getParent().getChildren();
  List list=new ArrayList();
  list.add(focusPart);
  return list;
}
Program: 73382
Project: 73382
Buggy source:
public static ClassLoader createClassLoaderFromDesign(IReportRunnable runnable,ClassLoader parent){
  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);
      System.out.println(url.getPath());
      if (url != null) {
        urls.add(url);
      }
    }
    if (urls.size() != 0) {
      URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
      return new URLClassLoader(jarUrls,parent);
    }
  }
  return parent;
}

Fixed version (ground truth):
public static ClassLoader createClassLoaderFromDesign(IReportRunnable runnable,ClassLoader parent){
  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: 73384
Project: 73384
Buggy source:
void readContent(DataInputStream in) throws IOException ;

Fixed version (ground truth):
void readContent(DataInputStream in,ClassLoader loader) throws IOException ;
Program: 73385
Project: 73385
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    bandType=IOUtil.readInt(in);
  break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    bandType=IOUtil.readInt(in);
  break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73386
Project: 73386
Buggy source:
public void readContent(DataInputStream in) throws IOException {
  if (this.version == VERSION_1) {
    readContentV1(in);
  }
 else   if (this.version == VERSION_0) {
    readContentV0(in);
  }
 else {
    throw new IOException("String_Node_Str" + version);
  }
}

Fixed version (ground truth):
public void readContent(DataInputStream in,ClassLoader loader) throws IOException {
  if (this.version == VERSION_1) {
    readContentV1(in,loader);
  }
 else   if (this.version == VERSION_0) {
    readContentV0(in,loader);
  }
 else {
    throw new IOException("String_Node_Str" + version);
  }
}
Program: 73387
Project: 73387
Buggy source:
protected void readContentV0(DataInputStream in) throws IOException {
  IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(VERSION_0,filedId,in);
    filedId=IOUtil.readInt(in);
  }
}

Fixed version (ground truth):
protected void readContentV0(DataInputStream in,ClassLoader loader) throws IOException {
  IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(VERSION_0,filedId,in,loader);
    filedId=IOUtil.readInt(in);
  }
}
Program: 73388
Project: 73388
Buggy source:
protected void readContentV1(DataInputStream in) throws IOException {
  while (in.available() > 0) {
    int filedId=IOUtil.readShort(in);
    readField(VERSION_1,filedId,in);
  }
}

Fixed version (ground truth):
protected void readContentV1(DataInputStream in,ClassLoader loader) throws IOException {
  while (in.available() > 0) {
    int filedId=IOUtil.readShort(in);
    readField(VERSION_1,filedId,in,loader);
  }
}
Program: 73389
Project: 73389
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE:
String style=IOUtil.readString(in);
if (style != null && style.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(style);
}
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in);
break;
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in,loader);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE:
String style=IOUtil.readString(in);
if (style != null && style.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(style);
}
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in,loader);
break;
}
}
Program: 73390
Project: 73390
Buggy source:
public void readObject(DataInputStream in) throws IOException {
  int version=IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(version,filedId,in);
    filedId=IOUtil.readInt(in);
  }
}

Fixed version (ground truth):
public void readObject(DataInputStream in,ClassLoader loader) throws IOException {
  int version=IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(version,filedId,in,loader);
    filedId=IOUtil.readInt(in);
  }
}
Program: 73391
Project: 73391
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    type=IOUtil.readInt(in);
  if (type == ACTION_DRILLTHROUGH) {
    drillThrough=new DrillThroughAction();
  }
break;
case FIELD_BOOKMARK:
String bk=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setBookmark(bk);
}
 else {
bookmark=bk;
}
break;
case FIELD_HYPERLINK:
hyperlink=IOUtil.readString(in);
break;
case FIELD_REPORTNAME:
String name=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setReportName(name);
}
break;
case FIELD_PARAMETERBINDINGS:
Map bindings=IOUtil.readMap(in);
if (isDrillThrough()) {
drillThrough.setParameterBindings(bindings);
}
break;
case FIELD_SEARCHCRITERIA:
Map search=IOUtil.readMap(in);
if (isDrillThrough()) {
drillThrough.setSearchCriteria(search);
}
break;
case FIELD_TARGET:
String tgt=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setTargetWindow(tgt);
}
 else {
target=tgt;
}
break;
case FIELD_FORMAT:
String fmt=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setFormat(fmt);
}
break;
case FIELD_ISBOOKMARK:
boolean isBk=IOUtil.readBool(in);
if (isDrillThrough()) {
drillThrough.setBookmarkType(isBk);
}
break;
case FIELD_TARGETFILETYPE:
String tgtType=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setTargetFileType(tgtType);
}
break;
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    type=IOUtil.readInt(in);
  if (type == ACTION_DRILLTHROUGH) {
    drillThrough=new DrillThroughAction();
  }
break;
case FIELD_BOOKMARK:
String bk=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setBookmark(bk);
}
 else {
bookmark=bk;
}
break;
case FIELD_HYPERLINK:
hyperlink=IOUtil.readString(in);
break;
case FIELD_REPORTNAME:
String name=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setReportName(name);
}
break;
case FIELD_PARAMETERBINDINGS:
Map bindings=IOUtil.readMap(in,loader);
if (isDrillThrough()) {
drillThrough.setParameterBindings(bindings);
}
break;
case FIELD_SEARCHCRITERIA:
Map search=IOUtil.readMap(in,loader);
if (isDrillThrough()) {
drillThrough.setSearchCriteria(search);
}
break;
case FIELD_TARGET:
String tgt=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setTargetWindow(tgt);
}
 else {
target=tgt;
}
break;
case FIELD_FORMAT:
String fmt=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setFormat(fmt);
}
break;
case FIELD_ISBOOKMARK:
boolean isBk=IOUtil.readBool(in);
if (isDrillThrough()) {
drillThrough.setBookmarkType(isBk);
}
break;
case FIELD_TARGETFILETYPE:
String tgtType=IOUtil.readString(in);
if (isDrillThrough()) {
drillThrough.setTargetFileType(tgtType);
}
break;
}
}
Program: 73392
Project: 73392
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    type=IOUtil.readInt(in);
  break;
case FIELD_TEXT:
text=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_TYPE:
    type=IOUtil.readInt(in);
  break;
case FIELD_TEXT:
text=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73393
Project: 73393
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_ROW_SPAN:
    rowSpan=IOUtil.readInt(in);
  break;
case FIELD_COL_SPAN:
colSpan=IOUtil.readInt(in);
break;
case FIELD_COLUMN:
column=IOUtil.readInt(in);
break;
case FIELD_START_OF_GROUP:
IOUtil.readBool(in);
break;
case FIELD_DISPLAY_GROUP_ICON:
displayGroupIcon=Boolean.valueOf(IOUtil.readBool(in));
break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_ROW_SPAN:
    rowSpan=IOUtil.readInt(in);
  break;
case FIELD_COL_SPAN:
colSpan=IOUtil.readInt(in);
break;
case FIELD_COLUMN:
column=IOUtil.readInt(in);
break;
case FIELD_START_OF_GROUP:
IOUtil.readBool(in);
break;
case FIELD_DISPLAY_GROUP_ICON:
displayGroupIcon=Boolean.valueOf(IOUtil.readBool(in));
break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73394
Project: 73394
Buggy source:
public void readObject(DataInputStream in) throws IOException {
  int version=IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(version,filedId,in);
    filedId=IOUtil.readInt(in);
  }
}

Fixed version (ground truth):
public void readObject(DataInputStream in,ClassLoader loader) throws IOException {
  int version=IOUtil.readInt(in);
  int filedId=IOUtil.readInt(in);
  while (filedId != FIELD_NONE) {
    readField(version,filedId,in,loader);
    filedId=IOUtil.readInt(in);
  }
}
Program: 73395
Project: 73395
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_WIDTH:
    width=new DimensionType();
  width.readObject(in);
break;
case FIELD_STYLECLASS:
styleClass=IOUtil.readString(in);
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_VISIBLE_FORMAT:
visibleFormat=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE:
String style=IOUtil.readString(in);
if (style != null && style.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(style);
}
break;
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_WIDTH:
    width=new DimensionType();
  width.readObject(in);
break;
case FIELD_STYLECLASS:
styleClass=IOUtil.readString(in);
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_VISIBLE_FORMAT:
visibleFormat=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE:
String style=IOUtil.readString(in);
if (style != null && style.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(style);
}
break;
}
}
Program: 73396
Project: 73396
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_VALUE:
    value=IOUtil.readObject(in);
  break;
case FIELD_LAVELTEXT:
labelText=IOUtil.readString(in);
break;
case FIELD_LABELKEY:
labelKey=IOUtil.readString(in);
break;
case FIELD_HELPKEY:
helpKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_VALUE:
    value=IOUtil.readObject(in,loader);
  break;
case FIELD_LAVELTEXT:
labelText=IOUtil.readString(in);
break;
case FIELD_LABELKEY:
labelKey=IOUtil.readString(in);
break;
case FIELD_HELPKEY:
helpKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73397
Project: 73397
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_RAW_TYPE:
    rawType=IOUtil.readString(in);
  break;
case FIELD_RAWVALUE:
rawValue=IOUtil.readObject(in);
if (rawType.equals(TEMPLATE_TYPE) && rawValue instanceof HashMap) {
rawValue=new Object[]{null,rawValue};
}
break;
case FIELD_ALTTEXT:
altText=IOUtil.readString(in);
break;
case FIELD_ALTTEXTKEY:
altTextKey=IOUtil.readString(in);
break;
case FIELD_RAWKEY:
rawKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_RAW_TYPE:
    rawType=IOUtil.readString(in);
  break;
case FIELD_RAWVALUE:
rawValue=IOUtil.readObject(in,loader);
if (rawType.equals(TEMPLATE_TYPE) && rawValue instanceof HashMap) {
rawValue=new Object[]{null,rawValue};
}
break;
case FIELD_ALTTEXT:
altText=IOUtil.readString(in);
break;
case FIELD_ALTTEXTKEY:
altTextKey=IOUtil.readString(in);
break;
case FIELD_RAWKEY:
rawKey=IOUtil.readString(in);
break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73398
Project: 73398
Buggy source:
protected void readField(int version,int filedId,DataInputStream in) throws IOException {
switch (filedId) {
case FIELD_HEADER_REPEAT:
    headerRepeat=Boolean.valueOf(IOUtil.readBool(in));
  break;
default :
super.readField(version,filedId,in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_HEADER_REPEAT:
    headerRepeat=Boolean.valueOf(IOUtil.readBool(in));
  break;
default :
super.readField(version,filedId,in,loader);
}
}
Program: 73399
Project: 73399
Buggy source:
/** 
 */
private void getMetaUsingPolicy0(){
  java.sql.ResultSetMetaData resultmd;
  try {
    resultmd=preStat.getMetaData();
    this.cachedResultMetaData=new ResultSetMetaData(resultmd);
  }
 catch (  Throwable e) {
  }
}

Fixed version (ground truth):
/** 
 */
private void getMetaUsingPolicy0(){
  java.sql.ResultSetMetaData resultmd;
  try {
    resultmd=preStat.getMetaData();
    if (resultmd != null)     this.cachedResultMetaData=new ResultSetMetaData(resultmd);
  }
 catch (  Throwable e) {
  }
}
Program: 73401
Project: 73401
Buggy source:
/** 
 * Test read/writeContent() methods.
 * @throws IOException
 */
public void testContent() throws IOException {
  IReportContent rContent=new ReportContent();
  IContent content1=rContent.createContainerContent();
  IContent content2=rContent.createContainerContent();
  content1.setName("String_Node_Str");
  content1.setHelpText("String_Node_Str");
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  ((ContainerContent)content1).setVersion(1);
  content1.writeContent(dos);
  InputStream is=new ByteArrayInputStream(bos.toByteArray());
  DataInputStream dis=new DataInputStream(is);
  ((ContainerContent)content2).setVersion(1);
  content2.readContent(dis);
  assertEquals(content1.getName(),content2.getName());
  assertEquals(content1.getHelpText(),content2.getHelpText());
}

Fixed version (ground truth):
/** 
 * Test read/writeContent() methods.
 * @throws IOException
 */
public void testContent() throws IOException {
  IReportContent rContent=new ReportContent();
  IContent content1=rContent.createContainerContent();
  IContent content2=rContent.createContainerContent();
  content1.setName("String_Node_Str");
  content1.setHelpText("String_Node_Str");
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  ((ContainerContent)content1).setVersion(1);
  content1.writeContent(dos);
  InputStream is=new ByteArrayInputStream(bos.toByteArray());
  DataInputStream dis=new DataInputStream(is);
  ((ContainerContent)content2).setVersion(1);
  content2.readContent(dis,null);
  assertEquals(content1.getName(),content2.getName());
  assertEquals(content1.getHelpText(),content2.getHelpText());
}
Program: 73402
Project: 73402
Buggy source:
/** 
 * close the executor, if the executor is closed, all sub executor will be termiante also.
 */
void close();

Fixed version (ground truth):
/** 
 * close the executor, if the executor is closed, all sub executor will be terminate also.
 */
void close();
Program: 73403
Project: 73403
Buggy source:
public void submit(AbstractArea area){
  area.setAllocatedPosition(getCurrentIP(),getCurrentBP());
  setCurrentIP(getCurrentIP() + area.getAllocatedWidth());
  if (getCurrentIP() > root.getContentWidth()) {
    root.setContentWidth(getCurrentIP());
  }
  if (getCurrentBP() + area.getAllocatedHeight() > root.getContentHeight()) {
    root.setContentHeight(getCurrentBP() + area.getAllocatedHeight());
  }
  root.addChild(area);
  lineFinished=false;
}

Fixed version (ground truth):
public void submit(AbstractArea area){
  area.setAllocatedPosition(getCurrentIP(),getCurrentBP());
  setCurrentIP(getCurrentIP() + area.getAllocatedWidth());
  if (getCurrentIP() > root.getContentWidth()) {
    root.setContentWidth(getCurrentIP());
  }
  if (getCurrentBP() + area.getAllocatedHeight() > root.getContentHeight()) {
    root.setContentHeight(getCurrentBP() + area.getAllocatedHeight());
  }
  root.addChild(area);
  isEmpty=false;
  lineFinished=false;
}