nus-yam/ex-repair huggingface dataset:
Program: 113515
Project: 113515
Buggy source:
@Override public boolean onRemoteUpdate(long objVersion,ReplicaState state) throws IOException {
  if (state == ReplicaState.PRIMARY) {
    throw new IOException("String_Node_Str");
  }
  if ((objVersion == 1) && (localObjVersion == -1))   return false;
  if (objVersion > localObjVersion + 1) {
    return true;
  }
  if (objVersion > localObjVersion)   localObjVersion=objVersion;
  return false;
}

Fixed version (ground truth):
@Override public boolean onRemoteUpdate(long objVersion,ReplicaState state) throws IOException {
  if (state == ReplicaState.PRIMARY) {
    throw new IOException("String_Node_Str");
  }
  if ((objVersion == 1) && (localObjVersion == -1)) {
    localObjVersion=1;
    return false;
  }
  if (objVersion > localObjVersion + 1) {
    return true;
  }
  if (objVersion > localObjVersion)   localObjVersion=objVersion;
  return false;
}
Program: 113519
Project: 113519
Buggy source:
public void run(){
  do {
    List<CapEntry> renewList=new LinkedList();
synchronized (capabilities) {
      final long expTime=TimeSync.getLocalSystemTime() + Constants.XCAP_EXPIRE_TIMEOUT_S_MIN;
      for (      CapEntry e : capabilities.values()) {
        if (e.getLocalTimestamp() <= expTime) {
          renewList.add(e);
        }
      }
    }
    for (    CapEntry cap : renewList) {
      renewCap(cap);
    }
    try {
      sleep(Constants.XCAP_EXPIRE_TIMEOUT_S_MIN * 60 * 1000);
    }
 catch (    InterruptedException ex) {
      break;
    }
  }
 while (!quit);
}

Fixed version (ground truth):
public void run(){
  do {
    List<CapEntry> renewList=new LinkedList();
synchronized (capabilities) {
      final long expTime=TimeSync.getLocalSystemTime() + Constants.XCAP_EXPIRE_TIMEOUT_S_MIN;
      for (      CapEntry e : capabilities.values()) {
        if (e.getLocalTimestamp() <= expTime) {
          renewList.add(e);
        }
      }
    }
    for (    CapEntry cap : renewList) {
      renewCap(cap);
    }
    try {
      sleep(Constants.XCAP_EXPIRE_TIMEOUT_S_MIN * 60 * 1000 / 2);
    }
 catch (    InterruptedException ex) {
      break;
    }
  }
 while (!quit);
}
Program: 113521
Project: 113521
Buggy source:
private void processLeaseStateChanged(StageRequest method){
  try {
    final ASCIIString cellId=(ASCIIString)method.getArgs()[0];
    final Flease lease=(Flease)method.getArgs()[1];
    final FleaseException error=(FleaseException)method.getArgs()[2];
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",cellId,lease.getLeaseHolder(),error);
    final String fileId=cellToFileId.get(cellId);
    if (fileId != null) {
      ReplicatedFileState state=files.get(fileId);
      assert(state != null);
      if (error == null) {
        boolean localIsPrimary=(lease.getLeaseHolder() != null) && (lease.getLeaseHolder().equals(localID));
        ReplicaState oldState=state.getState();
        state.setLocalIsPrimary(localIsPrimary);
        state.setLease(lease);
        if ((state.getState() == ReplicaState.BACKUP) || (state.getState() == ReplicaState.PRIMARY) || (state.getState() == ReplicaState.WAITING_FOR_LEASE)) {
          if (localIsPrimary) {
            if (oldState != ReplicaState.PRIMARY)             doPrimary(state);
          }
 else {
            if (oldState != ReplicaState.BACKUP)             doBackup(state);
          }
        }
      }
 else {
        if (state.getState() == ReplicaState.WAITING_FOR_LEASE) {
          failed(state,error);
        }
      }
    }
  }
 catch (  Exception ex) {
    Logging.logError(Logging.LEVEL_ERROR,this,ex);
  }
}

Fixed version (ground truth):
private void processLeaseStateChanged(StageRequest method){
  try {
    final ASCIIString cellId=(ASCIIString)method.getArgs()[0];
    final Flease lease=(Flease)method.getArgs()[1];
    final FleaseException error=(FleaseException)method.getArgs()[2];
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",cellId,lease,error);
    final String fileId=cellToFileId.get(cellId);
    if (fileId != null) {
      ReplicatedFileState state=files.get(fileId);
      assert(state != null);
      if (error == null) {
        boolean localIsPrimary=(lease.getLeaseHolder() != null) && (lease.getLeaseHolder().equals(localID));
        ReplicaState oldState=state.getState();
        state.setLocalIsPrimary(localIsPrimary);
        state.setLease(lease);
        if ((state.getState() == ReplicaState.BACKUP) || (state.getState() == ReplicaState.PRIMARY) || (state.getState() == ReplicaState.WAITING_FOR_LEASE)) {
          if (localIsPrimary) {
            if (oldState != ReplicaState.PRIMARY)             doPrimary(state);
          }
 else {
            if (oldState != ReplicaState.BACKUP)             doBackup(state);
          }
        }
      }
 else {
        if (state.getState() == ReplicaState.WAITING_FOR_LEASE) {
          failed(state,error);
        }
      }
    }
  }
 catch (  Exception ex) {
    Logging.logError(Logging.LEVEL_ERROR,this,ex);
  }
}
Program: 113522
Project: 113522
Buggy source:
@Override public FileStatus[] listStatus(Path hdPath) throws IOException {
  if (hdPath == null)   return null;
  final String path=hdPath.toUri().getPath();
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + path);
  DirectoryEntry[] list=volume.listEntries(path);
  if (list == null)   return null;
  FileStatus[] fslist=new FileStatus[list.length];
  for (int i=0; i < list.length; i++) {
    final DirectoryEntry e=list[i];
    final Stat s=e.getStbuf();
    final boolean isDir=(s.getMode() & Constants.SYSTEM_V_FCNTL_H_S_IFDIR) > 0;
    fslist[i]=new FileStatus(s.getSize(),isDir,1,1,(long)(s.getMtime_ns() / 1e6),(long)(s.getAtime_ns() / 1e6),new FsPermission((short)s.getMode()),s.getUser_id(),s.getGroup_id(),new Path(hdPath,e.getName()));
  }
  return fslist;
}

