nus-yam/ex-repair huggingface dataset:
Program: 74733
Project: 74733
Buggy source:
/** 
 * @param sortedKeyArray
 * @param startOffset
 * @param level
 * @param sonLevelTotalNumber
 * @return
 * @throws IOException
 * @throws DataException 
 */
private IDiskArray writeNonLeafNode(IDiskArray sortedKeyArray,IDiskArray startOffset,int level,int sonLevelTotalNumber) throws IOException, DataException {
  int interval=pow(degree,level);
  BufferedPrimitiveDiskArray sonStartOffset=new BufferedPrimitiveDiskArray(Math.min(Constants.LIST_BUFFER_SIZE,startOffset.size() / degree + 1));
  for (int i=0; i < startOffset.size(); i++) {
    if (i % degree == 0) {
      sonStartOffset.add(new Integer((int)documentObject.getFilePointer()));
    }
    if (i != startOffset.size() - 1) {
      documentObject.writeByte(degree);
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(i * interval)).getKey());
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get((i + 1) * interval - 1)).getKey());
    }
 else {
      documentObject.writeByte(sonLevelTotalNumber - (startOffset.size() - 1) * degree);
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(i * interval)).getKey());
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(sortedKeyArray.size() - 1)).getKey());
    }
    documentObject.writeInt(((Integer)startOffset.get(i)).intValue());
  }
  return sonStartOffset;
}

Fixed version (ground truth):
/** 
 * @param sortedKeyArray
 * @param startOffset
 * @param level
 * @param sonLevelTotalNumber
 * @return
 * @throws IOException
 * @throws DataException 
 */
private IDiskArray writeNonLeafNode(IDiskArray sortedKeyArray,IDiskArray startOffset,int level,int sonLevelTotalNumber) throws IOException, DataException {
  int interval=pow(degree,level);
  BufferedPrimitiveDiskArray sonStartOffset=new BufferedPrimitiveDiskArray(Math.min(Constants.MAX_LIST_BUFFER_SIZE,startOffset.size() / degree + 1));
  for (int i=0; i < startOffset.size(); i++) {
    if (i % degree == 0) {
      sonStartOffset.add(new Integer((int)documentObject.getFilePointer()));
    }
    if (i != startOffset.size() - 1) {
      documentObject.writeByte(degree);
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(i * interval)).getKey());
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get((i + 1) * interval - 1)).getKey());
    }
 else {
      documentObject.writeByte(sonLevelTotalNumber - (startOffset.size() - 1) * degree);
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(i * interval)).getKey());
      DocumentObjectUtil.writeValue(documentObject,keyDataType,((IndexKey)sortedKeyArray.get(sortedKeyArray.size() - 1)).getKey());
    }
    documentObject.writeInt(((Integer)startOffset.get(i)).intValue());
  }
  return sonStartOffset;
}
Program: 74734
Project: 74734
Buggy source:
/** 
 * @param sortedKeyArray
 * @param interval
 * @return
 * @throws IOException
 * @throws DataException 
 */
private IDiskArray writeLeafNode(IDiskArray sortedKeyArray,int interval) throws IOException, DataException {
  BufferedPrimitiveDiskArray offset=new BufferedPrimitiveDiskArray(Constants.LIST_BUFFER_SIZE);
  for (int i=0; i < sortedKeyArray.size(); i++) {
    if (i % interval == 0) {
      offset.add(new Integer((int)documentObject.getFilePointer()));
    }
    offsetDocumentObject.writeInt((int)documentObject.getFilePointer());
    writeKeyObject((IndexKey)sortedKeyArray.get(i));
  }
  return offset;
}

Fixed version (ground truth):
/** 
 * @param sortedKeyArray
 * @param interval
 * @return
 * @throws IOException
 * @throws DataException 
 */
private IDiskArray writeLeafNode(IDiskArray sortedKeyArray,int interval) throws IOException, DataException {
  BufferedPrimitiveDiskArray offset=new BufferedPrimitiveDiskArray(Math.min(sortedKeyArray.size(),Constants.MAX_LIST_BUFFER_SIZE));
  for (int i=0; i < sortedKeyArray.size(); i++) {
    if (i % interval == 0) {
      offset.add(new Integer((int)documentObject.getFilePointer()));
    }
    offsetDocumentObject.writeInt((int)documentObject.getFilePointer());
    writeKeyObject((IndexKey)sortedKeyArray.get(i));
  }
  return offset;
}
Program: 74735
Project: 74735
Buggy source:
/** 
 * @param keyList
 * @return
 * @throws IOException
 */
private IDiskArray sortKeys(IDiskArray keyList) throws IOException {
  DiskSortedStack sortStack=new DiskSortedStack(Constants.LIST_BUFFER_SIZE,false,IndexKey.getKeyComparator(),IndexKey.getCreator());
  for (int i=0; i < keyList.size(); i++) {
    sortStack.push((IComparableStructure)(keyList.get(i)));
  }
  BufferedStructureArray reList=new BufferedStructureArray(IndexKey.getCreator(),Constants.LIST_BUFFER_SIZE);
  for (int i=0; i < keyList.size(); i++) {
    reList.add(sortStack.pop());
  }
  return reList;
}

Fixed version (ground truth):
/** 
 * @param keyList
 * @return
 * @throws IOException
 */
