nus-yam/ex-repair huggingface dataset:
Program: 168477
Project: 168477
Buggy source:
private List<ColumnMetadata> createMetadata(){
  List<ColumnMetadata> retunColumnMetadata=new ArrayList<>();
  for (  ColumnName colName : select.getColumnMap().keySet()) {
    String field=colName.getName();
    ColumnType colType=select.getTypeMap().get(field);
    colType=updateColumnType(colType);
    ColumnMetadata columnMetadata=new ColumnMetadata(projection.getTableName().getName(),field,colType);
    columnMetadata.setColumnAlias(select.getColumnMap().get(colName));
    retunColumnMetadata.add(columnMetadata);
  }
  return retunColumnMetadata;
}

Fixed version (ground truth):
private List<ColumnMetadata> createMetadata(){
  List<ColumnMetadata> retunColumnMetadata=new ArrayList<>();
  for (  ColumnName colName : select.getColumnMap().keySet()) {
    String field=colName.getName();
    ColumnType colType=select.getTypeMap().get(colName.getQualifiedName());
    colType=updateColumnType(colType);
    ColumnMetadata columnMetadata=new ColumnMetadata(projection.getTableName().getName(),field,colType);
    columnMetadata.setColumnAlias(select.getColumnMap().get(colName));
    retunColumnMetadata.add(columnMetadata);
  }
  return retunColumnMetadata;
}
Program: 168479
Project: 168479
Buggy source:
private void listAttributeRecords(final CommonBTNode curNode,final CommonHFSCatalogNodeID nodeID,final LinkedList<CommonHFSAttributesLeafRecord> list){
  final CommonHFSAttributesKey searchKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID).getHFSCatalogNodeID(),0,new char[0]));
  final CommonHFSAttributesKey endKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID.add(1)).getHFSCatalogNodeID(),0,new char[0]));
  if (curNode instanceof CommonHFSAttributesLeafNode) {
    CommonHFSAttributesLeafNode leafNode=(CommonHFSAttributesLeafNode)curNode;
    int listSizeBefore=list.size();
    if (!findLEKeys(leafNode,searchKey,endKey,list)) {
      while (list.size() > listSizeBefore) {
        list.removeLast();
      }
    }
  }
 else   if (curNode instanceof CommonHFSAttributesIndexNode) {
    CommonHFSAttributesIndexNode indexNode=(CommonHFSAttributesIndexNode)curNode;
    LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>> recList=new LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>>();
    findLEKeys(indexNode,searchKey,endKey,recList);
    for (    CommonBTIndexRecord<CommonHFSAttributesKey> rec : recList) {
      listAttributeRecords(getNode(rec.getIndex()),nodeID,list);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + curNode.getClass());
  }
}

Fixed version (ground truth):
private void listAttributeRecords(final CommonBTNode curNode,final CommonHFSCatalogNodeID nodeID,final LinkedList<CommonHFSAttributesLeafRecord> list){
  final CommonHFSAttributesKey searchKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID).getHFSCatalogNodeID(),0,new char[0]));
  final CommonHFSAttributesKey endKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID.add(1)).getHFSCatalogNodeID(),0,new char[0]));
  if (curNode instanceof CommonHFSAttributesLeafNode) {
    CommonHFSAttributesLeafNode leafNode=(CommonHFSAttributesLeafNode)curNode;
    int listSizeBefore=list.size();
    if (!findLEKeys(leafNode,searchKey,endKey,true,list)) {
      while (list.size() > listSizeBefore) {
        list.removeLast();
      }
    }
  }
 else   if (curNode instanceof CommonHFSAttributesIndexNode) {
    CommonHFSAttributesIndexNode indexNode=(CommonHFSAttributesIndexNode)curNode;
    LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>> recList=new LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>>();
    findLEKeys(indexNode,searchKey,endKey,false,recList);
    for (    CommonBTIndexRecord<CommonHFSAttributesKey> rec : recList) {
      listAttributeRecords(getNode(rec.getIndex()),nodeID,list);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + curNode.getClass());
  }
}
Program: 168481
Project: 168481
Buggy source:
private List<CommonBTIndexRecord<CommonHFSCatalogKey>> findLEChildKeys(CommonBTKeyedNode<CommonBTIndexRecord<CommonHFSCatalogKey>> indexNode,CommonHFSCatalogNodeID rootFolderID){
  final CommonHFSCatalogNodeID nextCNID=vol.createCommonHFSCatalogNodeID((int)(rootFolderID.toLong() + 1));
  final CommonHFSCatalogKey minKeyInclusive=vol.createCommonHFSCatalogKey(rootFolderID,vol.getEmptyString());
  final CommonHFSCatalogKey maxKeyExclusive=vol.createCommonHFSCatalogKey(nextCNID,vol.getEmptyString());
  return findLEKeys(indexNode,minKeyInclusive,maxKeyExclusive);
}

Fixed version (ground truth):
private List<CommonBTIndexRecord<CommonHFSCatalogKey>> findLEChildKeys(CommonBTKeyedNode<CommonBTIndexRecord<CommonHFSCatalogKey>> indexNode,CommonHFSCatalogNodeID rootFolderID){
  final CommonHFSCatalogNodeID nextCNID=vol.createCommonHFSCatalogNodeID((int)(rootFolderID.toLong() + 1));
  final CommonHFSCatalogKey minKeyInclusive=vol.createCommonHFSCatalogKey(rootFolderID,vol.getEmptyString());
  final CommonHFSCatalogKey maxKeyExclusive=vol.createCommonHFSCatalogKey(nextCNID,vol.getEmptyString());
  return findLEKeys(indexNode,minKeyInclusive,maxKeyExclusive,false);
}
Program: 168482
Project: 168482
Buggy source:
private void listAttributeRecords(final CommonBTNode curNode,final CommonHFSCatalogNodeID nodeID,final LinkedList<CommonHFSAttributesLeafRecord> list){
  final CommonHFSAttributesKey searchKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID).getHFSCatalogNodeID(),0,new char[0]));
  final CommonHFSAttributesKey endKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID.add(1)).getHFSCatalogNodeID(),0,new char[0]));
  if (curNode instanceof CommonHFSAttributesLeafNode) {
    CommonHFSAttributesLeafNode leafNode=(CommonHFSAttributesLeafNode)curNode;
    int listSizeBefore=list.size();
    if (!findLEKeys(leafNode,searchKey,endKey,list)) {
      while (list.size() > listSizeBefore) {
        list.removeLast();
      }
    }
  }
 else   if (curNode instanceof CommonHFSAttributesIndexNode) {
    CommonHFSAttributesIndexNode indexNode=(CommonHFSAttributesIndexNode)curNode;
    LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>> recList=new LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>>();
    if (findLEKeys(indexNode,searchKey,endKey,recList)) {
      for (      CommonBTIndexRecord<CommonHFSAttributesKey> rec : recList) {
        listAttributeRecords(getNode(rec.getIndex()),nodeID,list);
      }
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + curNode.getClass());
  }
}