Fixed version (ground truth):
@Override public FileStatus[] listStatus(Path hdPath) throws IOException {
  if (hdPath == null)   return null;
  final String path=hdPath.toUri().getPath();
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + path);
  DirectoryEntry[] list=volume.listEntries(path);
  if (list == null)   return null;
  FileStatus[] fslist=new FileStatus[list.length];
  for (int i=0; i < list.length; i++) {
    final DirectoryEntry e=list[i];
    final Stat s=e.getStbuf().get(0);
    final boolean isDir=(s.getMode() & Constants.SYSTEM_V_FCNTL_H_S_IFDIR) > 0;
    fslist[i]=new FileStatus(s.getSize(),isDir,1,1,(long)(s.getMtime_ns() / 1e6),(long)(s.getAtime_ns() / 1e6),new FsPermission((short)s.getMode()),s.getUser_id(),s.getGroup_id(),new Path(hdPath,e.getName()));
  }
  return fslist;
}
Program: 113524
Project: 113524
Buggy source:
public int compare(TreeEntry o1,TreeEntry o2){
  return o1.getName().compareTo(o2.getName());
}

Fixed version (ground truth):
public int compare(TreeEntry o1,TreeEntry o2){
  return o2.getName().length() - o1.getName().length();
}
Program: 113525
Project: 113525
Buggy source:
private void assertTree(SortedSet<TreeEntry> tree,String volume,String path,boolean recursive) throws Exception {
  SortedSet<TreeEntry> subtree=getSubtree(tree,path,recursive);
  int offs=0;
  for (  TreeEntry entry : subtree) {
    if (path.equals(entry.getName()))     offs=entry.getName().length();
    String relPath=entry.getName().substring(offs);
    if (relPath.startsWith("String_Node_Str"))     relPath=relPath.substring(1);
    try {
      invokeSync(client.getattr(mrcAddress,uc,volume,relPath));
    }
 catch (    Exception exc) {
      System.out.println("String_Node_Str" + volume + "String_Node_Str"+ relPath);
      System.out.println();
      printTree(tree);
      System.out.println();
      printTree(subtree);
      exc.printStackTrace();
      System.exit(1);
    }
  }
}

Fixed version (ground truth):
private void assertTree(SortedSet<TreeEntry> tree,String volume,String path,boolean recursive) throws Exception {
  SortedSet<TreeEntry> subtree=getSubtree(tree,path,recursive);
  int offs=0;
  for (  TreeEntry entry : subtree) {
    if (path.equals(entry.getName()))     offs=entry.getName().length();
    String relPath=entry.getName().substring(offs);
    if (relPath.startsWith("String_Node_Str"))     relPath=relPath.substring(1);
    invokeSync(client.getattr(mrcAddress,uc,volume,relPath));
  }
  checkDir(volume,subtree,"String_Node_Str",path,recursive);
}
Program: 113526
Project: 113526
Buggy source:
private static SortedSet<TreeEntry> createRandomTree(int numDirs,int maxFilesPerDir){
  SortedSet<TreeEntry> tree=new TreeSet<TreeEntry>(new Comparator<TreeEntry>(){
    public int compare(    TreeEntry o1,    TreeEntry o2){
      return o1.getName().compareTo(o2.getName());
    }
  }
);
  String currentPath="String_Node_Str";
  for (int i=0; i < numDirs; i++) {
    if ("String_Node_Str".equals(currentPath) || rnd.nextBoolean())     currentPath=createRandomString(1,10);
 else     currentPath=currentPath + "String_Node_Str" + createRandomString(1,10);
    tree.add(new TreeEntry(currentPath,true));
  }
  List<TreeEntry> files=new LinkedList<TreeEntry>();
  for (  TreeEntry entry : tree)   for (int i=0; i < rnd.nextDouble() * (maxFilesPerDir + 1); i++)   files.add(new TreeEntry(entry.getName() + "String_Node_Str" + createRandomString(1,10)+ "String_Node_Str",false));
  tree.addAll(files);
  return tree;
}

Fixed version (ground truth):
private static SortedSet<TreeEntry> createRandomTree(int numDirs,int maxFilesPerDir){
  SortedSet<TreeEntry> tree=new TreeSet<TreeEntry>();
  String currentPath="String_Node_Str";
  for (int i=0; i < numDirs; i++) {
    if ("String_Node_Str".equals(currentPath) || rnd.nextBoolean())     currentPath=createRandomString(1,10);
 else     currentPath=currentPath + "String_Node_Str" + createRandomString(1,10);
    tree.add(new TreeEntry(currentPath,true));
  }
  List<TreeEntry> files=new LinkedList<TreeEntry>();
  for (  TreeEntry entry : tree)   for (int i=0; i < rnd.nextDouble() * (maxFilesPerDir + 1); i++)   files.add(new TreeEntry(entry.getName() + "String_Node_Str" + createRandomString(1,10)+ "String_Node_Str",false));
  tree.addAll(files);
  return tree;
}
Program: 113527
Project: 113527
Buggy source:
private static SortedSet<TreeEntry> getSubtree(SortedSet<TreeEntry> tree,String path,boolean recursive){
  SortedSet<TreeEntry> subTree=new TreeSet<TreeEntry>(tree.comparator());
  for (  TreeEntry entry : tree)   if (entry.getName().startsWith(path) && (recursive || entry.getName().equals(path) || (!recursive && !entry.isDir() && entry.getName().substring(path.length() + 1).indexOf('/') == -1)))   subTree.add(entry);
  return subTree;
}

Fixed version (ground truth):
private static SortedSet<TreeEntry> getSubtree(SortedSet<TreeEntry> tree,String path,boolean recursive){
  String[] pathComps=path.equals("String_Node_Str") ? new String[0] : path.split("String_Node_Str");
  SortedSet<TreeEntry> subTree=new TreeSet<TreeEntry>(tree.comparator());
  for (  TreeEntry entry : tree) {
    String[] comps=entry.getName().split("String_Node_Str");
    if (equals(comps,pathComps)) {
      subTree.add(entry);
    }
 else     if (recursive) {
      if (startsWith(comps,pathComps))       subTree.add(entry);
    }
 else {
      if (startsWith(comps,pathComps) && comps.length - pathComps.length == 1)       subTree.add(entry);
    }
  }
  return subTree;
}
Program: 113531
Project: 113531
Buggy source:
/** 
 * toggels the written flag for an object if in COW_ONMCE mode
 * @param objectNumber the object which was modified
 */