private IDiskArray sortKeys(IDiskArray keyList) throws IOException {
  DiskSortedStack sortStack=new DiskSortedStack(Math.min(keyList.size(),Constants.MAX_LIST_BUFFER_SIZE),false,IndexKey.getKeyComparator(),IndexKey.getCreator());
  for (int i=0; i < keyList.size(); i++) {
    sortStack.push((IComparableStructure)(keyList.get(i)));
  }
  BufferedStructureArray reList=new BufferedStructureArray(IndexKey.getCreator(),Math.min(keyList.size(),Constants.MAX_LIST_BUFFER_SIZE));
  for (int i=0; i < keyList.size(); i++) {
    reList.add(sortStack.pop());
  }
  return reList;
}
Program: 74736
Project: 74736
Buggy source:
/** 
 * Get intersection from disk arrays.
 * @param stacks
 * @return
 * @throws IOException
 */
public static IDiskArray getIntersection(IDiskArray[] arrays) throws IOException {
  PrimitiveDiskSortedStack[] stacks=new PrimitiveDiskSortedStack[arrays.length];
  for (int i=0; i < arrays.length; i++) {
    stacks[i]=new PrimitiveDiskSortedStack(Constants.LIST_BUFFER_SIZE,true,true);
    if (arrays[i] == null || arrays[i].size() == 0) {
      return null;
    }
    for (int j=0; j < arrays[i].size(); j++) {
      stacks[i].push(arrays[i].get(j));
    }
  }
  return getIntersection(stacks);
}

Fixed version (ground truth):
/** 
 * Get intersection from disk arrays.
 * @param stacks
 * @return
 * @throws IOException
 */
public static IDiskArray getIntersection(IDiskArray[] arrays) throws IOException {
  PrimitiveDiskSortedStack[] stacks=new PrimitiveDiskSortedStack[arrays.length];
  for (int i=0; i < arrays.length; i++) {
    stacks[i]=new PrimitiveDiskSortedStack(Math.min(arrays[i].size(),Constants.MAX_LIST_BUFFER_SIZE),true,true);
    if (arrays[i] == null || arrays[i].size() == 0) {
      return null;
    }
    for (int j=0; j < arrays[i].size(); j++) {
      stacks[i].push(arrays[i].get(j));
    }
  }
  return getIntersection(stacks);
}
Program: 74737
Project: 74737
Buggy source:
AbstractNode(IContent content,IContentEmitter emitter,PageHintGenerator generator){
  this.content=content;
  this.emitter=emitter;
  this.generator=generator;
}

Fixed version (ground truth):
AbstractNode(IContent content,IContentEmitter emitter,PageHintGenerator generator,boolean isVisible){
  this.content=content;
  this.emitter=emitter;
  this.generator=generator;
  this.isVisible=isVisible;
}
Program: 74738
Project: 74738
Buggy source:
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  ContentEmitterUtil.startContent(content,emitter);
  generator.start(content,isFirst);
  isStarted=true;
}

Fixed version (ground truth):
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  if (isVisible) {
    ContentEmitterUtil.startContent(content,emitter);
  }
  generator.start(content,isFirst);
  isStarted=true;
}
Program: 74739
Project: 74739
Buggy source:
public void end(){
  ContentEmitterUtil.endContent(content,emitter);
  generator.end(content,finished);
}

Fixed version (ground truth):
public void end(){
  if (isVisible) {
    ContentEmitterUtil.endContent(content,emitter);
  }
  generator.end(content,finished);
}
Program: 74740
Project: 74740
Buggy source:
public ContainerBufferNode(IContent content,IContentEmitter emitter,PageHintGenerator generator){
  super(content,emitter,generator);
}

Fixed version (ground truth):
public ContainerBufferNode(IContent content,IContentEmitter emitter,PageHintGenerator generator,boolean isVisible){
  super(content,emitter,generator,isVisible);
}
Program: 74741
Project: 74741
Buggy source:
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  ContentEmitterUtil.startContent(content,emitter);
  generator.start(content,isFirst);
  isStarted=true;
  flushUnStartedChildren();
}

Fixed version (ground truth):
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  if (isVisible) {
    ContentEmitterUtil.startContent(content,emitter);
  }
  generator.start(content,isFirst);
  isStarted=true;
  flushUnStartedChildren();
}
Program: 74742
Project: 74742
Buggy source:
public void startContent(IContent content,IContentEmitter emitter,boolean visible){
  if (isRepeated || (!visible && !isPageStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator);
    setup(leafNode,true);
    currentNode.start();
    ContentEmitterUtil.startContent(content,emitter);
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}

Fixed version (ground truth):
public void startContent(IContent content,IContentEmitter emitter,boolean visible){
  if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}
Program: 74743
Project: 74743
Buggy source:
private void _endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  ((AbstractNode)currentNode).setFinished(finished);
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished && !isRepeated) {
      if (visible) {
        currentNode.flush();
      }
 else       if (isPageStarted()) {
        currentNode.flush();
      }
    }
  }
  currentNode=currentNode.getParent();
  if (currentNode != null && finished && !isRepeated) {
    if (visible) {
      currentNode.removeChildren();
    }
 else     if (isPageStarted()) {
      currentNode.removeChildren();
    }
  }
}