Fixed version (ground truth):
private void listAttributeRecords(final CommonBTNode curNode,final CommonHFSCatalogNodeID nodeID,final LinkedList<CommonHFSAttributesLeafRecord> list){
  final CommonHFSAttributesKey searchKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID).getHFSCatalogNodeID(),0,new char[0]));
  final CommonHFSAttributesKey endKey=CommonHFSAttributesKey.create(new HFSPlusAttributesKey(((CommonHFSCatalogNodeID.HFSPlusImplementation)nodeID.add(1)).getHFSCatalogNodeID(),0,new char[0]));
  if (curNode instanceof CommonHFSAttributesLeafNode) {
    CommonHFSAttributesLeafNode leafNode=(CommonHFSAttributesLeafNode)curNode;
    int listSizeBefore=list.size();
    if (!findLEKeys(leafNode,searchKey,endKey,list)) {
      while (list.size() > listSizeBefore) {
        list.removeLast();
      }
    }
  }
 else   if (curNode instanceof CommonHFSAttributesIndexNode) {
    CommonHFSAttributesIndexNode indexNode=(CommonHFSAttributesIndexNode)curNode;
    LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>> recList=new LinkedList<CommonBTIndexRecord<CommonHFSAttributesKey>>();
    findLEKeys(indexNode,searchKey,endKey,recList);
    for (    CommonBTIndexRecord<CommonHFSAttributesKey> rec : recList) {
      listAttributeRecords(getNode(rec.getIndex()),nodeID,list);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + curNode.getClass());
  }
}
Program: 168489
Project: 168489
Buggy source:
public byte[] getBytes(){
  byte[] result=new byte[length()];
  int offset=0;
{
    byte[] tempData=this.frScroll.getBytes();
    System.arraycopy(tempData,0,result,offset,tempData.length);
    offset+=tempData.length;
  }
  Util.arrayPutBE(result,offset,this.frOpenChain);
  offset+=4;
  Util.arrayPutBE(result,offset,this.frScript);
  offset+=1;
  Util.arrayPutBE(result,offset,this.frXFlags);
  offset+=1;
  Util.arrayPutBE(result,offset,this.frComment);
  offset+=2;
  Util.arrayPutBE(result,offset,this.frPutAway);
  offset+=4;
  return offset - startOffset;
}

Fixed version (ground truth):
public int getBytes(byte[] result,int offset){
  final int startOffset=offset;
{
    byte[] tempData=this.frScroll.getBytes();
    System.arraycopy(tempData,0,result,offset,tempData.length);
    offset+=tempData.length;
  }
  Util.arrayPutBE(result,offset,this.frOpenChain);
  offset+=4;
  Util.arrayPutBE(result,offset,this.frScript);
  offset+=1;
  Util.arrayPutBE(result,offset,this.frXFlags);
  offset+=1;
  Util.arrayPutBE(result,offset,this.frComment);
  offset+=2;
  Util.arrayPutBE(result,offset,this.frPutAway);
  offset+=4;
  return offset - startOffset;
}
Program: 168490
Project: 168490
Buggy source:
public Dictionary getStructElements(){
  DictionaryBuilder db=new DictionaryBuilder(DXInfo.class.getSimpleName());
  db.add("String_Node_Str",frScroll.getStructElements());
  db.addUIntBE("String_Node_Str",frOpenChain);
  db.addUIntBE("String_Node_Str",frScript);
  db.addUIntBE("String_Node_Str",frXFlags);
  db.addUIntBE("String_Node_Str",frComment);
  db.addUIntBE("String_Node_Str",frPutAway);
  return db.getResult();
}

Fixed version (ground truth):
public Dictionary getStructElements(){
  DictionaryBuilder db=new DictionaryBuilder(DXInfo.class.getSimpleName());
  db.add("String_Node_Str",frScroll.getStructElements());
  try {
    db.addUIntBE("String_Node_Str",getPrivateField("String_Node_Str"),this);
    db.addUIntBE("String_Node_Str",getPrivateField("String_Node_Str"),this);
    db.addUIntBE("String_Node_Str",getPrivateField("String_Node_Str"),this);
    db.addUIntBE("String_Node_Str",getPrivateField("String_Node_Str"),this);
    db.addUIntBE("String_Node_Str",getPrivateField("String_Node_Str"),this);
  }
 catch (  NoSuchFieldException e) {
    throw new RuntimeException(e);
  }
  return db.getResult();
}
Program: 168491
Project: 168491
Buggy source:
/** 
 * Sets the icon images for the specified Window. Java 6 supports icon images of multiple sizes to better adapt across platforms.<br> <b>Invoking this method on a non-Java 6 JRE will cause a class loading exception.</b>
 * @param icons the different sizes of icon images that should be displayedfor the window.
 * @param window the window that the icons should be applied to.
 */