public void objectChanged(int objectNumber){
  assert(cowFlags != null);
  if ((mode == cowMode.COW_ONCE) && (objectNumber < initialObjectCount)) {
    final int field=objectNumber / Byte.SIZE;
    final int bit=objectNumber % Byte.SIZE;
    cowFlags[field]=(byte)(cowFlags[field] | (0x01 << bit));
  }
}

Fixed version (ground truth):
/** 
 * toggels the written flag for an object if in COW_ONMCE mode
 * @param objectNumber the object which was modified
 */
public void objectChanged(int objectNumber){
  if ((mode == cowMode.COW_ONCE) && (objectNumber < initialObjectCount)) {
    assert(cowFlags != null);
    final int field=objectNumber / Byte.SIZE;
    final int bit=objectNumber % Byte.SIZE;
    cowFlags[field]=(byte)(cowFlags[field] | (0x01 << bit));
  }
}
Program: 113532
Project: 113532
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public FSDataOutputStream create(Path file,FsPermission permissions,boolean overwrite,int bufferSize,short replication,long blockSize,Progressable prog) throws IOException {
  final String path=file.toUri().getPath();
  File f=volume.getFile(path);
  String openMode="String_Node_Str";
  if (overwrite)   openMode+="String_Node_Str";
  f.createFile();
  final RandomAccessFile raf=f.open(openMode,permissions.toShort());
  return new FSDataOutputStream(new OutputStream(){
    @Override public void write(    byte[] b,    int off,    int len) throws IOException {
      raf.write(b,off,len);
    }
    @Override public void write(    byte[] b) throws IOException {
      raf.write(b,0,b.length);
    }
    @Override public void write(    int b) throws IOException {
      raf.write(new byte[]{(byte)b},0,1);
    }
    @Override public void close() throws IOException {
      raf.close();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public FSDataOutputStream create(Path file,FsPermission permissions,boolean overwrite,int bufferSize,short replication,long blockSize,Progressable prog) throws IOException {
  final String path=file.toUri().getPath();
  File f=volume.getFile(path);
  String openMode="String_Node_Str";
  if (overwrite)   openMode+="String_Node_Str";
  final RandomAccessFile raf=f.open(openMode,permissions.toShort());
  return new FSDataOutputStream(new OutputStream(){
    @Override public void write(    byte[] b,    int off,    int len) throws IOException {
      raf.write(b,off,len);
    }
    @Override public void write(    byte[] b) throws IOException {
      raf.write(b,0,b.length);
    }
    @Override public void write(    int b) throws IOException {
      raf.write(new byte[]{(byte)b},0,1);
    }
    @Override public void close() throws IOException {
      raf.close();
    }
  }
);
}
Program: 113533
Project: 113533
Buggy source:
@Override public void initialize(URI uri,Configuration conf) throws IOException {
  int logLevel=Logging.LEVEL_WARN;
  if (conf.getBoolean("String_Node_Str",false)) {
    logLevel=Logging.LEVEL_DEBUG;
  }
  String volumeName=conf.get("String_Node_Str");
  if (volumeName == null)   throw new IOException("String_Node_Str" + "String_Node_Str");
  Logging.start(logLevel,Category.all);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri);
  InetSocketAddress dir=new InetSocketAddress(uri.getHost(),uri.getPort());
  xtreemfsClient=new Client(new InetSocketAddress[]{dir},30 * 1000,15 * 60 * 1000,null);
  try {
    xtreemfsClient.start();
  }
 catch (  Exception ex) {
    throw new IOException("String_Node_Str",ex);
  }
  UserCredentials uc=null;
  if ((conf.get("String_Node_Str") != null) && (conf.get("String_Node_Str") != null)) {
    StringSet grps=new StringSet();
    grps.add(conf.get("String_Node_Str"));
    uc=new UserCredentials(conf.get("String_Node_Str"),grps,"String_Node_Str");
  }
  if (uc == null) {
    if (System.getenv("String_Node_Str") != null) {
      StringSet grps=new StringSet();
      grps.add("String_Node_Str");
      uc=new UserCredentials(System.getenv("String_Node_Str"),grps,"String_Node_Str");
    }
  }
  volume=xtreemfsClient.getVolume(volumeName,uc);
  fsURI=uri;
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri.getUserInfo());
}

Fixed version (ground truth):
@Override public void initialize(URI uri,Configuration conf) throws IOException {
  super.initialize(uri,conf);
  int logLevel=Logging.LEVEL_WARN;
  if (conf.getBoolean("String_Node_Str",false)) {
    logLevel=Logging.LEVEL_DEBUG;
  }
  String volumeName=conf.get("String_Node_Str");
  if (volumeName == null)   throw new IOException("String_Node_Str" + "String_Node_Str");
  Logging.start(logLevel,Category.all);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri);
  InetSocketAddress dir=new InetSocketAddress(uri.getHost(),uri.getPort());
  xtreemfsClient=new Client(new InetSocketAddress[]{dir},30 * 1000,15 * 60 * 1000,null);
  try {
    xtreemfsClient.start();
  }
 catch (  Exception ex) {
    throw new IOException("String_Node_Str",ex);
  }
  UserCredentials uc=null;
  if ((conf.get("String_Node_Str") != null) && (conf.get("String_Node_Str") != null)) {
    StringSet grps=new StringSet();
    grps.add(conf.get("String_Node_Str"));
    uc=new UserCredentials(conf.get("String_Node_Str"),grps,"String_Node_Str");
  }
  if (uc == null) {
    if (System.getenv("String_Node_Str") != null) {
      StringSet grps=new StringSet();
      grps.add("String_Node_Str");
      uc=new UserCredentials(System.getProperty("String_Node_Str"),grps,"String_Node_Str");
    }
  }
  fsURI=uri;
  workingDirectory=getHomeDirectory();
  volume=xtreemfsClient.getVolume(volumeName,uc);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri.getUserInfo());
}
Program: 113534
Project: 113534
Buggy source:
public RandomAccessFile open(String openMode,int permissions) throws IOException {
  int flags=0;
  if (openMode.equals("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_RDONLY;
  }
 else   if (openMode.equals("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_RDWR;
    flags|=Constants.SYSTEM_V_FCNTL_H_O_CREAT;
  }
  if (openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_TRUNC;
  }
  if (openMode.contains("String_Node_Str") || openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_SYNC;
  }
  return volume.openFile(this,flags,permissions);
}

Fixed version (ground truth):
public RandomAccessFile open(String openMode,int permissions) throws IOException {
  int flags=0;
  if (openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_RDWR;
    flags|=Constants.SYSTEM_V_FCNTL_H_O_CREAT;
  }
 else   if (openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_RDONLY;
  }
  if (openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_TRUNC;
  }
  if (openMode.contains("String_Node_Str") || openMode.contains("String_Node_Str")) {
    flags|=Constants.SYSTEM_V_FCNTL_H_O_SYNC;
  }
  return volume.openFile(this,flags,permissions);
}
Program: 113535
Project: 113535
Buggy source:
@Override public Path getWorkingDirectory(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Path getWorkingDirectory(){
  return this.workingDirectory;
}
Program: 113536
Project: 113536
Buggy source:
@Override public FileStatus[] listStatus(Path hdPath) throws IOException {
  final String path=hdPath.toUri().getPath();
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + path);
  DirectoryEntry[] list=volume.listEntries(path);
  FileStatus[] fslist=new FileStatus[list.length];
  for (int i=0; i < list.length; i++) {
    final DirectoryEntry e=list[i];
    final Stat s=e.getStbuf();
    final boolean isDir=(s.getMode() & Constants.SYSTEM_V_FCNTL_H_S_IFDIR) > 0;
    fslist[i]=new FileStatus(s.getSize(),isDir,1,1,(long)(s.getMtime_ns() / 1e6),(long)(s.getAtime_ns() / 1e6),new FsPermission((short)s.getMode()),s.getUser_id(),s.getGroup_id(),new Path(hdPath,e.getName()));
  }
  return fslist;
}

Fixed version (ground truth):
@Override public FileStatus[] listStatus(Path hdPath) throws IOException {
  if (hdPath == null)   return null;
  final String path=hdPath.toUri().getPath();
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + path);
  DirectoryEntry[] list=volume.listEntries(path);
  if (list == null)   return null;
  FileStatus[] fslist=new FileStatus[list.length];
  for (int i=0; i < list.length; i++) {
    final DirectoryEntry e=list[i];
    final Stat s=e.getStbuf();
    final boolean isDir=(s.getMode() & Constants.SYSTEM_V_FCNTL_H_S_IFDIR) > 0;
    fslist[i]=new FileStatus(s.getSize(),isDir,1,1,(long)(s.getMtime_ns() / 1e6),(long)(s.getAtime_ns() / 1e6),new FsPermission((short)s.getMode()),s.getUser_id(),s.getGroup_id(),new Path(hdPath,e.getName()));
  }
  return fslist;
}
Program: 113537
Project: 113537
Buggy source:
@Override public void setWorkingDirectory(Path arg0){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void setWorkingDirectory(Path arg0){
  this.workingDirectory=arg0;
}
Program: 113538
Project: 113538
Buggy source:
@Override public FSDataOutputStream create(Path file,FsPermission permissions,boolean overwrite,int bufferSize,short replication,long blockSize,Progressable prog) throws IOException {
  final String path=file.toUri().getPath();
  File f=volume.getFile(path);
  String openMode="String_Node_Str";
  if (overwrite)   openMode+="String_Node_Str";
  final RandomAccessFile raf=f.open(openMode,permissions.toShort());
  return new FSDataOutputStream(new OutputStream(){
    @Override public void write(    byte[] b,    int off,    int len) throws IOException {
      raf.write(b,off,len);
    }
    @Override public void write(    byte[] b) throws IOException {
      raf.write(b,0,b.length);
    }
    @Override public void write(    int b) throws IOException {
      raf.write(new byte[]{(byte)b},0,1);
    }
    @Override public void close() throws IOException {
      raf.close();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public FSDataOutputStream create(Path file,FsPermission permissions,boolean overwrite,int bufferSize,short replication,long blockSize,Progressable prog) throws IOException {
  final String path=file.toUri().getPath();
  File f=volume.getFile(path);
  String openMode="String_Node_Str";
  if (overwrite)   openMode+="String_Node_Str";
  f.createFile();
  final RandomAccessFile raf=f.open(openMode,permissions.toShort());
  return new FSDataOutputStream(new OutputStream(){
    @Override public void write(    byte[] b,    int off,    int len) throws IOException {
      raf.write(b,off,len);
    }
    @Override public void write(    byte[] b) throws IOException {
      raf.write(b,0,b.length);
    }
    @Override public void write(    int b) throws IOException {
      raf.write(new byte[]{(byte)b},0,1);
    }
    @Override public void close() throws IOException {
      raf.close();
    }
  }
);
}
Program: 113539
Project: 113539
Buggy source:
@Override public void initialize(URI uri,Configuration conf) throws IOException {
  int logLevel=Logging.LEVEL_WARN;
  if (conf.getBoolean("String_Node_Str",false)) {
    logLevel=Logging.LEVEL_DEBUG;
  }
  Logging.start(logLevel,Category.all);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri);
  InetSocketAddress dir=new InetSocketAddress(uri.getHost(),uri.getPort());
  xtreemfsClient=new Client(new InetSocketAddress[]{dir},30 * 1000,15 * 60 * 1000,null);
  try {
    xtreemfsClient.start();
  }
 catch (  Exception ex) {
    throw new IOException("String_Node_Str",ex);
  }
  UserCredentials uc=null;
  if ((conf.get("String_Node_Str") != null) && (conf.get("String_Node_Str") != null)) {
    StringSet grps=new StringSet();
    grps.add(conf.get("String_Node_Str"));
    uc=new UserCredentials(conf.get("String_Node_Str"),grps,"String_Node_Str");
  }
  if (uc == null) {
    if (System.getenv("String_Node_Str") != null) {
      StringSet grps=new StringSet();
      grps.add("String_Node_Str");
      uc=new UserCredentials(System.getenv("String_Node_Str"),grps,"String_Node_Str");
    }
  }
  volume=xtreemfsClient.getVolume(uri.getUserInfo(),uc);
  fsURI=uri;
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri.getUserInfo());
}

Fixed version (ground truth):
@Override public void initialize(URI uri,Configuration conf) throws IOException {
  int logLevel=Logging.LEVEL_WARN;
  if (conf.getBoolean("String_Node_Str",false)) {
    logLevel=Logging.LEVEL_DEBUG;
  }
  String volumeName=conf.get("String_Node_Str");
  if (volumeName == null)   throw new IOException("String_Node_Str" + "String_Node_Str");
  Logging.start(logLevel,Category.all);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri);
  InetSocketAddress dir=new InetSocketAddress(uri.getHost(),uri.getPort());
  xtreemfsClient=new Client(new InetSocketAddress[]{dir},30 * 1000,15 * 60 * 1000,null);
  try {
    xtreemfsClient.start();
  }
 catch (  Exception ex) {
    throw new IOException("String_Node_Str",ex);
  }
  UserCredentials uc=null;
  if ((conf.get("String_Node_Str") != null) && (conf.get("String_Node_Str") != null)) {
    StringSet grps=new StringSet();
    grps.add(conf.get("String_Node_Str"));
    uc=new UserCredentials(conf.get("String_Node_Str"),grps,"String_Node_Str");
  }
  if (uc == null) {
    if (System.getenv("String_Node_Str") != null) {
      StringSet grps=new StringSet();
      grps.add("String_Node_Str");
      uc=new UserCredentials(System.getenv("String_Node_Str"),grps,"String_Node_Str");
    }
  }
  volume=xtreemfsClient.getVolume(volumeName,uc);
  fsURI=uri;
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + uri.getUserInfo());
}
Program: 113541
Project: 113541
Buggy source:
@Override public void setOwnerAndGroup(String owner,String group){
  BufferBackedRCMetadata tmp=isDirectory() ? new BufferBackedRCMetadata(0,rcMetadata.getFileName(),owner,group,rcMetadata.getId(),rcMetadata.getPerms(),rcMetadata.getW32Attrs(),rcMetadata.getLinkCount()) : new BufferBackedRCMetadata(0,rcMetadata.getFileName(),owner,group,rcMetadata.getId(),rcMetadata.getPerms(),rcMetadata.getW32Attrs(),rcMetadata.getLinkCount(),rcMetadata.getEpoch(),rcMetadata.getIssuedEpoch(),rcMetadata.isReadOnly());
  rcMetadata=new BufferBackedRCMetadata(rcMetadata == null ? null : rcMetadata.getKey(),tmp.getValue());
  if (!rcMetadata.isDirectory())   rcMetadata.setXLocList(rcMetadata.getXLocList());
}

Fixed version (ground truth):
@Override public void setOwnerAndGroup(String owner,String group){
  BufferBackedRCMetadata tmp=isDirectory() ? new BufferBackedRCMetadata(0,rcMetadata.getFileName(),owner,group,rcMetadata.getId(),rcMetadata.getPerms(),rcMetadata.getW32Attrs(),rcMetadata.getLinkCount()) : new BufferBackedRCMetadata(0,rcMetadata.getFileName(),owner,group,rcMetadata.getId(),rcMetadata.getPerms(),rcMetadata.getW32Attrs(),rcMetadata.getLinkCount(),rcMetadata.getEpoch(),rcMetadata.getIssuedEpoch(),rcMetadata.isReadOnly());
  BufferBackedRCMetadata oldRCMetadata=rcMetadata;
  rcMetadata=new BufferBackedRCMetadata(rcMetadata == null ? null : rcMetadata.getKey(),tmp.getValue());
  if (!rcMetadata.isDirectory())   rcMetadata.setXLocList(oldRCMetadata.getXLocList());
}
Program: 113542
Project: 113542
Buggy source:
/** 
 * Updates the list of known OSDs, from the data stored in the DS. This function is responsible of keeping a list of OSDs used by the algorithm.
 */
private void updateKnownOSDs(){
  RPCResponse<ServiceSet> r=null;
  try {
    r=dirClient.xtreemfs_service_get_by_type(null,ServiceType.SERVICE_TYPE_OSD);
    knownOSDs=r.get();
    String ownUUID=master.getConfig().getUUID().toString();
    ServiceSet newOSDs=new ServiceSet();
    for (    Service osd : knownOSDs) {
      if (!ownUUID.equals(osd.getUuid()) && osd.getLast_updated_s() != 0) {
        newOSDs.add(osd);
      }
    }
    knownOSDs=newOSDs;
    if (Logging.isInfo()) {
      Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + knownOSDs.size() + "String_Node_Str");
    }
  }
 catch (  Exception exc) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + exc);
    knownOSDs=new ServiceSet();
  }
 finally {
    if (r != null) {
      r.freeBuffers();
    }
    sentRequests.clear();
    sentRetries.clear();
  }
}