Fixed version (ground truth):
private void _endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  ((AbstractNode)currentNode).setFinished(finished);
  if (currentNode.isStarted()) {
    currentNode.end();
  }
 else {
    if (finished && !isRepeated) {
      if (visible) {
        currentNode.flush();
      }
 else       if (isParentStarted()) {
        currentNode.flush();
      }
    }
  }
  currentNode=currentNode.getParent();
  if (currentNode != null && finished && !isRepeated) {
    if (visible) {
      currentNode.removeChildren();
    }
 else     if (isParentStarted()) {
      currentNode.removeChildren();
    }
  }
}
Program: 74744
Project: 74744
Buggy source:
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible){
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator);
setup(pageNode,isFirst);
currentNode=pageNode;
this.pageNode=pageNode;
break;
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator);
setup(node,isFirst);
currentNode=node;
break;
}
}

Fixed version (ground truth):
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible){
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator,visible);
setup(pageNode,isFirst);
currentNode=pageNode;
break;
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator,visible);
setup(node,isFirst);
currentNode=node;
break;
}
}
Program: 74745
Project: 74745
Buggy source:
LeafBufferNode(IContent content,IContentEmitter emitter,PageHintGenerator generator){
  super(content,emitter,generator);
}

Fixed version (ground truth):
LeafBufferNode(IContent content,IContentEmitter emitter,PageHintGenerator generator,boolean isVisible){
  super(content,emitter,generator,isVisible);
}
Program: 74746
Project: 74746
Buggy source:
public PageNode(IContent content,IContentEmitter emitter,PageHintGenerator generator){
  super(content,emitter,generator);
}

Fixed version (ground truth):
public PageNode(IContent content,IContentEmitter emitter,PageHintGenerator generator,boolean isVisible){
  super(content,emitter,generator,isVisible);
}
Program: 74747
Project: 74747
Buggy source:
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  ContentEmitterUtil.startContent(content,emitter);
  isStarted=true;
  flushUnStartedChildren();
}

Fixed version (ground truth):
public void start(){
  if (isStarted) {
    return;
  }
  if (parent != null && !parent.isStarted()) {
    parent.start();
  }
  if (isVisible) {
    ContentEmitterUtil.startContent(content,emitter);
  }
  isStarted=true;
  flushUnStartedChildren();
}
Program: 74748
Project: 74748
Buggy source:
public void end(){
  flushUnStartedChildren();
  ContentEmitterUtil.endContent(content,emitter);
}

Fixed version (ground truth):
public void end(){
  flushUnStartedChildren();
  if (isVisible) {
    ContentEmitterUtil.endContent(content,emitter);
  }
}
Program: 74749
Project: 74749
Buggy source:
public IStructure createInstance(Object[] fields){
}

Fixed version (ground truth):
public IStructure createInstance(Object[] fields){
  IndexKey obj=new IndexKey();
  obj.setKey(new Object[fields.length - 2]);
  System.arraycopy(fields,0,obj.getKey(),0,obj.getKey().length);
  obj.setOffset(((Integer)fields[fields.length - 2]).intValue());
  obj.setDimensionPos(((Integer)fields[fields.length - 1]).intValue());
  return obj;
}
Program: 74750
Project: 74750
Buggy source:
public void setAppContext(Object context) throws OdaException {
  if (!(context instanceof Map))   throw new OdaException(Messages.getString("String_Node_Str"));
  Map appContext=(Map)context;
  if (appContext.get("String_Node_Str") != null) {
    appContext.put(org.eclipse.datatools.enablement.oda.xml.Constants.APPCONTEXT_INPUTSTREAM,appContext.get("String_Node_Str"));
  }
  if (appContext.get("String_Node_Str") != null) {
    appContext.put(org.eclipse.datatools.enablement.oda.xml.Constants.APPCONTEXT_CLOSEINPUTSTREAM,appContext.get("String_Node_Str"));
  }
  super.setAppContext((Map)context);
}

Fixed version (ground truth):
public void setAppContext(Object context) throws OdaException {
  if (!(context instanceof Map))   throw new OdaException(Messages.getString("String_Node_Str"));
  Map appContext=(Map)context;
  if (appContext.get(Constants.APPCONTEXT_INPUTSTREAM) != null) {
    appContext.put(org.eclipse.datatools.enablement.oda.xml.Constants.APPCONTEXT_INPUTSTREAM,appContext.get(Constants.APPCONTEXT_INPUTSTREAM));
  }
  if (appContext.get(Constants.APPCONTEXT_CLOSEINPUTSTREAM) != null) {
    appContext.put(org.eclipse.datatools.enablement.oda.xml.Constants.APPCONTEXT_CLOSEINPUTSTREAM,appContext.get(Constants.APPCONTEXT_CLOSEINPUTSTREAM));
  }
  super.setAppContext((Map)context);
}
Program: 74751
Project: 74751
Buggy source:
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
    if (this.rowLenDis != null) {
      this.rowLenDis.close();
      this.rowLenDis=null;
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
  }
 catch (  IOException e) {
  }
}
Program: 74752
Project: 74752
Buggy source:
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
    if (rowLenDis != null) {
      rowLenDis.close();
      rowLenDis=null;
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
  }
 catch (  IOException e) {
  }
}
Program: 74753
Project: 74753
Buggy source:
/** 
 * This is used for UPDATE, the data in report document as data source for transformation.
 * @return
 * @throws DataException
 */