public static void setIconImages(ImageIcon[] icons,Window window){
  LinkedList<Image> iconImages=new LinkedList<Image>();
  for (  ImageIcon ii : icons)   iconImages.addLast(ii.getImage());
  try {
    Class c=window.getClass();
    Method m=c.getMethod("String_Node_Str",LinkedList.class);
    m.invoke(window,iconImages);
  }
 catch (  NoSuchMethodException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalAccessException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalArgumentException ex) {
    throw new RuntimeException(ex);
  }
catch (  InvocationTargetException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Sets the icon images for the specified Window. Java 6 supports icon images of multiple sizes to better adapt across platforms.<br> <b>Invoking this method on a non-Java 6 JRE will cause a class loading exception.</b>
 * @param icons the different sizes of icon images that should be displayedfor the window.
 * @param window the window that the icons should be applied to.
 */
public static void setIconImages(ImageIcon[] icons,Window window){
  LinkedList<Image> iconImages=new LinkedList<Image>();
  for (  ImageIcon ii : icons)   iconImages.addLast(ii.getImage());
  try {
    Class c=window.getClass();
    Method m=c.getMethod("String_Node_Str",List.class);
    m.invoke(window,iconImages);
  }
 catch (  NoSuchMethodException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalAccessException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalArgumentException ex) {
    throw new RuntimeException(ex);
  }
catch (  InvocationTargetException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 168492
Project: 168492
Buggy source:
/** 
 * Adds a row sorter to <code>table</code> with the specified table model. Optionally, a list of Comparators can be supplied, one for each column, that specify the correct way of comparing the objects in that column. Null values means the default comparator will be used.<br> <b>Only Java 6+ virtual machines will support this, so check first with isJava6OrHigher() or risk to crash your program.</b>
 * @param table
 * @param tableModel
 * @param defaultSortColumn the column on which to sort on by default.
 * @param columnComparators
 */
public static void addRowSorter(JTable table,DefaultTableModel tableModel,int defaultSortColumn,List<Comparator<?>> columnComparators){
  TableRowSorter<DefaultTableModel> sorter=new TableRowSorter<DefaultTableModel>(tableModel);
  int i=0;
  for (  Comparator<?> c : columnComparators) {
    if (c != null)     sorter.setComparator(i,c);
    ++i;
  }
  sorter.toggleSortOrder(defaultSortColumn);
  try {
    Class c=table.getClass();
    Method m=c.getMethod("String_Node_Str",TableRowSorter.class);
    m.invoke(table,sorter);
  }
 catch (  NoSuchMethodException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalAccessException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalArgumentException ex) {
    throw new RuntimeException(ex);
  }
catch (  InvocationTargetException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Adds a row sorter to <code>table</code> with the specified table model. Optionally, a list of Comparators can be supplied, one for each column, that specify the correct way of comparing the objects in that column. Null values means the default comparator will be used.<br> <b>Only Java 6+ virtual machines will support this, so check first with isJava6OrHigher() or risk to crash your program.</b>
 * @param table
 * @param tableModel
 * @param defaultSortColumn the column on which to sort on by default.
 * @param columnComparators
 */
public static void addRowSorter(JTable table,DefaultTableModel tableModel,int defaultSortColumn,List<Comparator<?>> columnComparators){
  TableRowSorter<DefaultTableModel> sorter=new TableRowSorter<DefaultTableModel>(tableModel);
  int i=0;
  for (  Comparator<?> c : columnComparators) {
    if (c != null)     sorter.setComparator(i,c);
    ++i;
  }
  sorter.toggleSortOrder(defaultSortColumn);
  try {
    Class c=table.getClass();
    Method m=c.getMethod("String_Node_Str",RowSorter.class);
    m.invoke(table,sorter);
  }
 catch (  NoSuchMethodException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalAccessException ex) {
    throw new RuntimeException(ex);
  }
catch (  IllegalArgumentException ex) {
    throw new RuntimeException(ex);
  }
catch (  InvocationTargetException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 168495
Project: 168495
Buggy source:
protected void extract(String[] parentPath,List<FSEntry> recs,File outDir,ExtractProgressMonitor progressDialog,LinkedList<String> errorMessages,boolean followSymbolicLinks,FSForkType... forkTypes){
  if (!outDir.exists()) {
    String[] options=new String[]{"String_Node_Str","String_Node_Str"};
    int reply=JOptionPane.showOptionDialog(this,"String_Node_Str" + "String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[0]);
    if (reply != 0) {
      errorMessages.addLast("String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str");
      progressDialog.signalCancel();
      return;
    }
 else {
      if (!outDir.mkdirs()) {
        JOptionPane.showMessageDialog(this,"String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
        errorMessages.addLast("String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str");
        progressDialog.signalCancel();
        return;
      }
    }
  }
  ExtractVisitor ev=new ExtractVisitor(progressDialog,errorMessages,outDir,forkTypes);
  traverseTree(parentPath,recs,ev,followSymbolicLinks);
}

Fixed version (ground truth):
protected void extract(String[] parentPath,List<FSEntry> recs,File outDir,ExtractProgressMonitor progressDialog,LinkedList<String> errorMessages,boolean followSymbolicLinks,FSForkType... forkTypes){
  if (!deepExists(outDir)) {
    String[] options=new String[]{"String_Node_Str","String_Node_Str"};
    int reply=JOptionPane.showOptionDialog(this,"String_Node_Str" + "String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[0]);
    if (reply != 0) {
      errorMessages.addLast("String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str");
      progressDialog.signalCancel();
      return;
    }
 else {
      if (!outDir.mkdirs() || !deepExists(outDir)) {
        JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
        errorMessages.addLast("String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str");
        progressDialog.signalCancel();
        return;
      }
    }
  }
 else   if (!outDir.isDirectory()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    errorMessages.addLast("String_Node_Str" + outDir.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str");
    progressDialog.signalCancel();
    return;
  }
  ExtractVisitor ev=new ExtractVisitor(progressDialog,errorMessages,outDir,forkTypes);
  traverseTree(parentPath,recs,ev,followSymbolicLinks);
}
Program: 168497
Project: 168497
Buggy source:
private long extractResourceForkToAppleDoubleStream(FSFork resourceFork,OutputStream os,ProgressMonitor pm) throws IOException {
  ReadableRandomAccessStream in=null;
  try {
    AppleSingleBuilder builder=new AppleSingleBuilder(FileType.APPLEDOUBLE,2,FileSystem.MACOS_X);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    in=resourceFork.getReadableRandomAccessStream();
    long extractedBytes=IOUtil.streamCopy(in,baos,128 * 1024);
    if (extractedBytes != resourceFork.getLength()) {
      System.err.println("String_Node_Str" + "String_Node_Str" + resourceFork.getLength() + "String_Node_Str"+ extractedBytes);
    }
    builder.addResourceFork(baos.toByteArray());
    os.write(builder.getResult());
    pm.addDataProgress(extractedBytes);
    return extractedBytes;
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}

Fixed version (ground truth):
private long extractResourceForkToAppleDoubleStream(FSFork resourceFork,OutputStream os,ProgressMonitor pm) throws IOException {
  ReadableRandomAccessStream in=null;
  try {
    AppleSingleBuilder builder=new AppleSingleBuilder(FileType.APPLEDOUBLE,AppleSingleVersion.VERSION_2_0,FileSystem.MACOS_X);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    in=resourceFork.getReadableRandomAccessStream();
    long extractedBytes=IOUtil.streamCopy(in,baos,128 * 1024);
    if (extractedBytes != resourceFork.getLength()) {
      System.err.println("String_Node_Str" + "String_Node_Str" + resourceFork.getLength() + "String_Node_Str"+ extractedBytes);
    }
    builder.addResourceFork(baos.toByteArray());
    os.write(builder.getResult());
    pm.addDataProgress(extractedBytes);
    return extractedBytes;
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 168498
Project: 168498
Buggy source:
public AppleSingleBuilder(FileType fileType,int version,FileSystem homeFileSystem){
  this.fileType=fileType;
  this.version=version;
  this.homeFileSystem=homeFileSystem;
}

Fixed version (ground truth):
public AppleSingleBuilder(FileType fileType,AppleSingleVersion version,FileSystem homeFileSystem){
  if (fileType == null)   throw new IllegalArgumentException("String_Node_Str");
  if (version == null)   throw new IllegalArgumentException("String_Node_Str");
  if (homeFileSystem == null)   throw new IllegalArgumentException("String_Node_Str");
  this.fileType=fileType;
  this.version=version;
  this.homeFileSystem=homeFileSystem;
}
Program: 168499
Project: 168499
Buggy source:
private void loadFile(File f){
  ReadableRandomAccessStream fileStream=null;
  ResourceForkReader reader=null;
  try {
    fileStream=new ReadableFileStream(f);
    if (AppleSingleHandler.detectFileFormat(fileStream,0) != null) {
      try {
        AppleSingleHandler handler=new AppleSingleHandler(fileStream);
        EntryDescriptor desc=handler.getResourceEntryDescriptor();
        if (desc != null) {
          fileStream=handler.getEntryStream(desc);
        }
      }
 catch (      Exception e) {
        System.err.println("String_Node_Str");
        e.printStackTrace();
      }
    }
    reader=new ResourceForkReader(fileStream);
    resourceForkViewPanel.loadResourceFork(reader);
    setTitle("String_Node_Str" + f.getName() + "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    GUIUtil.displayExceptionDialog(e,this);
    resourceForkViewPanel.loadResourceFork(null);
    if (reader != null)     reader.close();
    if (fileStream != null)     fileStream.close();
  }
}

Fixed version (ground truth):
private void loadFile(File f){
  ReadableRandomAccessStream fileStream=null;
  ResourceForkReader reader=null;
  try {
    fileStream=new ReadableFileStream(f);
    if (AppleSingleHandler.detectFileFormat(fileStream,0) != null) {
      try {
        AppleSingleHandler handler=new AppleSingleHandler(fileStream);
        EntryDescriptor desc=handler.getResourceEntryDescriptor();
        if (desc != null) {
          fileStream=handler.getEntryStream(desc);
        }
      }
 catch (      Exception e) {
        System.err.println("String_Node_Str");
        e.printStackTrace();
      }
    }
 else {
      int res=JOptionPane.showConfirmDialog(this,"String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
      if (res != JOptionPane.YES_OPTION) {
        fileStream.close();
        return;
      }
    }
    reader=new ResourceForkReader(fileStream);
    resourceForkViewPanel.loadResourceFork(reader);
    setTitle("String_Node_Str" + f.getName() + "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    GUIUtil.displayExceptionDialog(e,this);
    resourceForkViewPanel.loadResourceFork(null);
    if (reader != null)     reader.close();
    if (fileStream != null)     fileStream.close();
  }
}
Program: 168500
Project: 168500
Buggy source:
private static boolean extractResourceForkToAppleDoubleFile(FSFork resourceFork,File targetFile){
  FileOutputStream os=null;
  ReadableRandomAccessStream in=null;
  try {
    AppleSingleBuilder builder=new AppleSingleBuilder(FileType.APPLEDOUBLE,2,FileSystem.MACOS_X);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    in=resourceFork.getReadableRandomAccessStream();
    long extractedBytes=IOUtil.streamCopy(in,baos,128 * 1024);
    if (extractedBytes != resourceFork.getLength()) {
      System.err.println("String_Node_Str" + targetFile.getPath() + "String_Node_Str"+ resourceFork.getLength()+ "String_Node_Str"+ extractedBytes);
    }
    builder.addResourceFork(baos.toByteArray());
    os=new FileOutputStream(targetFile);
    os.write(builder.getResult());
    return true;
  }
 catch (  FileNotFoundException fnfe) {
    return false;
  }
catch (  Exception ioe) {
    ioe.printStackTrace();
    return false;
  }
 finally {
    if (os != null) {
      try {
        os.close();
      }
 catch (      Exception e) {
      }
    }
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}

Fixed version (ground truth):
private static boolean extractResourceForkToAppleDoubleFile(FSFork resourceFork,File targetFile){
  FileOutputStream os=null;
  ReadableRandomAccessStream in=null;
  try {
    AppleSingleBuilder builder=new AppleSingleBuilder(FileType.APPLEDOUBLE,AppleSingleVersion.VERSION_2_0,FileSystem.MACOS_X);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    in=resourceFork.getReadableRandomAccessStream();
    long extractedBytes=IOUtil.streamCopy(in,baos,128 * 1024);
    if (extractedBytes != resourceFork.getLength()) {
      System.err.println("String_Node_Str" + targetFile.getPath() + "String_Node_Str"+ resourceFork.getLength()+ "String_Node_Str"+ extractedBytes);
    }
    builder.addResourceFork(baos.toByteArray());
    os=new FileOutputStream(targetFile);
    os.write(builder.getResult());
    return true;
  }
 catch (  FileNotFoundException fnfe) {
    return false;
  }
catch (  Exception ioe) {
    ioe.printStackTrace();
    return false;
  }
 finally {
    if (os != null) {
      try {
        os.close();
      }
 catch (      Exception e) {
      }
    }
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 168501
Project: 168501
Buggy source:
public AppleSingleHeader(byte[] data,int offset){
  System.arraycopy(data,offset + 0,magicNumber,0,4);
  System.arraycopy(data,offset + 4,versionNumber,0,4);
  System.arraycopy(data,offset + 8,homeFileSystem,0,1 * 16);
  System.arraycopy(data,offset + 24,numEntries,0,2);
}

Fixed version (ground truth):
public AppleSingleHeader(long magicNumber,long versionNumber,AppleSingleBuilder.FileSystem homeFileSystem,int numEntries){
  if (magicNumber < 0 || magicNumber > MAX_UINT)   throw new IllegalArgumentException("String_Node_Str" + magicNumber + "String_Node_Str");
  if (versionNumber < 0 || versionNumber > MAX_UINT)   throw new IllegalArgumentException("String_Node_Str" + versionNumber + "String_Node_Str");
  if (homeFileSystem == null)   throw new IllegalArgumentException("String_Node_Str");
  if (numEntries < 0 || numEntries > MAX_USHORT)   throw new IllegalArgumentException("String_Node_Str" + numEntries + "String_Node_Str");
  System.arraycopy(Util.toByteArrayBE((int)magicNumber),0,this.magicNumber,0,4);
  System.arraycopy(Util.toByteArrayBE((int)versionNumber),0,this.versionNumber,0,4);
  System.arraycopy(homeFileSystem.getIdentifier(),0,this.homeFileSystem,0,16);
  System.arraycopy(Util.toByteArrayBE((short)numEntries),0,this.numEntries,0,2);
}
Program: 168502
Project: 168502
Buggy source:
public void printFields(PrintStream ps,String prefix){
  ps.println(prefix + "String_Node_Str" + getMagicNumber());
  ps.println(prefix + "String_Node_Str" + getVersionNumber());
  ps.println(prefix + "String_Node_Str" + getHomeFileSystem());
  ps.println(prefix + "String_Node_Str" + getNumEntries());
}

Fixed version (ground truth):
public void printFields(PrintStream ps,String prefix){
  ps.println(prefix + "String_Node_Str" + getMagicNumber());
  ps.println(prefix + "String_Node_Str" + Util.toHexStringBE(getVersionNumber()));
  ps.println(prefix + "String_Node_Str" + Util.readString(getHomeFileSystem(),"String_Node_Str")+ "String_Node_Str");
  ps.println(prefix + "String_Node_Str" + getNumEntries());
}
Program: 168503
Project: 168503
Buggy source:
public EntryDescriptor(byte[] data,int offset){
  System.arraycopy(data,offset + 0,entryId,0,4);
  System.arraycopy(data,offset + 4,entryOffset,0,4);
  System.arraycopy(data,offset + 8,entryLength,0,4);
}

Fixed version (ground truth):
public EntryDescriptor(long entryId,long entryOffset,long entryLength){
  if (entryId < 0 || entryId > MAX_UINT)   throw new IllegalArgumentException("String_Node_Str" + entryId + "String_Node_Str");
  if (entryOffset < 0 || entryOffset > MAX_UINT)   throw new IllegalArgumentException("String_Node_Str" + entryOffset + "String_Node_Str");
  if (entryLength < 0 || entryLength > MAX_UINT)   throw new IllegalArgumentException("String_Node_Str" + entryLength + "String_Node_Str");
  System.arraycopy(Util.toByteArrayBE((int)entryId),0,this.entryId,0,4);
  System.arraycopy(Util.toByteArrayBE((int)entryOffset),0,this.entryOffset,0,4);
  System.arraycopy(Util.toByteArrayBE((int)entryLength),0,this.entryLength,0,4);
}
Program: 168504
Project: 168504
Buggy source:
private void loadFile(File f){
  ReadableRandomAccessStream fileStream=null;
  ResourceForkReader reader=null;
  try {
    fileStream=new ReadableFileStream(f);
    reader=new ResourceForkReader(fileStream);
    resourceForkViewPanel.loadResourceFork(reader);
  }
 catch (  Exception e) {
    e.printStackTrace();
    GUIUtil.displayExceptionDialog(e,this);
    resourceForkViewPanel.loadResourceFork(null);
    if (reader != null)     reader.close();
    if (fileStream != null)     fileStream.close();
  }
}

Fixed version (ground truth):
private void loadFile(File f){
  ReadableRandomAccessStream fileStream=null;
  ResourceForkReader reader=null;
  try {
    fileStream=new ReadableFileStream(f);
    if (AppleSingleHandler.detectFileFormat(fileStream,0) != null) {
      try {
        AppleSingleHandler handler=new AppleSingleHandler(fileStream);
        EntryDescriptor desc=handler.getResourceEntryDescriptor();
        if (desc != null) {
          fileStream=handler.getEntryStream(desc);
        }
      }
 catch (      Exception e) {
        System.err.println("String_Node_Str");
        e.printStackTrace();
      }
    }
    reader=new ResourceForkReader(fileStream);
    resourceForkViewPanel.loadResourceFork(reader);
    setTitle("String_Node_Str" + f.getName() + "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    GUIUtil.displayExceptionDialog(e,this);
    resourceForkViewPanel.loadResourceFork(null);
    if (reader != null)     reader.close();
    if (fileStream != null)     fileStream.close();
  }
}
Program: 168511
Project: 168511
Buggy source:
public void actionPerformed(ActionEvent ae){
  signalCancel();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent ae){
  signalCancel();
}
Program: 168512
Project: 168512
Buggy source:
public synchronized void signalCancel(){
  cancelButton.setEnabled(false);
  cancelSignaled=true;
}

Fixed version (ground truth):
@Override public synchronized void signalCancel(){
  cancelButton.setEnabled(false);
  cancelSignaled=true;
}
Program: 168513
Project: 168513
Buggy source:
public boolean cancelSignaled(){
  return cancelSignaled;
}

Fixed version (ground truth):
@Override public boolean cancelSignaled(){
  return cancelSignaled;
}
Program: 168514
Project: 168514
Buggy source:
public void addDataProgress(long dataSize){
  completedSize+=dataSize;
  String message=SpeedUnitUtils.bytesToBinaryUnit(completedSize,sizeFormatter) + "String_Node_Str" + SpeedUnitUtils.bytesToBinaryUnit(totalSize,sizeFormatter);
  updateTotalProgress(((double)completedSize) / totalSize,message);
}

Fixed version (ground truth):
@Override public void addDataProgress(long dataSize){
  completedSize+=dataSize;
  String message=SpeedUnitUtils.bytesToBinaryUnit(completedSize,sizeFormatter) + "String_Node_Str" + SpeedUnitUtils.bytesToBinaryUnit(totalSize,sizeFormatter);
  updateTotalProgress(((double)completedSize) / totalSize,message);
}
Program: 168515
Project: 168515
Buggy source:
public void setDataSize(long totalSize){
  this.totalSize=totalSize;
}

Fixed version (ground truth):
@Override public void setDataSize(long totalSize){
  this.totalSize=totalSize;
  addDataProgress(0);
}
Program: 168516
Project: 168516
Buggy source:
private ExtractProgressDialog(Frame owner,boolean modal){
  super(owner,"String_Node_Str",modal);
  progressPanel=new ExtractProgressPanel();
  cancelButton=progressPanel.cancelButton;
  cancelButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent ae){
      signalCancel();
    }
  }
);
  setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent we){
      requestCloseWindow();
    }
  }
);
  add(progressPanel,BorderLayout.CENTER);
  pack();
  setLocationRelativeTo(null);
  setResizable(false);
}

Fixed version (ground truth):
private ExtractProgressDialog(Frame owner,boolean modal){
  super(owner,"String_Node_Str",modal);
  progressPanel=new ExtractProgressPanel();
  cancelButton=progressPanel.cancelButton;
  cancelButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent ae){
      signalCancel();
    }
  }
);
  setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent we){
      requestCloseWindow();
    }
  }
);
  add(progressPanel,BorderLayout.CENTER);
  pack();
  setLocationRelativeTo(null);
  setResizable(false);
}
Program: 168517
Project: 168517
Buggy source:
public void updateTotalProgress(double fraction,String message){
  progressPanel.updateTotalProgress(fraction,message);
}

Fixed version (ground truth):
@Override public void updateTotalProgress(double fraction,String message){
  progressPanel.updateTotalProgress(fraction,message);
}
Program: 168518
Project: 168518
Buggy source:
public void updateCurrentFile(String filename,long fileSize){
  progressPanel.updateCurrentFile(filename,fileSize);
}

Fixed version (ground truth):
@Override public void updateCurrentFile(String filename,long fileSize){
  progressPanel.updateCurrentFile(filename,fileSize);
}
Program: 168519
Project: 168519
Buggy source:
public void confirmCancel(){
  if (isVisible())   dispose();
}

Fixed version (ground truth):
@Override public void confirmCancel(){
  if (isVisible())   dispose();
}
Program: 168520
Project: 168520
Buggy source:
public void updateCurrentDir(String dirname){
  progressPanel.updateCurrentDir(dirname);
}

Fixed version (ground truth):
@Override public void updateCurrentDir(String dirname){
  progressPanel.updateCurrentDir(dirname);
}
Program: 168521
Project: 168521
Buggy source:
private int getPriority(){
switch (recordType) {
case FILE:
    return 1;
case FOLDER:
  return 0;
case FILE_LINK:
return 1;
case FOLDER_LINK:
return 0;
case BROKEN_LINK:
return 2;
default :
throw new RuntimeException("String_Node_Str" + "String_Node_Str" + recordType + "String_Node_Str");
}
}

Fixed version (ground truth):
private int getPriority(){
switch (recordType) {
case FOLDER:
    return 0;
case FOLDER_LINK:
  return 1;
case FILE:
return 2;
case FILE_LINK:
return 3;
case BROKEN_LINK:
return 4;
default :
throw new RuntimeException("String_Node_Str" + "String_Node_Str" + recordType + "String_Node_Str");
}
}
Program: 168524
Project: 168524
Buggy source:
@Override public List<Record<FSEntry>> getFolderContents(List<Record<FSEntry>> folderRecordPath){
  FSEntry lastEntry=folderRecordPath.get(folderRecordPath.size() - 1).getUserObject();
  if (lastEntry instanceof FSLink) {
    String[] parentPath=getFSPath(folderRecordPath,folderRecordPath.size() - 1);
    FSEntry linkTarget=((FSLink)lastEntry).getLinkTarget(parentPath);
    if (linkTarget == null) {
      JOptionPane.showMessageDialog(FileSystemBrowserWindow.this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      throw new RuntimeException("String_Node_Str");
    }
 else     if (linkTarget instanceof FSFolder)     lastEntry=linkTarget;
 else     throw new RuntimeException("String_Node_Str" + lastEntry.getClass());
  }
  if (lastEntry instanceof FSFolder) {
    String[] folderPath=getFSPath(folderRecordPath);
    FSEntry[] entryArray=((FSFolder)lastEntry).list();
    ArrayList<Record<FSEntry>> entryList=new ArrayList<Record<FSEntry>>(entryArray.length);
    for (    FSEntry entry : entryArray) {
      Record<FSEntry> rec=new FSEntryRecord(entry,folderPath);
      entryList.add(rec);
    }
    return entryList;
  }
 else {
    throw new RuntimeException("String_Node_Str" + lastEntry.getClass());
  }
}

Fixed version (ground truth):
@Override public List<Record<FSEntry>> getFolderContents(List<Record<FSEntry>> folderRecordPath){
  FSEntry lastEntry=folderRecordPath.get(folderRecordPath.size() - 1).getUserObject();
  if (lastEntry instanceof FSLink) {
    String[] parentPath=getFSPath(folderRecordPath,folderRecordPath.size() - 1);
    FSEntry linkTarget=((FSLink)lastEntry).getLinkTarget(parentPath);
    if (linkTarget == null) {
      JOptionPane.showMessageDialog(FileSystemBrowserWindow.this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      throw new RuntimeException("String_Node_Str");
    }
 else     if (linkTarget instanceof FSFolder)     lastEntry=linkTarget;
 else     throw new RuntimeException("String_Node_Str" + lastEntry.getClass());
  }
  if (lastEntry instanceof FSFolder) {
    String[] folderPath=getFSPath(folderRecordPath);
    FSEntry[] entryArray=((FSFolder)lastEntry).listEntries();
    ArrayList<Record<FSEntry>> entryList=new ArrayList<Record<FSEntry>>(entryArray.length);
    for (    FSEntry entry : entryArray) {
      Record<FSEntry> rec=new FSEntryRecord(entry,folderPath);
      entryList.add(rec);
    }
    return entryList;
  }
 else {
    throw new RuntimeException("String_Node_Str" + lastEntry.getClass());
  }
}
Program: 168525
Project: 168525
Buggy source:
/** 
 * <code>progressDialog</code> may NOT be null. 
 */
protected int extract(String[] parentPath,List<FSEntry> recs,File outDir,ProgressMonitor progressDialog,boolean dataFork,boolean resourceFork){
  int errorCount=0;
  LinkedList<String> pathStack=new LinkedList<String>();
  if (parentPath != null) {
    for (    String pathComponent : parentPath)     pathStack.addLast(pathComponent);
  }
  for (  FSEntry rec : recs) {
    errorCount+=extractRecursive(rec,pathStack,outDir,progressDialog,new ObjectContainer<Boolean>(false),dataFork,resourceFork);
  }
  return errorCount;
}

Fixed version (ground truth):
/** 
 * <code>progressDialog</code> may NOT be null. 
 */
protected void extract(String[] parentPath,List<FSEntry> recs,File outDir,ProgressMonitor progressDialog,LinkedList<String> errorMessages,boolean dataFork,boolean resourceFork){
  LinkedList<String> pathStack=new LinkedList<String>();
  if (parentPath != null) {
    for (    String pathComponent : parentPath)     pathStack.addLast(pathComponent);
  }
  if (errorMessages == null)   errorMessages=new LinkedList<String>();
  LinkedList<String[]> absPathStack=new LinkedList<String[]>();
  for (  FSEntry rec : recs) {
    extractRecursive(rec,pathStack,absPathStack,outDir,progressDialog,errorMessages,new ObjectContainer<Boolean>(false),dataFork,resourceFork);
  }
}
Program: 168527
Project: 168527
Buggy source:
public static String[] concatenate(String[] a,String[] b){
  String[] c=new String[a.length + b.length];
  System.arraycopy(a,0,c,0,a.length);
  System.arraycopy(b,0,c,a.length,b.length);
  return c;
}

Fixed version (ground truth):
public static <T>T[] concatenate(T[] a,T[] b,T[] target){
  System.arraycopy(a,0,target,0,a.length);
  System.arraycopy(b,0,target,a.length,b.length);
  return target;
}
Program: 168528
Project: 168528
Buggy source:
/** 
 * Creates an implementation specific extent descriptor from the given data.
 * @param startBlock the first block number of the extent.
 * @param blockCount the number of blocks that the extent ranges over.
 * @return an implementation specific representation of an extent descriptorcreated from the <code>startBlock</code> and <code>blockCount</code> parameters.
 * @throws java.lang.IllegalArgumentException if any of the values of <code>startBlock</code> or <code>blockCount</code> are out of range for the implementation (16-bit signed integer value for HFS, 32-bit signed integer value for HFS+).
 */
protected abstract CommonHFSExtentDescriptor createExtentDescriptor(long startBlock,long blockCount) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Creates an implementation specific extent descriptor from the given data.
 * @param startBlock the first block number of the extent.
 * @param allocatedBlockCount the number of blocks that the extent ranges over.
 * @return an implementation specific representation of an extent descriptorcreated from the <code>startBlock</code> and <code>allocatedBlockCount</code> parameters.
 * @throws java.lang.IllegalArgumentException if any of the values of <code>startBlock</code> or <code>allocatedBlockCount</code> are out of range for the implementation (16-bit signed integer value for HFS, 32-bit signed integer value for HFS+).
 */
protected abstract CommonHFSExtentDescriptor createExtentDescriptor(long startBlock,long blockCount) throws IllegalArgumentException ;
Program: 168532
Project: 168532
Buggy source:
/** 
 * Calculates the combined sizes of the forks of types <code>forkTypes</code> for the selection, including all files in subdirectories. If <code>forkTypes</code> is empty, all forks are included in the calculation.
 * @param selection
 * @param forkTypes
 * @return
 */
private long calculateForkSizeRecursive(FSEntry[] selection,FSForkType... forkTypes){
  long res=0;
  for (  FSEntry curEntry : selection) {
    if (curEntry instanceof FSFile) {
      FSFile curFile=(FSFile)curEntry;
      if (forkTypes.length > 0) {
        for (        FSForkType t : forkTypes) {
          FSFork curFork=curFile.getForkByType(t);
          if (curFork != null) {
            res+=curFork.getLength();
          }
        }
      }
 else {
        res+=curFile.getCombinedLength();
      }
    }
 else     if (curEntry instanceof FSFolder) {
      FSFolder curFolder=(FSFolder)curEntry;
      res+=calculateForkSizeRecursive(curFolder.list(),forkTypes);
    }
 else {
      System.err.println("String_Node_Str" + curEntry.getClass());
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Calculates the combined sizes of the forks of types <code>forkTypes</code> for the selection, including all files in subdirectories. If <code>forkTypes</code> is empty, all forks are included in the calculation.
 * @param selection
 * @param forkTypes
 * @return
 */
private long calculateForkSizeRecursive(FSEntry[] selection,FSForkType... forkTypes){
  long res=0;
  for (  FSEntry curEntry : selection) {
    if (curEntry instanceof FSLink) {
      FSLink curLink=(FSLink)curEntry;
      FSEntry linkTarget=curLink.getLinkTarget();
      if (linkTarget != null) {
        System.err.println("String_Node_Str" + curLink.getLinkTargetString() + "String_Node_Str");
        curEntry=linkTarget;
      }
 else       System.err.println("String_Node_Str" + curLink.getLinkTargetString() + "String_Node_Str");
    }
    if (curEntry instanceof FSFile) {
      FSFile curFile=(FSFile)curEntry;
      if (forkTypes.length > 0) {
        for (        FSForkType t : forkTypes) {
          FSFork curFork=curFile.getForkByType(t);
          if (curFork != null) {
            res+=curFork.getLength();
          }
        }
      }
 else {
        res+=curFile.getCombinedLength();
      }
    }
 else     if (curEntry instanceof FSFolder) {
      FSFolder curFolder=(FSFolder)curEntry;
      res+=calculateForkSizeRecursive(curFolder.list(),forkTypes);
    }
 else {
      System.err.println("String_Node_Str" + curEntry.getClass());
    }
  }
  return res;
}
Program: 168533
Project: 168533
Buggy source:
@Override public void actionDoubleClickFile(Record<FSEntry> record){
  FSEntry entry=record.getUserObject();
  if (entry instanceof FSFile)   FileSystemBrowserWindow.this.actionDoubleClickFile((FSFile)entry);
 else   throw new RuntimeException("String_Node_Str" + entry.getClass());
}

Fixed version (ground truth):
@Override public void actionDoubleClickFile(Record<FSEntry> record){
  FSEntry entry=record.getUserObject();
  if (entry instanceof FSFile) {
    FileSystemBrowserWindow.this.actionDoubleClickFile((FSFile)entry);
  }
 else {
    throw new RuntimeException("String_Node_Str" + entry.getClass());
  }
}
Program: 168534
Project: 168534
Buggy source:
private void exitApplication(){
  if (tempFiles.size() > 0) {
    long totalFileSize=0;
    for (    File tempFile : tempFiles)     totalFileSize+=tempFile.length();
    int res=JOptionPane.showConfirmDialog(this,"String_Node_Str" + tempFiles.size() + "String_Node_Str"+ totalFileSize+ "String_Node_Str"+ System.getProperty("String_Node_Str")+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
    if (res == JOptionPane.YES_OPTION) {
      for (      File tempFile : tempFiles) {
        if (!tempFile.exists())         continue;
        boolean delRes=tempFile.delete();
        while (!delRes) {
          int res2=JOptionPane.showConfirmDialog(this,"String_Node_Str" + tempFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.ERROR_MESSAGE);
          if (res2 == JOptionPane.YES_OPTION)           delRes=tempFile.delete();
 else           if (res2 == JOptionPane.NO_OPTION)           break;
 else           return;
        }
      }
    }
 else     if (res != JOptionPane.NO_OPTION)     return;
  }
  setVisible(false);
  if (fsHandler != null) {
    fsHandler.close();
  }
  System.exit(0);
}

Fixed version (ground truth):
private void exitApplication(){
  try {
    if (tempFiles.size() > 0) {
      long totalFileSize=0;
      for (      File tempFile : tempFiles) {
        totalFileSize+=tempFile.length();
      }
      int res=JOptionPane.showConfirmDialog(this,"String_Node_Str" + tempFiles.size() + "String_Node_Str"+ totalFileSize+ "String_Node_Str"+ System.getProperty("String_Node_Str")+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
      if (res == JOptionPane.YES_OPTION) {
        for (        File tempFile : tempFiles) {
          if (!tempFile.exists()) {
            continue;
          }
          boolean delRes=tempFile.delete();
          while (!delRes) {
            int res2=JOptionPane.showConfirmDialog(this,"String_Node_Str" + tempFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.ERROR_MESSAGE);
            if (res2 == JOptionPane.YES_OPTION) {
              delRes=tempFile.delete();
            }
 else             if (res2 == JOptionPane.NO_OPTION) {
              break;
            }
 else {
              return;
            }
          }
        }
      }
 else       if (res != JOptionPane.NO_OPTION) {
        return;
      }
    }
    setVisible(false);
    if (fsHandler != null) {
      fsHandler.close();
    }
  }
 catch (  Throwable t) {
    GUIUtil.displayExceptionDialog(t,20,this,"String_Node_Str");
  }
 finally {
    System.exit(0);
  }
}
Program: 168536
Project: 168536
Buggy source:
public static RecordType entryTypeToRecordType(FSEntry entry){
  if (entry instanceof FSFile)   return RecordType.FILE;
 else   if (entry instanceof FSFolder)   return RecordType.FOLDER;
 else   throw new IllegalArgumentException("String_Node_Str" + entry.getClass());
}

Fixed version (ground truth):
public static RecordType entryTypeToRecordType(FSEntry entry){
  if (entry instanceof FSFile) {
    return RecordType.FILE;
  }
 else   if (entry instanceof FSFolder) {
    return RecordType.FOLDER;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + entry.getClass());
  }
}
Program: 168537
Project: 168537
Buggy source:
public static long getEntrySize(FSEntry entry){
  if (entry instanceof FSFile)   return ((FSFile)entry).getMainFork().getLength();
 else   if (entry instanceof FSFolder)   return 0;
 else   throw new IllegalArgumentException("String_Node_Str" + entry.getClass());
}

Fixed version (ground truth):
public static long getEntrySize(FSEntry entry){
  if (entry instanceof FSFile) {
    return ((FSFile)entry).getMainFork().getLength();
  }
 else   if (entry instanceof FSFolder) {
    return 0;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + entry.getClass());
  }
}