Fixed version (ground truth):
/** 
 * Updates the list of known OSDs, from the data stored in the DS. This function is responsible of keeping a list of OSDs used by the algorithm.
 */
private void updateKnownOSDs(){
  RPCResponse<ServiceSet> r=null;
  try {
    r=dirClient.xtreemfs_service_get_by_type(null,ServiceType.SERVICE_TYPE_OSD);
    knownOSDs=r.get();
    String ownUUID=master.getConfig().getUUID().toString();
    ServiceSet newOSDs=new ServiceSet();
    for (    Service osd : knownOSDs) {
      if (!ownUUID.equals(osd.getUuid()) && osd.getLast_updated_s() != 0) {
        newOSDs.add(osd);
      }
    }
    knownOSDs=newOSDs;
    if (Logging.isDebug()) {
      Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + knownOSDs.size() + "String_Node_Str");
    }
  }
 catch (  Exception exc) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + exc);
    knownOSDs=new ServiceSet();
  }
 finally {
    if (r != null) {
      r.freeBuffers();
    }
    sentRequests.clear();
    sentRetries.clear();
  }
}
Program: 113544
Project: 113544
Buggy source:
public VivaldiStage(OSDRequestDispatcher master){
  super("String_Node_Str");
  this.master=master;
  this.dirClient=master.getDIRClient();
  this.sentRequests=new HashMap<InetSocketAddress,SentRequest>();
  this.sentRetries=new HashMap<InetSocketAddress,VivaldiRetry>();
  this.vNode=new VivaldiNode();
  if (Logging.isInfo()) {
    Logging.logMessage(Logging.LEVEL_DEBUG,this,String.format("String_Node_Str",vNode.getCoordinates().getX_coordinate(),vNode.getCoordinates().getY_coordinate()));
  }
  this.knownOSDs=null;
  this.lastCheck=0;
}