public IExprDataResultSet loadExprDataResultSet() throws DataException {
  if (version == VersionManager.VERSION_2_0)   throw new DataException(ResourceConstants.WRONG_VERSION);
  InputStream inputStream=streamManager.getInStream(DataEngineContext.EXPR_META_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  BufferedInputStream buffStream=new BufferedInputStream(inputStream);
  ExprMetaInfo[] exprMetas=ExprMetaUtil.loadExprMetaInfo(buffStream);
  try {
    buffStream.close();
    inputStream.close();
  }
 catch (  IOException e) {
  }
  IExprDataResultSet exprDataResultSet=null;
  if (streamManager.isBasedOnSecondRD() == false)   exprDataResultSet=new ExprDataResultSet1(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),exprMetas,streamManager.getVersion());
 else   exprDataResultSet=new ExprDataResultSet2(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.PARENT_SCOPE),exprMetas);
  return exprDataResultSet;
}

Fixed version (ground truth):
/** 
 * This is used for UPDATE, the data in report document as data source for transformation.
 * @return
 * @throws DataException
 */
public IExprDataResultSet loadExprDataResultSet() throws DataException {
  if (version == VersionManager.VERSION_2_0)   throw new DataException(ResourceConstants.WRONG_VERSION);
  InputStream inputStream=streamManager.getInStream(DataEngineContext.EXPR_META_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  BufferedInputStream buffStream=new BufferedInputStream(inputStream);
  ExprMetaInfo[] exprMetas=ExprMetaUtil.loadExprMetaInfo(buffStream);
  try {
    buffStream.close();
    inputStream.close();
  }
 catch (  IOException e) {
  }
  IExprDataResultSet exprDataResultSet=null;
  if (streamManager.isBasedOnSecondRD() == false)   exprDataResultSet=new ExprDataResultSet1(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),exprMetas,streamManager.getVersion());
 else   exprDataResultSet=new ExprDataResultSet2(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.PARENT_SCOPE),exprMetas,version);
  return exprDataResultSet;
}
Program: 74754
Project: 74754
Buggy source:
/** 
 * @param lastRowIndex
 * @param currIndex
 * @throws IOException
 */
private void saveNullRowsBetween(int lastRowIndex,int currIndex) throws IOException {
  int gapRows=currIndex - lastRowIndex - 1;
  for (int i=0; i < gapRows; i++) {
    IOUtil.writeInt(this.rowExprsDos,0);
    IOUtil.writeInt(this.rowLenDos,currentOffset);
    currentOffset+=IOUtil.INT_LENGTH;
  }
}

Fixed version (ground truth):
/** 
 * @param lastRowIndex
 * @param currIndex
 * @throws IOException
 */
private void saveNullRowsBetween(int lastRowIndex,int currIndex) throws IOException {
  int gapRows=currIndex - lastRowIndex - 1;
  for (int i=0; i < gapRows; i++) {
    IOUtil.writeInt(this.rowExprsDos,0);
    IOUtil.writeLong(this.rowLenDos,currentOffset);
    currentOffset+=IOUtil.INT_LENGTH;
  }
}
Program: 74755
Project: 74755
Buggy source:
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_2_1_1;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_2_1_2;
}
Program: 74756
Project: 74756
Buggy source:
/** 
 * @param rowExprsRAIs
 * @param rowLenRAIs
 * @param version
 */