Fixed version (ground truth):
public VivaldiStage(OSDRequestDispatcher master){
  super("String_Node_Str");
  this.master=master;
  this.dirClient=master.getDIRClient();
  this.sentRequests=new HashMap<InetSocketAddress,SentRequest>();
  this.sentRetries=new HashMap<InetSocketAddress,VivaldiRetry>();
  this.vNode=new VivaldiNode();
  if (Logging.isDebug()) {
    Logging.logMessage(Logging.LEVEL_DEBUG,this,String.format("String_Node_Str",vNode.getCoordinates().getX_coordinate(),vNode.getCoordinates().getY_coordinate()));
  }
  this.knownOSDs=null;
  this.lastCheck=0;
}
Program: 113546
Project: 113546
Buggy source:
/** 
 * Keeps the list of sent requests updated, by eliminating those whose timeout has expired.
 */
private void maintainSentRequests(){
  final long localNow=TimeSync.getLocalSystemTime();
  ArrayList<InetSocketAddress> removedRequests=new ArrayList<InetSocketAddress>();
  for (  InetSocketAddress reqKey : sentRequests.keySet()) {
    if (localNow >= sentRequests.get(reqKey).getLocalTime() + MAX_REQUEST_TIMEOUT_IN_MS) {
      if (Logging.isInfo())       Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + reqKey.getHostName());
      removedRequests.add(reqKey);
    }
  }
  for (  InetSocketAddress removed : removedRequests) {
    VivaldiRetry prevRetry=sentRetries.get(removed);
    if (prevRetry == null) {
      sentRetries.put(removed,new VivaldiRetry());
    }
 else {
      prevRetry.addTimeout();
      prevRetry.setRetried(false);
      if (prevRetry.numberOfRetries() > MAX_RETRIES_FOR_A_REQUEST) {
        forceVivaldiRecalculation(null,prevRetry.getRTTs());
        sentRetries.remove(removed);
      }
    }
    sentRequests.remove(removed);
  }
}

Fixed version (ground truth):
/** 
 * Keeps the list of sent requests updated, by eliminating those whose timeout has expired.
 */
private void maintainSentRequests(){
  final long localNow=TimeSync.getLocalSystemTime();
  ArrayList<InetSocketAddress> removedRequests=new ArrayList<InetSocketAddress>();
  for (  InetSocketAddress reqKey : sentRequests.keySet()) {
    if (localNow >= sentRequests.get(reqKey).getLocalTime() + MAX_REQUEST_TIMEOUT_IN_MS) {
      if (Logging.isDebug())       Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + reqKey.getHostName());
      removedRequests.add(reqKey);
    }
  }
  for (  InetSocketAddress removed : removedRequests) {
    VivaldiRetry prevRetry=sentRetries.get(removed);
    if (prevRetry == null) {
      sentRetries.put(removed,new VivaldiRetry());
    }
 else {
      prevRetry.addTimeout();
      prevRetry.setRetried(false);
      if (prevRetry.numberOfRetries() > MAX_RETRIES_FOR_A_REQUEST) {
        forceVivaldiRecalculation(null,prevRetry.getRTTs());
        sentRetries.remove(removed);
      }
    }
    sentRequests.remove(removed);
  }
}
Program: 113547
Project: 113547
Buggy source:
public static String xLocListToJSON(XLocList xLocList) throws JSONException, UnknownUUIDException {
  Map<String,Object> list=new HashMap();
  list.put("String_Node_Str",xLocList.getReplUpdatePolicy());
  list.put("String_Node_Str",Long.valueOf(xLocList.getVersion()));
  List<Map<String,Object>> replicas=new ArrayList(xLocList.getReplicaCount());
  Iterator<XLoc> iter=xLocList.iterator();
  while (iter.hasNext()) {
    XLoc l=iter.next();
    Map<String,Object> replica=new HashMap();
    replica.put("String_Node_Str",getStripingPolicyAsJSON(l.getStripingPolicy()));
    replica.put("String_Node_Str",l.getReplicationFlags());
    List<Map<String,String>> osds=new ArrayList(l.getOSDCount());
    for (int i=0; i < l.getOSDCount(); i++) {
      Map<String,String> osd=new HashMap();
      final ServiceUUID uuid=new ServiceUUID(l.getOSD(i));
      osd.put("String_Node_Str",uuid.toString());
      osd.put("String_Node_Str",uuid.getAddress().getHostName() + "String_Node_Str" + uuid.getAddress().getPort());
      osds.add(osd);
    }
    replica.put("String_Node_Str",osds);
    replicas.add(replica);
  }
  list.put("String_Node_Str",replicas);
  return JSONParser.writeJSON(list);
}

Fixed version (ground truth):
public static String xLocListToJSON(XLocList xLocList,OSDStatusManager osdMan) throws JSONException, UnknownUUIDException {
  Map<String,Object> list=new HashMap();
  list.put("String_Node_Str",xLocList.getReplUpdatePolicy());
  list.put("String_Node_Str",Long.valueOf(xLocList.getVersion()));
  List<Map<String,Object>> replicas=new ArrayList(xLocList.getReplicaCount());
  Iterator<XLoc> iter=xLocList.iterator();
  while (iter.hasNext()) {
    XLoc l=iter.next();
    Map<String,Object> replica=new HashMap();
    replica.put("String_Node_Str",getStripingPolicyAsJSON(l.getStripingPolicy()));
    replica.put("String_Node_Str",l.getReplicationFlags());
    List<Map<String,String>> osds=new ArrayList(l.getOSDCount());
    for (int i=0; i < l.getOSDCount(); i++) {
      Map<String,String> osd=new HashMap();
      final ServiceUUID uuid=new ServiceUUID(l.getOSD(i));
      final Service osdData=osdMan.getOSDService(uuid.toString());
      final String coords=osdData == null ? "String_Node_Str" : osdData.getData().get("String_Node_Str");
      osd.put("String_Node_Str",uuid.toString());
      osd.put("String_Node_Str",coords);
      osd.put("String_Node_Str",uuid.getAddress().getHostName() + "String_Node_Str" + uuid.getAddress().getPort());
      osds.add(osd);
    }
    replica.put("String_Node_Str",osds);
    replicas.add(replica);
  }
  list.put("String_Node_Str",replicas);
  return JSONParser.writeJSON(list);
}
Program: 113550
Project: 113550
Buggy source:
public int getTag(){
  return 2009112044;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120141;
}
Program: 113551
Project: 113551
Buggy source:
public int getTag(){
  return 2009112045;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120142;
}
Program: 113552
Project: 113552
Buggy source:
public int getTag(){
  return 2009112134;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120231;
}
Program: 113553
Project: 113553
Buggy source:
public int getTag(){
  return 2009112137;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120234;
}
Program: 113554
Project: 113554
Buggy source:
public static int getVersion(){
  return 2009112114;
}