ExprDataReader1(RAInputStream rowExprsRAIs,RAInputStream rowLenRAIs,int version) throws DataException {
  this.INT_LENGTH=IOUtil.INT_LENGTH;
  try {
    this.rowCount=IOUtil.readInt(rowExprsRAIs);
    int exprCount=IOUtil.readInt(rowExprsRAIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsRAIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsRAIs=rowExprsRAIs;
  this.rowLenRAIs=rowLenRAIs;
  this.version=version;
  this.currReadIndex=0;
  this.currRowIndex=-1;
}

Fixed version (ground truth):
/** 
 * @param rowExprsRAIs
 * @param rowLenRAIs
 * @param version
 */
ExprDataReader1(RAInputStream rowExprsRAIs,RAInputStream rowLenRAIs,int version) throws DataException {
  this.INT_LENGTH=IOUtil.INT_LENGTH;
  try {
    this.rowCount=IOUtil.readInt(rowExprsRAIs);
    int exprCount=IOUtil.readInt(rowExprsRAIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsRAIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsRAIs=rowExprsRAIs;
  this.rowLenRAIs=rowLenRAIs;
  this.rowLenDis=new DataInputStream(rowLenRAIs);
  this.version=version;
  this.currReadIndex=0;
  this.currRowIndex=-1;
}
Program: 74757
Project: 74757
Buggy source:
/** 
 * @param absoluteRowIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteRowIndex) throws IOException, DataException {
  if (currReadIndex == absoluteRowIndex)   return;
  if (version == VersionManager.VERSION_2_0) {
    int exprCount;
    int gapRows=absoluteRowIndex - currReadIndex;
    for (int j=0; j < gapRows; j++) {
      exprCount=IOUtil.readInt(rowExprsDis);
      for (int i=0; i < exprCount; i++) {
        IOUtil.readObject(rowExprsDis);
      }
    }
  }
 else {
    rowLenRAIs.seek(absoluteRowIndex * INT_LENGTH);
    int rowOffsetAbsolute=IOUtil.readInt(rowLenRAIs);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
}

Fixed version (ground truth):
/** 
 * @param absoluteRowIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteRowIndex) throws IOException, DataException {
  if (currReadIndex == absoluteRowIndex)   return;
  if (version == VersionManager.VERSION_2_0) {
    int exprCount;
    int gapRows=absoluteRowIndex - currReadIndex;
    for (int j=0; j < gapRows; j++) {
      exprCount=IOUtil.readInt(rowExprsDis);
      for (int i=0; i < exprCount; i++) {
        IOUtil.readObject(rowExprsDis);
      }
    }
  }
 else   if (version <= VersionManager.VERSION_2_2_1_1) {
    rowLenRAIs.seek(absoluteRowIndex * INT_LENGTH);
    int rowOffsetAbsolute=IOUtil.readInt(rowLenRAIs);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
 else {
    rowLenRAIs.seek(absoluteRowIndex * 8);
    long rowOffsetAbsolute=IOUtil.readLong(this.rowLenDis);
    rowExprsRAIs.seek(rowOffsetAbsolute + this.metaOffset);
    rowExprsDis=new DataInputStream(rowExprsRAIs);
  }
}
Program: 74758
Project: 74758
Buggy source:
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
    if (this.rowLenDis != null) {
      this.rowLenDis.close();
      this.rowLenDis=null;
    }
  }
 catch (  IOException e) {
  }
}
Program: 74759
Project: 74759
Buggy source:
/** 
 * @param absoluteIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteIndex) throws IOException, DataException {
  if (currRowLenReadIndex == absoluteIndex)   return;
  currRowLenReadIndex=absoluteIndex + 1;
  rowLenIs.seek(absoluteIndex * 4);
  rowExprsIs.seek(IOUtil.readInt(rowLenIs) + this.metaOffset);
  rowExprsDis=new DataInputStream(rowExprsIs);
}

Fixed version (ground truth):
/** 
 * @param absoluteIndex
 * @throws IOException
 * @throws DataException
 */
private void skipTo(int absoluteIndex) throws IOException, DataException {
  if (currRowLenReadIndex == absoluteIndex)   return;
  currRowLenReadIndex=absoluteIndex + 1;
  rowLenIs.seek(absoluteIndex * ((this.version > VersionManager.VERSION_2_2_1_1) ? 8 : 4));
  if (this.version <= VersionManager.VERSION_2_2_1_1)   rowExprsIs.seek(IOUtil.readInt(rowLenIs) + this.metaOffset);
 else   rowExprsIs.seek(IOUtil.readLong(this.rowLenDis) + this.metaOffset);
  rowExprsDis=new DataInputStream(rowExprsIs);
}
Program: 74760
Project: 74760
Buggy source:
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=0;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}

Fixed version (ground truth):
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    this.rowLenDis=new DataInputStream(rowLenIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=0;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}
Program: 74761
Project: 74761
Buggy source:
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public void close(){
  try {
    if (rowExprsDis != null) {
      rowExprsDis.close();
      rowExprsDis=null;
    }
    if (rowLenDis != null) {
      rowLenDis.close();
      rowLenDis=null;
    }
  }
 catch (  IOException e) {
  }
}
Program: 74762
Project: 74762
Buggy source:
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @param rowInfoIs
 * @throws DataException
 */
ExprDataReader2(RAInputStream rowExprsIs,RAInputStream rowLenIs,RAInputStream rowInfoIs) throws DataException {
  this.rowIndexUtil=new RowIndexUtil(rowInfoIs);
  try {
    int rowCount=(int)(rowInfoIs.length() / 4);
    initialize(rowExprsIs,rowLenIs,rowCount);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @param rowInfoIs
 * @throws DataException
 */
ExprDataReader2(RAInputStream rowExprsIs,RAInputStream rowLenIs,RAInputStream rowInfoIs,int version) throws DataException {
  this.version=version;
  this.rowIndexUtil=new RowIndexUtil(rowInfoIs);
  try {
    int rowCount=(int)(rowInfoIs.length() / 4);
    initialize(rowExprsIs,rowLenIs,rowCount);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}
Program: 74763
Project: 74763
Buggy source:
/** 
 * @param rowIs
 * @param rowLenIs
 * @param destRowIndex
 * @param inExprMetas
 */
public ExprDataResultSet2(RAInputStream rowIs,RAInputStream rowLenIs,int destRowIndex[],ExprMetaInfo[] inExprMetas) throws DataException {
  this.rowIs=rowIs;
  this.rowLenIs=rowLenIs;
  IExprDataReader exprDataReader=new ExprDataReader3(rowIs,rowLenIs,destRowIndex);
  this.rowCount=exprDataReader.getCount();
  super.init(inExprMetas,exprDataReader);
}

Fixed version (ground truth):
/** 
 * @param rowIs
 * @param rowLenIs
 * @param destRowIndex
 * @param inExprMetas
 */
public ExprDataResultSet2(RAInputStream rowIs,RAInputStream rowLenIs,int destRowIndex[],ExprMetaInfo[] inExprMetas,int version) throws DataException {
  this.rowIs=rowIs;
  this.rowLenIs=rowLenIs;
  IExprDataReader exprDataReader=new ExprDataReader3(rowIs,rowLenIs,destRowIndex,version);
  this.rowCount=exprDataReader.getCount();
  super.init(inExprMetas,exprDataReader);
}
Program: 74764
Project: 74764
Buggy source:
/** 
 * @throws DataException
 */
protected void prepare() throws DataException {
  this.rdGroupUtil=RDLoadUtil.loadGroupUtil(streamManager,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  if (this.isBasedOnSecondRD == false) {
    rowExprsRAIs=streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    if (version > VersionManager.VERSION_2_0) {
      rowLenRAIs=streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    }
    this.exprResultReader=new ExprDataReader1(this.rowExprsRAIs,this.rowLenRAIs,this.version);
    this.rowCount=exprResultReader.getCount();
  }
 else {
    rowExprsRAIs=streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
    rowLenRAIs=streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
    rowInfoRAIs=streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    this.exprResultReader=new ExprDataReader2(rowExprsRAIs,rowLenRAIs,rowInfoRAIs);
    this.rowCount=this.exprResultReader.getCount();
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
protected void prepare() throws DataException {
  this.rdGroupUtil=RDLoadUtil.loadGroupUtil(streamManager,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  if (this.isBasedOnSecondRD == false) {
    rowExprsRAIs=streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    if (version > VersionManager.VERSION_2_0) {
      rowLenRAIs=streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    }
    this.exprResultReader=new ExprDataReader1(this.rowExprsRAIs,this.rowLenRAIs,this.version);
    this.rowCount=exprResultReader.getCount();
  }
 else {
    rowExprsRAIs=streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
    rowLenRAIs=streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
    rowInfoRAIs=streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    this.exprResultReader=new ExprDataReader2(rowExprsRAIs,rowLenRAIs,rowInfoRAIs,version);
    this.rowCount=this.exprResultReader.getCount();
  }
}
Program: 74765
Project: 74765
Buggy source:
protected void prepare() throws DataException {
  this.rdGroupUtil=RDLoadUtil.loadGroupUtil(streamManager,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  int parentIndex=0;
  try {
    InputStream inputStream=streamManager.getInStream(DataEngineContext.SUBQUERY_PARENTINDEX_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.SELF_SCOPE);
    parentIndex=IOUtil.readInt(inputStream);
  }
 catch (  IOException e) {
    throw new DataException(e.getMessage());
  }
  rowExprsRAIs=streamManager.getInStream2(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.BASE_SCOPE,parentIndex);
  rowLenRAIs=streamManager.getInStream2(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.BASE_SCOPE,parentIndex);
  rowInfoRAIs=streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.SELF_SCOPE);
  this.exprResultReader=new ExprDataReader2(rowExprsRAIs,rowLenRAIs,rowInfoRAIs);
  this.rowCount=this.exprResultReader.getCount();
}

Fixed version (ground truth):
protected void prepare() throws DataException {
  this.rdGroupUtil=RDLoadUtil.loadGroupUtil(streamManager,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  int parentIndex=0;
  try {
    InputStream inputStream=streamManager.getInStream(DataEngineContext.SUBQUERY_PARENTINDEX_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.SELF_SCOPE);
    parentIndex=IOUtil.readInt(inputStream);
  }
 catch (  IOException e) {
    throw new DataException(e.getMessage());
  }
  rowExprsRAIs=streamManager.getInStream2(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.BASE_SCOPE,parentIndex);
  rowLenRAIs=streamManager.getInStream2(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.BASE_SCOPE,parentIndex);
  rowInfoRAIs=streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.SUB_QUERY_STREAM,StreamManager.SELF_SCOPE);
  this.exprResultReader=new ExprDataReader2(rowExprsRAIs,rowLenRAIs,rowInfoRAIs,version);
  this.rowCount=this.exprResultReader.getCount();
}
Program: 74766
Project: 74766
Buggy source:
/** 
 * Clean the temporary data.
 * @throws DataException
 */
private void cleanTempColumns() throws DataException {
  IResultClass newMeta=rebuildResultClass(populator.getResultSetMetadata());
  populator.setResultSetMetadata(newMeta);
  populator.getCache().setResultClass(newMeta);
}

Fixed version (ground truth):
/** 
 * Clean the temporary data.
 * @throws DataException
 */
private void cleanTempColumns() throws DataException {
  IResultClass newMeta=rebuildResultClass(populator.getResultSetMetadata());
  populator.setResultSetMetadata(newMeta);
  populator.getCache().setResultClass(newMeta);
  PassUtil.pass(populator,new OdiResultSetWrapper(populator.getResultIterator()),false,session);
  populator.getCache().reset();
  populator.getCache().next();
  populator.getGroupProcessorManager().getGroupCalculationUtil().getGroupInformationUtil().setLeaveGroupIndex(0);
}
Program: 74767
Project: 74767
Buggy source:
public Runnable createModelEventRunnable(Object focus,int type,Map args){
switch (type) {
case NotificationEvent.CONTENT_REPLACE_EVENT:
case NotificationEvent.TEMPLATE_TRANSFORM_EVENT:
case NotificationEvent.CONTENT_EVENT:
{
      return new EditpartReportEventRunnable(focus,type,args){
        public void runModelChange(){
          contentChange(getFocus(),getArgs());
        }
      }
;
    }
case NotificationEvent.NAME_EVENT:
case NotificationEvent.STYLE_EVENT:
case NotificationEvent.EXTENSION_PROPERTY_DEFINITION_EVENT:
case NotificationEvent.THEME_EVENT:
case NotificationEvent.LIBRARY_EVENT:
case NotificationEvent.ELEMENT_LOCALIZE_EVENT:
case NotificationEvent.PROPERTY_EVENT:
{
    return new EditpartReportEventRunnable(focus,type,args){
      public void runModelChange(){
        propertyChange(getFocus(),getArgs());
      }
    }
;
  }
case NotificationEvent.LIBRARY_RELOADED_EVENT:
{
  return new EditpartReportEventRunnable(focus,type,args){
    public void runModelChange(){
      reloadTheChildren();
    }
  }
;
}
default :
break;
}
return null;
}

Fixed version (ground truth):
public Runnable createModelEventRunnable(Object focus,int type,Map args){
switch (type) {
case NotificationEvent.CONTENT_REPLACE_EVENT:
case NotificationEvent.TEMPLATE_TRANSFORM_EVENT:
case NotificationEvent.CONTENT_EVENT:
{
      return new EditpartReportEventRunnable(focus,type,args){
        public void runModelChange(){
          contentChange(getFocus(),getArgs());
        }
      }
;
    }
case NotificationEvent.NAME_EVENT:
case NotificationEvent.STYLE_EVENT:
case NotificationEvent.EXTENSION_PROPERTY_DEFINITION_EVENT:
case NotificationEvent.THEME_EVENT:
case NotificationEvent.LIBRARY_EVENT:
case NotificationEvent.ELEMENT_LOCALIZE_EVENT:
case NotificationEvent.PROPERTY_EVENT:
{
    return new EditpartReportEventRunnable(focus,type,args){
      public void runModelChange(){
        propertyChange(getFocus(),getArgs());
      }
    }
;
  }
case NotificationEvent.CSS_RELOADED_EVENT:
case NotificationEvent.LIBRARY_RELOADED_EVENT:
{
  return new EditpartReportEventRunnable(focus,type,args){
    public void runModelChange(){
      reloadTheChildren();
    }
  }
;
}
default :
break;
}
return null;
}
Program: 74768
Project: 74768
Buggy source:
/** 
 * Tests reload css style sheet
 * @throws Exception
 */
public void testReloadCssStyleSheetOperation() throws Exception {
  List fileNames=new ArrayList();
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  List filePaths=dumpDesignAndLibrariesToFile(fileNames);
  String designFilePath=(String)filePaths.get(0);
  String baseFilePath=(String)filePaths.get(1);
  String newFilePath=(String)filePaths.get(2);
  openDesign(designFilePath,false);
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  LabelHandle labelHandle2=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(labelHandle.getStyle());
  assertEquals("String_Node_Str",labelHandle2.getStyle().getFontStyle());
  copyContentToFile(newFilePath,baseFilePath);
  CssStyleSheetHandle sheetHandle=(CssStyleSheetHandle)designHandle.getAllCssStyleSheets().get(0);
  designHandle.reloadCss(sheetHandle);
  SharedStyleHandle styleHandle=labelHandle.getStyle();
  assertNull(styleHandle);
  SharedStyleHandle styleHandle2=labelHandle2.getStyle();
  assertNotNull(styleHandle2);
  assertEquals("String_Node_Str",styleHandle2.getFontStyle());
}

Fixed version (ground truth):
/** 
 * Tests reload css style sheet
 * @throws Exception
 */
public void testReloadCssStyleSheetOperation() throws Exception {
  List fileNames=new ArrayList();
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  fileNames.add(INPUT_FOLDER + "String_Node_Str");
  List filePaths=dumpDesignAndLibrariesToFile(fileNames);
  String designFilePath=(String)filePaths.get(0);
  String baseFilePath=(String)filePaths.get(1);
  String newFilePath=(String)filePaths.get(2);
  openDesign(designFilePath,false);
  LabelHandle labelHandle=(LabelHandle)designHandle.findElement("String_Node_Str");
  LabelHandle labelHandle2=(LabelHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(labelHandle.getStyle());
  assertEquals("String_Node_Str",labelHandle2.getStyle().getFontStyle());
  copyContentToFile(newFilePath,baseFilePath);
  CssStyleSheetHandle sheetHandle=(CssStyleSheetHandle)designHandle.getAllCssStyleSheets().get(0);
  designHandle.reloadCss(sheetHandle);
  SharedStyleHandle styleHandle=labelHandle.getStyle();
  assertNull(styleHandle);
  SharedStyleHandle styleHandle2=labelHandle2.getStyle();
  assertNotNull(styleHandle2);
  assertEquals("String_Node_Str",styleHandle2.getFontStyle());
  File file=new File(baseFilePath);
  file.delete();
  try {
    designHandle.reloadCss(sheetHandle);
  }
 catch (  CssException e) {
    assertEquals(CssException.DESIGN_EXCEPTION_CSS_NOT_FOUND,e.getErrorCode());
  }
}
Program: 74769
Project: 74769
Buggy source:
/** 
 * Reloads the css style sheet with the given file path. After reloading, acticity stack is cleared.
 * @param sheet css style sheet
 * @throws SemanticException
 */
public void reloadCss(CssStyleSheet sheet) throws SemanticException {
  if (sheet == null)   return;
  String fileName=sheet.getFileName();
  CssStyleSheet newStyleSheet;
  try {
    newStyleSheet=module.loadCss(fileName);
  }
 catch (  StyleSheetException e) {
    throw new CssException(module,new String[]{fileName},CssException.DESIGN_EXCEPTION_BADCSSFILE);
  }
  List csses=((ICssStyleSheetOperation)element).getCsses();
  int pos=csses.indexOf(sheet);
  ActivityStack activityStack=getActivityStack();
  activityStack.startSilentTrans();
  CssRecord record=new CssRecord(module,element,sheet,false);
  getActivityStack().execute(record);
  record=new CssRecord(module,element,newStyleSheet,true,pos);
  getActivityStack().execute(record);
  doPostReloadAction(newStyleSheet);
}

Fixed version (ground truth):
/** 
 * Reloads the css style sheet with the given file path. After reloading, acticity stack is cleared.
 * @param sheet css style sheet
 * @throws SemanticException
 */
public void reloadCss(CssStyleSheet sheet) throws SemanticException {
  if (sheet == null)   return;
  String fileName=sheet.getFileName();
  CssStyleSheet newStyleSheet;
  try {
    newStyleSheet=module.loadCss(fileName);
  }
 catch (  StyleSheetException e) {
    String errorCode=ModuleUtil.changeSheetErrorCodeToCssErrorCode(e.getErrorCode());
    throw new CssException(module,new String[]{fileName},errorCode);
  }
  List csses=((ICssStyleSheetOperation)element).getCsses();
  int pos=csses.indexOf(sheet);
  ActivityStack activityStack=getActivityStack();
  activityStack.startSilentTrans();
  CssRecord record=new CssRecord(module,element,sheet,false);
  getActivityStack().execute(record);
  record=new CssRecord(module,element,newStyleSheet,true,pos);
  getActivityStack().execute(record);
  doPostReloadAction(newStyleSheet);
}
Program: 74770
Project: 74770
Buggy source:
/** 
 * @param column
 * @param hint
 */
ResultSetColumnInfo(OdaResultSetColumn column,ColumnHint hint){
  this.column=column;
  this.hint=hint;
}

Fixed version (ground truth):
ResultSetColumnInfo(OdaResultSetColumn column,ColumnHint hint){
  this.column=column;
  this.hint=hint;
}
Program: 74771
Project: 74771
Buggy source:
/** 
 * Updates column hint values by given data element attributes.
 * @param dataAttrs the latest data element attributes
 * @param cachedDataAttrs the last(cached) data element attributes
 * @param newHint the column hint
 */
private void updateColumnHintFromDataAttrs(DataElementAttributes dataAttrs,DataElementAttributes cachedDataAttrs,ColumnHint newHint){
  if (dataAttrs == null)   return;
  Object oldValue=cachedDataAttrs == null ? null : cachedDataAttrs.getName();
  Object newValue=dataAttrs.getName();
  if (oldValue == null || !oldValue.equals(newValue))   newHint.setProperty(ColumnHint.COLUMN_NAME_MEMBER,newValue);
  DataElementUIHints dataUIHints=dataAttrs.getUiHints();
  if (dataUIHints == null)   return;
  DataElementUIHints cachedDataUIHints=cachedDataAttrs == null ? null : cachedDataAttrs.getUiHints();
  oldValue=cachedDataUIHints == null ? null : cachedDataUIHints.getDisplayName();
  newValue=dataUIHints.getDisplayName();
  String handleValue=(String)newHint.getLocalProperty(null,ColumnHint.DISPLAY_NAME_MEMBER);
  if (handleValue != null && !handleValue.equals(oldValue))   return;
  if (oldValue == null || !oldValue.equals(newValue)) {
    newHint.setProperty(ColumnHint.DISPLAY_NAME_MEMBER,newValue);
  }
}

Fixed version (ground truth):
/** 
 * Updates column hint values by given data element attributes.
 * @param dataAttrs the latest data element attributes
 * @param cachedDataAttrs the last(cached) data element attributes
 * @param newHint the column hint
 */
private void updateColumnHintFromDataAttrs(DataElementAttributes dataAttrs,DataElementAttributes cachedDataAttrs,ColumnHint newHint){
  if (dataAttrs == null)   return;
  Object oldValue=cachedDataAttrs == null ? null : cachedDataAttrs.getName();
  Object newValue=dataAttrs.getName();
  if (oldValue == null || !oldValue.equals(newValue))   newHint.setProperty(ColumnHint.COLUMN_NAME_MEMBER,newValue);
  DataElementUIHints dataUIHints=dataAttrs.getUiHints();
  if (dataUIHints == null)   return;
  DataElementUIHints cachedDataUIHints=cachedDataAttrs == null ? null : cachedDataAttrs.getUiHints();
  oldValue=cachedDataUIHints == null ? null : cachedDataUIHints.getDisplayName();
  newValue=dataUIHints.getDisplayName();
  if (oldValue == null || !oldValue.equals(newValue)) {
    newHint.setProperty(ColumnHint.DISPLAY_NAME_MEMBER,newValue);
  }
}
Program: 74772
Project: 74772
Buggy source:
public void testV2() throws Exception {
  String golden=getGolden(GOLDEN_V2_STREAM);
  assertEquals(golden,value);
}

Fixed version (ground truth):
public void testV2() throws Exception {
  String value=getValue(VALUE_V2_STREAM);
  String golden=getGolden(GOLDEN_V2_STREAM);
  assertEquals(golden,value);
}
Program: 74773
Project: 74773
Buggy source:
public void testV1() throws Exception {
  String golden=getGolden(GOLDEN_V1_STREAM);
  assertEquals(golden,value);
}

Fixed version (ground truth):
public void testV1() throws Exception {
  String value=getValue(VALUE_V1_STREAM);
  String golden=getGolden(GOLDEN_V1_STREAM);
  assertEquals(golden,value);
}