Fixed version (ground truth):
public static int getVersion(){
  return 2009120211;
}
Program: 113555
Project: 113555
Buggy source:
public static Request createRequest(ONCRPCRequestHeader header) throws Exception {
switch (header.getProcedure()) {
case 2009112115:
    return new xtreemfs_address_mappings_getRequest();
case 2009112116:
  return new xtreemfs_address_mappings_removeRequest();
case 2009112117:
return new xtreemfs_address_mappings_setRequest();
case 2009112118:
return new xtreemfs_checkpointRequest();
case 2009112119:
return new xtreemfs_discover_dirRequest();
case 2009112120:
return new xtreemfs_global_time_s_getRequest();
case 2009112121:
return new xtreemfs_replication_to_masterRequest();
case 2009112126:
return new xtreemfs_service_deregisterRequest();
case 2009112124:
return new xtreemfs_service_get_by_nameRequest();
case 2009112122:
return new xtreemfs_service_get_by_typeRequest();
case 2009112123:
return new xtreemfs_service_get_by_uuidRequest();
case 2009112127:
return new xtreemfs_service_offlineRequest();
case 2009112125:
return new xtreemfs_service_registerRequest();
case 2009112128:
return new xtreemfs_shutdownRequest();
default :
throw new Exception("String_Node_Str" + Integer.toString(header.getProcedure()));
}
}

Fixed version (ground truth):
public static Request createRequest(ONCRPCRequestHeader header) throws Exception {
switch (header.getProcedure()) {
case 2009120212:
    return new xtreemfs_address_mappings_getRequest();
case 2009120213:
  return new xtreemfs_address_mappings_removeRequest();
case 2009120214:
return new xtreemfs_address_mappings_setRequest();
case 2009120215:
return new xtreemfs_checkpointRequest();
case 2009120216:
return new xtreemfs_discover_dirRequest();
case 2009120217:
return new xtreemfs_global_time_s_getRequest();
case 2009120218:
return new xtreemfs_replication_to_masterRequest();
case 2009120223:
return new xtreemfs_service_deregisterRequest();
case 2009120221:
return new xtreemfs_service_get_by_nameRequest();
case 2009120219:
return new xtreemfs_service_get_by_typeRequest();
case 2009120220:
return new xtreemfs_service_get_by_uuidRequest();
case 2009120224:
return new xtreemfs_service_offlineRequest();
case 2009120222:
return new xtreemfs_service_registerRequest();
case 2009120225:
return new xtreemfs_shutdownRequest();
default :
throw new Exception("String_Node_Str" + Integer.toString(header.getProcedure()));
}
}
Program: 113556
Project: 113556
Buggy source:
public static ONCRPCException createException(int accept_stat) throws Exception {
switch (accept_stat) {
case 2009112134:
    return new ConcurrentModificationException();
case 2009112137:
  return new DIRException();
case 2009112135:
return new InvalidArgumentException();
case 2009112136:
return new ProtocolException();
case 2009112138:
return new RedirectException();
default :
throw new Exception("String_Node_Str" + Integer.toString(accept_stat));
}
}

Fixed version (ground truth):
public static ONCRPCException createException(int accept_stat) throws Exception {
switch (accept_stat) {
case 2009120231:
    return new ConcurrentModificationException();
case 2009120234:
  return new DIRException();
case 2009120232:
return new InvalidArgumentException();
case 2009120233:
return new ProtocolException();
case 2009120235:
return new RedirectException();
default :
throw new Exception("String_Node_Str" + Integer.toString(accept_stat));
}
}
Program: 113557
Project: 113557
Buggy source:
public static Response createResponse(ONCRPCResponseHeader header) throws Exception {
switch (header.getXID()) {
case 2009112115:
    return new xtreemfs_address_mappings_getResponse();
case 2009112116:
  return new xtreemfs_address_mappings_removeResponse();
case 2009112117:
return new xtreemfs_address_mappings_setResponse();
case 2009112118:
return new xtreemfs_checkpointResponse();
case 2009112119:
return new xtreemfs_discover_dirResponse();
case 2009112120:
return new xtreemfs_global_time_s_getResponse();
case 2009112121:
return new xtreemfs_replication_to_masterResponse();
case 2009112126:
return new xtreemfs_service_deregisterResponse();
case 2009112124:
return new xtreemfs_service_get_by_nameResponse();
case 2009112122:
return new xtreemfs_service_get_by_typeResponse();
case 2009112123:
return new xtreemfs_service_get_by_uuidResponse();
case 2009112127:
return new xtreemfs_service_offlineResponse();
case 2009112125:
return new xtreemfs_service_registerResponse();
case 2009112128:
return new xtreemfs_shutdownResponse();
default :
throw new Exception("String_Node_Str" + Integer.toString(header.getXID()));
}
}

Fixed version (ground truth):
public static Response createResponse(ONCRPCResponseHeader header) throws Exception {
switch (header.getXID()) {
case 2009120212:
    return new xtreemfs_address_mappings_getResponse();
case 2009120213:
  return new xtreemfs_address_mappings_removeResponse();
case 2009120214:
return new xtreemfs_address_mappings_setResponse();
case 2009120215:
return new xtreemfs_checkpointResponse();
case 2009120216:
return new xtreemfs_discover_dirResponse();
case 2009120217:
return new xtreemfs_global_time_s_getResponse();
case 2009120218:
return new xtreemfs_replication_to_masterResponse();
case 2009120223:
return new xtreemfs_service_deregisterResponse();
case 2009120221:
return new xtreemfs_service_get_by_nameResponse();
case 2009120219:
return new xtreemfs_service_get_by_typeResponse();
case 2009120220:
return new xtreemfs_service_get_by_uuidResponse();
case 2009120224:
return new xtreemfs_service_offlineResponse();
case 2009120222:
return new xtreemfs_service_registerResponse();
case 2009120225:
return new xtreemfs_shutdownResponse();
default :
throw new Exception("String_Node_Str" + Integer.toString(header.getXID()));
}
}
Program: 113558
Project: 113558
Buggy source:
public int getTag(){
  return 2009112135;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120232;
}
Program: 113559
Project: 113559
Buggy source:
public int getTag(){
  return 2009112136;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120233;
}
Program: 113560
Project: 113560
Buggy source:
public int getTag(){
  return 2009112138;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120235;
}
Program: 113561
Project: 113561
Buggy source:
public int getTag(){
  return 2009112115;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120212;
}
Program: 113562
Project: 113562
Buggy source:
public int getTag(){
  return 2009112115;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120212;
}
Program: 113563
Project: 113563
Buggy source:
public int getTag(){
  return 2009112116;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120213;
}
Program: 113564
Project: 113564
Buggy source:
public int getTag(){
  return 2009112116;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120213;
}
Program: 113565
Project: 113565
Buggy source:
public int getTag(){
  return 2009112117;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120214;
}
Program: 113566
Project: 113566
Buggy source:
public int getTag(){
  return 2009112117;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120214;
}
Program: 113567
Project: 113567
Buggy source:
public int getTag(){
  return 2009112118;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120215;
}
Program: 113568
Project: 113568
Buggy source:
public int getTag(){
  return 2009112118;
}

Fixed version (ground truth):
public int getTag(){
  return 2009120215;
}
Program: 113569
Project: 113569
Buggy source:
private void processGetGmax(StageRequest rq){
  final InternalGetGmaxCallback cback=(InternalGetGmaxCallback)rq.getCallback();
  try {
    final String fileId=(String)rq.getArgs()[0];
    final StripingPolicyImpl sp=(StripingPolicyImpl)rq.getArgs()[1];
    final FileInfo fi=layout.getFileInfo(sp,fileId);
    if (Logging.isDebug()) {
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.proc,this,"String_Node_Str",fileId);
    }
    InternalGmax gmax=new InternalGmax(fi.getTruncateEpoch(),fi.getLastObjectNumber(),fi.getFilesize());
    cback.gmaxComplete(gmax,null);
  }
 catch (  IOException ex) {
    cback.gmaxComplete(null,ex);
  }
}

Fixed version (ground truth):
private void processGetGmax(StageRequest rq){
  final InternalGetGmaxCallback cback=(InternalGetGmaxCallback)rq.getCallback();
  try {
    final String fileId=(String)rq.getArgs()[0];
    final StripingPolicyImpl sp=(StripingPolicyImpl)rq.getArgs()[1];
    final FileInfo fi=layout.getFileInfo(sp,fileId);
    if (Logging.isDebug()) {
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.proc,this,"String_Node_Str",fileId);
    }
    InternalGmax gmax=new InternalGmax(fi.getTruncateEpoch(),fi.getFilesize(),fi.getLastObjectNumber());
    cback.gmaxComplete(gmax,null);
  }
 catch (  IOException ex) {
    cback.gmaxComplete(null,ex);
  }
}
Program: 113572
Project: 113572
Buggy source:
public static VivaldiCoordinates stringToCoordinates(String coordinates){
  VivaldiCoordinates vc=new VivaldiCoordinates();
  vc.setX_coordinate(OutputUtils.readHexLong(coordinates,0));
  vc.setY_coordinate(OutputUtils.readHexLong(coordinates,8));
  vc.setLocal_error(OutputUtils.readHexLong(coordinates,16));
  return vc;
}

Fixed version (ground truth):
public static VivaldiCoordinates stringToCoordinates(String coordinates){
  VivaldiCoordinates vc=new VivaldiCoordinates();
  vc.setX_coordinate(Double.longBitsToDouble(OutputUtils.readHexLong(coordinates,0)));
  vc.setY_coordinate(Double.longBitsToDouble(OutputUtils.readHexLong(coordinates,16)));
  vc.setLocal_error(Double.longBitsToDouble(OutputUtils.readHexLong(coordinates,32)));
  return vc;
}
Program: 113573
Project: 113573
Buggy source:
public DIROperation(DIRRequestDispatcher master){
  this.master=master;
}

Fixed version (ground truth):
public DIROperation(DIRRequestDispatcher master){
  this.master=master;
  dbsReplicationManager=master.getDBSReplicationService();
}
Program: 113574
Project: 113574
Buggy source:
public DeleteAddressMappingOperation(DIRRequestDispatcher master){
  super(master);
  operationNumber=xtreemfs_address_mappings_removeRequest.TAG;
  database=master.getDirDatabase();
  dbsReplicationManager=master.getDBSReplicationService();
}

Fixed version (ground truth):
public DeleteAddressMappingOperation(DIRRequestDispatcher master){
  super(master);
  operationNumber=xtreemfs_address_mappings_removeRequest.TAG;
  database=master.getDirDatabase();
}
Program: 113575
Project: 113575
Buggy source:
@Override public void startRequest(DIRRequest rq){
  final xtreemfs_address_mappings_removeRequest request=(xtreemfs_address_mappings_removeRequest)rq.getRequestMessage();
  BabuDBInsertGroup ig;
  try {
    ig=database.createInsertGroup();
  }
 catch (  BabuDBException e) {
    if (e.getErrorCode() == ErrorCode.NO_ACCESS && dbsReplicationManager != null)     rq.sendRedirectException(dbsReplicationManager.getMaster());
 else     rq.sendInternalServerError(e);
    return;
  }
  ig.addDelete(DIRRequestDispatcher.INDEX_ID_ADDRMAPS,request.getUuid().getBytes());
  database.insert(ig,rq).registerListener(new BabuDBRequestListener<Object>(){
    @Override public void finished(    Object arg0,    Object context){
      ((DIRRequest)context).sendSuccess(request.createDefaultResponse());
    }
    @Override public void failed(    BabuDBException ex,    Object context){
      Logging.logError(Logging.LEVEL_ERROR,this,ex);
      if (ex.getErrorCode() == ErrorCode.NO_ACCESS && dbsReplicationManager != null)       ((DIRRequest)context).sendRedirectException(dbsReplicationManager.getMaster());
 else       ((DIRRequest)context).sendInternalServerError(ex);
    }
  }
);
}

Fixed version (ground truth):
@Override public void startRequest(DIRRequest rq){
  xtreemfs_address_mappings_removeRequest request=(xtreemfs_address_mappings_removeRequest)rq.getRequestMessage();
  BabuDBInsertGroup ig;
  try {
    ig=database.createInsertGroup();
    ig.addDelete(DIRRequestDispatcher.INDEX_ID_ADDRMAPS,request.getUuid().getBytes());
    database.insert(ig,rq).registerListener(new DBRequestListener<Object,Object>(true){
      @Override Object execute(      Object result,      DIRRequest rq) throws Exception {
        return result;
      }
    }
);
  }
 catch (  BabuDBException e) {
    requestFailed(e,rq);
  }
}