nus-yam/ex-repair huggingface dataset:
Program: 8981
Project: 8981
Buggy source:
@Override public void textDeltaEnd(String path) throws SVNException {
  try {
    if (window == null)     throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_SVN_CMD_ERR));
    final Repository repo=gitRepository.getRepository();
    final ObjectInserter inserter=repo.newObjectInserter();
    md5=window.textDeltaEnd();
    try (InputStream stream=temporaryStream.toInputStream()){
      objectId=new GitObject<>(repo,inserter.insert(Constants.OBJ_BLOB,temporaryStream.size(),stream));
    }
     inserter.flush();
    log.info("String_Node_Str",objectId.getObject().getName(),path);
  }
 catch (  IOException e) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR),e);
  }
}

Fixed version (ground truth):
@Override public void textDeltaEnd(String path) throws SVNException {
  try (TemporaryOutputStream.Holder holder=temporaryStream.holder()){
    if (window == null)     throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_SVN_CMD_ERR));
    final Repository repo=gitRepository.getRepository();
    final ObjectInserter inserter=repo.newObjectInserter();
    md5=window.textDeltaEnd();
    try (InputStream stream=temporaryStream.toInputStream()){
      objectId=new GitObject<>(repo,inserter.insert(Constants.OBJ_BLOB,temporaryStream.size(),stream));
    }
     inserter.flush();
    log.info("String_Node_Str",objectId.getObject().getName(),path);
  }
 catch (  IOException e) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR),e);
  }
}
Program: 8982
Project: 8982
Buggy source:
public boolean migrateFilter(@NotNull GitFilter filter) throws IOException, SVNException {
  if (newFilter == null || objectId == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  final GitObject<ObjectId> beforeId=objectId;
  if (!newFilter.equals(filter)) {
    final Repository repo=gitRepository.getRepository();
    final TemporaryOutputStream content=new TemporaryOutputStream();
    try (InputStream inputStream=newFilter.inputStream(objectId);OutputStream outputStream=filter.outputStream(content)){
      IOUtils.copy(inputStream,outputStream);
    }
     final ObjectInserter inserter=repo.newObjectInserter();
    try (InputStream inputStream=content.toInputStream()){
      objectId=new GitObject<>(repo,inserter.insert(Constants.OBJ_BLOB,content.size(),inputStream));
      newFilter=filter;
    }
     inserter.flush();
  }
  return !beforeId.equals(objectId);
}

Fixed version (ground truth):
public boolean migrateFilter(@NotNull GitFilter filter) throws IOException, SVNException {
  if (newFilter == null || objectId == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  final GitObject<ObjectId> beforeId=objectId;
  if (!newFilter.equals(filter)) {
    final Repository repo=gitRepository.getRepository();
    try (final TemporaryOutputStream content=new TemporaryOutputStream();final TemporaryOutputStream.Holder holder=content.holder()){
      try (InputStream inputStream=newFilter.inputStream(objectId);OutputStream outputStream=filter.outputStream(content)){
        IOUtils.copy(inputStream,outputStream);
      }
       final ObjectInserter inserter=repo.newObjectInserter();
      try (InputStream inputStream=content.toInputStream()){
        objectId=new GitObject<>(repo,inserter.insert(Constants.OBJ_BLOB,content.size(),inputStream));
        newFilter=filter;
      }
       inserter.flush();
    }
   }
  return !beforeId.equals(objectId);
}
Program: 8983
Project: 8983
Buggy source:
/** 
 * Try to remove not-owned lock.
 * @throws Exception
 */
@Test(dataProvider="String_Node_Str",dataProviderClass=SvnTesterDataProvider.class) public void unlockNotOwner(@NotNull SvnTesterFactory factory) throws Exception {
  try (SvnTester server=factory.create()){
    final SVNRepository repo=server.openSvnRepository();
    createFile(repo,"String_Node_Str","String_Node_Str",null);
    final long latestRevision=repo.getLatestRevision();
    final SVNLock oldLock=lock(repo,"String_Node_Str",latestRevision,false,null);
    Assert.assertNotNull(oldLock);
    unlock(repo,oldLock,false,null);
    final SVNLock newLock=lock(repo,"String_Node_Str",latestRevision,false,null);
    Assert.assertNotNull(newLock);
    unlock(repo,oldLock,false,SVNErrorCode.FS_NO_SUCH_LOCK);
  }
 }

Fixed version (ground truth):
/** 
 * Try to remove not-owned lock.
 * @throws Exception
 */
@Test(dataProvider="String_Node_Str",dataProviderClass=SvnTesterDataProvider.class) public void unlockNotOwner(@NotNull SvnTesterFactory factory) throws Exception {
  try (SvnTester server=factory.create()){
    final SVNRepository repo=server.openSvnRepository();
    createFile(repo,"String_Node_Str","String_Node_Str",null);
    final long latestRevision=repo.getLatestRevision();
    final SVNLock oldLock=lock(repo,"String_Node_Str",latestRevision,false,null);
    Assert.assertNotNull(oldLock);
    unlock(repo,oldLock,false,null);
    for (int pass=0; ; ++pass) {
      Assert.assertTrue(pass < MAX_RELOCK_COUNT);
      final SVNLock newLock=lock(repo,"String_Node_Str",latestRevision,false,null);
      Assert.assertNotNull(newLock);
      if (!newLock.getID().equals(oldLock.getID())) {
        break;
      }
      unlock(repo,newLock,false,null);
    }
    unlock(repo,oldLock,false,SVNErrorCode.FS_NO_SUCH_LOCK);
  }
 }
Program: 8984
Project: 8984
Buggy source:
@Override public GitRevision commit(@NotNull User userInfo,@NotNull String message) throws SVNException, IOException {
  final GitTreeUpdate root=treeStack.element();
  ObjectId treeId=root.buildTree(inserter);
  log.info("String_Node_Str",treeId.name());
  final CommitBuilder commitBuilder=new CommitBuilder();
  final PersonIdent ident=createIdent(userInfo);
  commitBuilder.setAuthor(ident);
  commitBuilder.setCommitter(ident);
  commitBuilder.setMessage(message);
  final RevCommit parentCommit=revision.getGitNewCommit();
  if (parentCommit != null) {
    commitBuilder.setParentId(parentCommit.getId());
  }
  commitBuilder.setTreeId(treeId);
  final ObjectId commitId=inserter.insert(commitBuilder);
  inserter.flush();
  if (filterMigration(new RevWalk(repo.getRepository()).parseTree(treeId)) != 0) {
    log.info("String_Node_Str");
    return null;
  }
synchronized (pushLock) {
    log.info("String_Node_Str");
    validateProperties(new RevWalk(repo.getRepository()).parseTree(treeId));
    log.info("String_Node_Str",commitId.name(),message);
    log.info("String_Node_Str",branch);
    if (!pushMode.push(repo.getRepository(),commitId,branch)) {
      log.info("String_Node_Str");
      return null;
    }
    log.info("String_Node_Str");
    repo.updateRevisions();
    return repo.getRevision(commitId);
  }
}

Fixed version (ground truth):
@Override public GitRevision commit(@NotNull User userInfo,@NotNull String message) throws SVNException, IOException {
  final GitTreeUpdate root=treeStack.element();
  ObjectId treeId=root.buildTree(inserter);
  log.debug("String_Node_Str",treeId.name());
  final CommitBuilder commitBuilder=new CommitBuilder();
  final PersonIdent ident=createIdent(userInfo);
  commitBuilder.setAuthor(ident);
  commitBuilder.setCommitter(ident);
  commitBuilder.setMessage(message);
  final RevCommit parentCommit=revision.getGitNewCommit();
  if (parentCommit != null) {
    commitBuilder.setParentId(parentCommit.getId());
  }
  commitBuilder.setTreeId(treeId);
  final ObjectId commitId=inserter.insert(commitBuilder);
  inserter.flush();
  log.info("String_Node_Str",commitId.name(),message);
  if (filterMigration(new RevWalk(repo.getRepository()).parseTree(treeId)) != 0) {
    log.info("String_Node_Str");
    return null;
  }
synchronized (pushLock) {
    log.info("String_Node_Str");
    validateProperties(new RevWalk(repo.getRepository()).parseTree(treeId));
    log.info("String_Node_Str",branch);
    if (!pushMode.push(repo.getRepository(),commitId,branch)) {
      log.info("String_Node_Str");
      return null;
    }
    log.info("String_Node_Str");
    repo.updateRevisions();
    return repo.getRevision(commitId);
  }
}
Program: 8985
Project: 8985
Buggy source:
private void openFile(@NotNull SessionContext context,@NotNull OpenParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",parent,rev);
  VcsFile vcsFile=parent.getEntry(StringHelper.baseName(args.name));
  final VcsDeltaConsumer deltaConsumer=writer.modifyFile(parent.entry,vcsFile.getFileName(),vcsFile);
  files.put(args.token,new FileUpdater(deltaConsumer));
  if (parent.head && (rev >= 0)) {
    checkUpToDate(vcsFile,rev,true);
  }
  parent.changes.add(treeBuilder -> treeBuilder.saveFile(StringHelper.baseName(args.name),deltaConsumer,true));
}

Fixed version (ground truth):
private void openFile(@NotNull SessionContext context,@NotNull OpenParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",args.name,rev);
  VcsFile vcsFile=parent.getEntry(StringHelper.baseName(args.name));
  final VcsDeltaConsumer deltaConsumer=writer.modifyFile(parent.entry,vcsFile.getFileName(),vcsFile);
  files.put(args.token,new FileUpdater(deltaConsumer));
  if (parent.head && (rev >= 0)) {
    checkUpToDate(vcsFile,rev,true);
  }
  parent.changes.add(treeBuilder -> treeBuilder.saveFile(StringHelper.baseName(args.name),deltaConsumer,true));
}
Program: 8986
Project: 8986
Buggy source:
public GitSubmodules(@NotNull File basePath,@NotNull Collection<String> paths) throws IOException {
  for (  String path : paths) {
    final File file=new File(basePath,path).getAbsoluteFile();
    if (!file.exists()) {
      throw new FileNotFoundException(file.getPath());
    }
    log.info("String_Node_Str",file);
    repositories.add(new FileRepository(file));
  }
}

Fixed version (ground truth):
public GitSubmodules(@NotNull File basePath,@NotNull Collection<String> paths) throws IOException {
  for (  String path : paths) {
    final File file=ConfigHelper.joinPath(basePath,path).getAbsoluteFile();
    if (!file.exists()) {
      throw new FileNotFoundException(file.getPath());
    }
    log.info("String_Node_Str",file);
    repositories.add(new FileRepository(file));
  }
}
Program: 8987
Project: 8987
Buggy source:
private EntryUpdater(@NotNull VcsEntry entry,boolean head) throws IOException, SVNException {
  this.entry=entry;
  this.head=head;
  if (entry instanceof VcsFile) {
    this.props=new HashMap<>(((VcsFile)entry).getProperties());
  }
 else {
    this.props=new HashMap<>();
  }
}

Fixed version (ground truth):
private EntryUpdater(@NotNull VcsEntry entry,@Nullable VcsFile source,boolean head) throws IOException, SVNException {
  this.entry=entry;
  this.source=source;
  this.head=head;
  this.props=source == null ? new HashMap<>() : new HashMap<>(source.getProperties());
}
Program: 8988
Project: 8988
Buggy source:
private void openDir(@NotNull SessionContext context,@NotNull OpenParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",args.name,rev);
  final VcsFile sourceDir=parent.getEntry(StringHelper.baseName(args.name));
  final EntryUpdater dir=new EntryUpdater(sourceDir,parent.head);
  if ((rev >= 0) && (parent.head)) {
    checkUpToDate(sourceDir,rev,false);
  }
  paths.put(args.token,dir);
  parent.changes.add(treeBuilder -> {
    treeBuilder.openDir(StringHelper.baseName(args.name));
    updateDir(treeBuilder,dir);
    if (rev >= 0) {
      treeBuilder.checkDirProperties(dir.props);
    }
    treeBuilder.closeDir();
  }
);
}

Fixed version (ground truth):
private void openDir(@NotNull SessionContext context,@NotNull OpenParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",args.name,rev);
  final VcsFile sourceDir=parent.getEntry(StringHelper.baseName(args.name));
  final EntryUpdater dir=new EntryUpdater(sourceDir,sourceDir,parent.head);
  if ((rev >= 0) && (parent.head)) {
    checkUpToDate(sourceDir,rev,false);
  }
  paths.put(args.token,dir);
  parent.changes.add(treeBuilder -> {
    treeBuilder.openDir(StringHelper.baseName(args.name));
    updateDir(treeBuilder,dir);
    if (rev >= 0) {
      treeBuilder.checkDirProperties(dir.props);
    }
    treeBuilder.closeDir();
  }
);
}
Program: 8989
Project: 8989
Buggy source:
private void addDir(@NotNull SessionContext context,@NotNull AddParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final VcsFile source;
  if (args.copyParams.copyFrom != null) {
    log.info("String_Node_Str",args.name,args.copyParams.copyFrom,args.copyParams.rev);
    source=context.getFile(args.copyParams.rev,args.copyParams.copyFrom);
    if (source == null) {
      throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,"String_Node_Str" + args.copyParams.copyFrom + "String_Node_Str"+ args.copyParams.rev));
    }
  }
 else {
    log.info("String_Node_Str",args.name);
    source=null;
  }
  final EntryUpdater updater=new EntryUpdater(parent.entry,false);
  paths.put(args.token,updater);
  parent.changes.add(treeBuilder -> {
    treeBuilder.addDir(StringHelper.baseName(args.name),source);
    updateDir(treeBuilder,updater);
    treeBuilder.checkDirProperties(updater.props);
    treeBuilder.closeDir();
  }
);
}

Fixed version (ground truth):
private void addDir(@NotNull SessionContext context,@NotNull AddParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final VcsFile source;
  if (args.copyParams.copyFrom != null) {
    log.info("String_Node_Str",args.name,args.copyParams.copyFrom,args.copyParams.rev);
    source=context.getFile(args.copyParams.rev,args.copyParams.copyFrom);
    if (source == null) {
      throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,"String_Node_Str" + args.copyParams.copyFrom + "String_Node_Str"+ args.copyParams.rev));
    }
  }
 else {
    log.info("String_Node_Str",args.name);
    source=null;
  }
  final EntryUpdater updater=new EntryUpdater(parent.entry,source,false);
  paths.put(args.token,updater);
  parent.changes.add(treeBuilder -> {
    treeBuilder.addDir(StringHelper.baseName(args.name),source);
    updateDir(treeBuilder,updater);
    treeBuilder.checkDirProperties(updater.props);
    treeBuilder.closeDir();
  }
);
}
Program: 8990
Project: 8990
Buggy source:
@NotNull public VcsFile getEntry(@NotNull String name) throws IOException, SVNException {
  final VcsFile file=entry.getEntry(name);
  if (file == null) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,"String_Node_Str" + name + "String_Node_Str"+ entry.getFullPath()));
  }
  return file;
}

Fixed version (ground truth):
@NotNull public VcsFile getEntry(@NotNull String name) throws IOException, SVNException {
  if (source == null) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,"String_Node_Str" + name));
  }
  final VcsFile file=source.getEntry(name);
  if (file == null) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,"String_Node_Str" + name + "String_Node_Str"+ source.getFullPath()));
  }
  return file;
}
Program: 8991
Project: 8991
Buggy source:
private void openRoot(@NotNull SessionContext context,@NotNull OpenRootParams args) throws SVNException, IOException {
  final String fullPath=context.getRepositoryPath("String_Node_Str");
  final String[] rootPath=fullPath.split("String_Node_Str");
  EntryUpdater lastUpdater=rootEntry;
  for (int i=1; i < rootPath.length; ++i) {
    String name=rootPath[i];
    final VcsFile entry=lastUpdater.getEntry(name);
    final EntryUpdater updater=new EntryUpdater(entry,true);
    lastUpdater.changes.add(treeBuilder -> {
      treeBuilder.openDir(name);
      updateDir(treeBuilder,updater);
      treeBuilder.closeDir();
    }
);
    lastUpdater=updater;
  }
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  if (rev >= 0) {
    if (lastUpdater.entry instanceof VcsFile) {
      checkUpToDate((VcsFile)lastUpdater.entry,rev,false);
      final Map<String,String> props=lastUpdater.props;
      lastUpdater.changes.add(treeBuilder -> treeBuilder.checkDirProperties(props));
    }
 else {
      throw new IllegalStateException();
    }
  }
  paths.put(args.token,lastUpdater);
}

Fixed version (ground truth):
private void openRoot(@NotNull SessionContext context,@NotNull OpenRootParams args) throws SVNException, IOException {
  final String fullPath=context.getRepositoryPath("String_Node_Str");
  final String[] rootPath=fullPath.split("String_Node_Str");
  EntryUpdater lastUpdater=rootEntry;
  for (int i=1; i < rootPath.length; ++i) {
    String name=rootPath[i];
    final VcsFile entry=lastUpdater.getEntry(name);
    final EntryUpdater updater=new EntryUpdater(entry,entry,true);
    lastUpdater.changes.add(treeBuilder -> {
      treeBuilder.openDir(name);
      updateDir(treeBuilder,updater);
      treeBuilder.closeDir();
    }
);
    lastUpdater=updater;
  }
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  if (rev >= 0) {
    if (lastUpdater.source == null) {
      throw new IllegalStateException();
    }
    checkUpToDate(lastUpdater.source,rev,false);
    final Map<String,String> props=lastUpdater.props;
    lastUpdater.changes.add(treeBuilder -> treeBuilder.checkDirProperties(props));
  }
  paths.put(args.token,lastUpdater);
}
Program: 8992
Project: 8992
Buggy source:
private void deleteEntry(@NotNull SessionContext context,@NotNull DeleteParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",args.name,rev);
  final VcsFile entry=parent.getEntry(StringHelper.baseName(args.name));
  if (parent.head && (rev >= 0) && (parent.entry instanceof VcsFile)) {
    checkUpToDate(entry,rev,true);
  }
  parent.changes.add(treeBuilder -> treeBuilder.delete(entry.getFileName()));
}

Fixed version (ground truth):
private void deleteEntry(@NotNull SessionContext context,@NotNull DeleteParams args) throws SVNException, IOException {
  final EntryUpdater parent=getParent(args.parentToken);
  final int rev=args.rev.length > 0 ? args.rev[0] : -1;
  log.info("String_Node_Str",args.name,rev);
  final VcsFile entry=parent.getEntry(StringHelper.baseName(args.name));
  if (parent.head && (rev >= 0) && (parent.source != null)) {
    checkUpToDate(entry,rev,true);
  }
  parent.changes.add(treeBuilder -> treeBuilder.delete(entry.getFileName()));
}
Program: 8994
Project: 8994
Buggy source:
@Override public long getSize() throws IOException, SVNException {
  if (getFileMode().getObjectType() != Constants.OBJ_BLOB)   return 0L;
  if (treeEntry == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return repo.getObjectSize(treeEntry.getObjectId(),' ',() -> {
    final ObjectLoader loader=getObjectLoader();
    if (loader == null)     return 0L;
    return loader.getSize();
  }
) + (isSymlink() ? 0 : SvnConstants.LINK_PREFIX.length());
}

Fixed version (ground truth):
@Override public long getSize() throws IOException, SVNException {
  if (getFileMode().getObjectType() != Constants.OBJ_BLOB)   return 0L;
  if (treeEntry == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  final GitObject<ObjectId> objectId=treeEntry.getObjectId();
  ObjectReader reader=objectId.getRepo().newObjectReader();
  long objectSize=reader.getObjectSize(objectId.getObject(),treeEntry.getFileMode().getObjectType());
  return objectSize + (isSymlink() ? 0 : SvnConstants.LINK_PREFIX.length());
}
Program: 8995
Project: 8995
Buggy source:
public GitRepository(@NotNull Repository repository,@NotNull List<Repository> linked,@NotNull GitPushMode pushMode,@NotNull String branch,boolean renameDetection,@NotNull LockManagerFactory lockManagerFactory,@NotNull DB cacheDb) throws IOException, SVNException {
  this.cacheDb=cacheDb;
  this.md5Cache=cacheDb.getHashMap("String_Node_Str");
  this.sizeCache=cacheDb.getHashMap("String_Node_Str");
  this.binaryCache=cacheDb.getHashMap("String_Node_Str");
  this.repository=repository;
  this.pushMode=pushMode;
  this.renameDetection=renameDetection;
  this.lockManagerFactory=lockManagerFactory;
  linkedRepositories=new ArrayList<>(linked);
  this.svnBranch=LayoutHelper.initRepository(repository,branch).getName();
  this.gitBranch=Constants.R_HEADS + branch;
  loadRevisions();
  cacheRevisions();
  updateRevisions();
  this.uuid=UUID.nameUUIDFromBytes((getRepositoryId() + "String_Node_Str" + gitBranch).getBytes(StandardCharsets.UTF_8)).toString();
  log.info("String_Node_Str",gitBranch);
}

Fixed version (ground truth):
public GitRepository(@NotNull Repository repository,@NotNull List<Repository> linked,@NotNull GitPushMode pushMode,@NotNull String branch,boolean renameDetection,@NotNull LockManagerFactory lockManagerFactory,@NotNull DB cacheDb) throws IOException, SVNException {
  this.cacheDb=cacheDb;
  this.md5Cache=cacheDb.getHashMap("String_Node_Str");
  this.binaryCache=cacheDb.getHashMap("String_Node_Str");
  this.repository=repository;
  this.pushMode=pushMode;
  this.renameDetection=renameDetection;
  this.lockManagerFactory=lockManagerFactory;
  linkedRepositories=new ArrayList<>(linked);
  this.svnBranch=LayoutHelper.initRepository(repository,branch).getName();
  this.gitBranch=Constants.R_HEADS + branch;
  loadRevisions();
  cacheRevisions();
  updateRevisions();
  this.uuid=UUID.nameUUIDFromBytes((getRepositoryId() + "String_Node_Str" + gitBranch).getBytes(StandardCharsets.UTF_8)).toString();
  log.info("String_Node_Str",gitBranch);
}
Program: 8997
Project: 8997
Buggy source:
@Override protected void processCommand(@NotNull SessionContext context,@NotNull Params args) throws IOException, SVNException {
  final SvnServerWriter writer=context.getWriter();
  final int latestRev=context.getRepository().getLatestRevision().getId();
  final String comment=args.comment.length == 0 ? null : args.comment[0];
  final LockTarget[] targets=new LockTarget[args.paths.length];
  for (int i=0; i < args.paths.length; ++i) {
    final String path=context.getRepositoryPath(args.paths[i].path);
    final int rev=getRevision(args.paths[i].rev,latestRev);
    targets[i]=new LockTarget(path,rev);
  }
  final LockDesc[] locks;
  try {
    locks=context.getRepository().wrapLockWrite((lockManager) -> lockManager.lock(context,comment,args.stealLock,targets));
  }
 catch (  SVNException e) {
    writer.word("String_Node_Str");
    throw e;
  }
  for (  LockDesc lock : locks) {
    writer.listBegin().word("String_Node_Str");
    LockCmd.writeLock(writer,lock);
    writer.listEnd();
  }
  writer.word("String_Node_Str");
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
}

Fixed version (ground truth):
@Override protected void processCommand(@NotNull SessionContext context,@NotNull Params args) throws IOException, SVNException {
  final SvnServerWriter writer=context.getWriter();
  final int latestRev=context.getRepository().getLatestRevision().getId();
  final String comment=args.comment.length == 0 ? null : args.comment[0];
  final LockTarget[] targets=new LockTarget[args.paths.length];
  for (int i=0; i < args.paths.length; ++i) {
    final String path=context.getRepositoryPath(args.paths[i].path);
    final int rev=getRevision(args.paths[i].rev,latestRev);
    targets[i]=new LockTarget(path,rev);
  }
  final LockDesc[] locks;
  try {
    locks=context.getRepository().wrapLockWrite((lockManager) -> lockManager.lock(context,comment,args.stealLock,targets));
    for (    LockDesc lock : locks) {
      writer.listBegin().word("String_Node_Str");
      LockCmd.writeLock(writer,lock);
      writer.listEnd();
    }
  }
 catch (  SVNException e) {
    sendError(writer,e.getErrorMessage());
  }
  writer.word("String_Node_Str");
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
}
Program: 8998
Project: 8998
Buggy source:
@Override protected void processCommand(@NotNull SessionContext context,@NotNull Params args) throws IOException, SVNException {
  final SvnServerWriter writer=context.getWriter();
  final UnlockTarget[] targets=new UnlockTarget[args.paths.length];
  for (int i=0; i < args.paths.length; ++i) {
    final PathToken pathToken=args.paths[i];
    final String path=context.getRepositoryPath(pathToken.path);
    final String lockToken=pathToken.lockToken.length == 0 ? null : pathToken.lockToken[0];
    targets[i]=new UnlockTarget(context.getRepositoryPath(path),lockToken);
  }
  try {
    context.getRepository().wrapLockWrite((lockManager) -> {
      lockManager.unlock(context,args.breakLock,targets);
      return Boolean.TRUE;
    }
);
  }
 catch (  SVNException e) {
    writer.word("String_Node_Str");
    throw e;
  }
  for (  PathToken path : args.paths)   writer.listBegin().word("String_Node_Str").listBegin().string(path.path).listEnd().listEnd();
  writer.word("String_Node_Str");
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
}

Fixed version (ground truth):
@Override protected void processCommand(@NotNull SessionContext context,@NotNull Params args) throws IOException, SVNException {
  final SvnServerWriter writer=context.getWriter();
  final UnlockTarget[] targets=new UnlockTarget[args.paths.length];
  for (int i=0; i < args.paths.length; ++i) {
    final PathToken pathToken=args.paths[i];
    final String path=context.getRepositoryPath(pathToken.path);
    final String lockToken=pathToken.lockToken.length == 0 ? null : pathToken.lockToken[0];
    targets[i]=new UnlockTarget(context.getRepositoryPath(path),lockToken);
  }
  try {
    context.getRepository().wrapLockWrite((lockManager) -> {
      lockManager.unlock(context,args.breakLock,targets);
      return Boolean.TRUE;
    }
);
    for (    PathToken path : args.paths)     writer.listBegin().word("String_Node_Str").listBegin().string(path.path).listEnd().listEnd();
  }
 catch (  SVNException e) {
    sendError(writer,e.getErrorMessage());
  }
  writer.word("String_Node_Str");
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
}
Program: 8999
Project: 8999
Buggy source:
boolean isDirectory() throws IOException ;

Fixed version (ground truth):
boolean isDirectory();
Program: 9000
Project: 9000
Buggy source:
@Override public boolean isDirectory() throws IOException {
  return getKind().equals(SVNNodeKind.DIR);
}

Fixed version (ground truth):
@Override public boolean isDirectory(){
  return getKind().equals(SVNNodeKind.DIR);
}
Program: 9001
Project: 9001
Buggy source:
private ClientInfo exchangeCapabilities(SvnServerParser parser,SvnServerWriter writer) throws IOException, SVNException {
  writer.listBegin().word("String_Node_Str").listBegin().number(2).number(2).listBegin().listEnd().listBegin().word("String_Node_Str").word("String_Node_Str").word("String_Node_Str").word("String_Node_Str").listEnd().listEnd().listEnd();
  final ClientInfo clientInfo=MessageParser.parse(ClientInfo.class,parser);
  if (clientInfo.getProtocolVersion() != 2) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.VERSION_MISMATCH,"String_Node_Str" + clientInfo.getProtocolVersion() + "String_Node_Str"));
  }
  return clientInfo;
}

Fixed version (ground truth):
private ClientInfo exchangeCapabilities(SvnServerParser parser,SvnServerWriter writer) throws IOException, SVNException {
  writer.listBegin().word("String_Node_Str").listBegin().number(2).number(2).listBegin().listEnd().listBegin().word("String_Node_Str").word("String_Node_Str").word("String_Node_Str").word("String_Node_Str").word("String_Node_Str").listEnd().listEnd().listEnd();
  final ClientInfo clientInfo=MessageParser.parse(ClientInfo.class,parser);
  if (clientInfo.getProtocolVersion() != 2) {
    throw new SVNException(SVNErrorMessage.create(SVNErrorCode.VERSION_MISMATCH,"String_Node_Str" + clientInfo.getProtocolVersion() + "String_Node_Str"));
  }
  return clientInfo;
}
Program: 9002
Project: 9002
Buggy source:
private void updateEntry(@NotNull SessionContext context,@NotNull String wcPath,@Nullable VcsFile oldFile,@Nullable VcsFile newFile,@NotNull String parentTokenId,boolean rootDir) throws IOException, SVNException {
  if (oldFile != null)   if (newFile == null || !oldFile.getKind().equals(newFile.getKind()))   removeEntry(context,wcPath,oldFile.getLastChange().getId(),parentTokenId);
  if (newFile == null)   return;
  if (newFile.isDirectory())   updateDir(context,wcPath,oldFile,newFile,parentTokenId,rootDir);
 else   updateFile(context,wcPath,oldFile,newFile,parentTokenId);
}

Fixed version (ground truth):
private void updateEntry(@NotNull SessionContext context,@NotNull String wcPath,@Nullable VcsFile oldFile,@Nullable VcsFile newFile,@NotNull String parentTokenId,boolean rootDir,@NotNull Depth wcDepth,@NotNull Depth requestedDepth) throws IOException, SVNException {
  if (oldFile != null)   if (newFile == null || !oldFile.getKind().equals(newFile.getKind()))   removeEntry(context,wcPath,oldFile.getLastChange().getId(),parentTokenId);
  if (newFile == null)   return;
  if (newFile.isDirectory())   updateDir(context,wcPath,oldFile,newFile,parentTokenId,rootDir,wcDepth,requestedDepth);
 else   updateFile(context,wcPath,oldFile,newFile,parentTokenId);
}
Program: 9004
Project: 9004
Buggy source:
private void setPathReport(@NotNull SessionContext context,@NotNull SetPathParams args){
  context.push(this::reportCommand);
  final String wcPath=wcPath(args.path);
  forcePath(wcPath);
  paths.put(wcPath,args);
}

Fixed version (ground truth):
private void setPathReport(@NotNull SessionContext context,@NotNull SetPathParams args) throws SVNException {
  context.push(this::reportCommand);
  final String wcPath=wcPath(args.path);
  final SetPathParams prev=paths.putIfAbsent(wcPath,args);
  if (prev != null)   throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN,"String_Node_Str" + args.path));
  forcePath(wcPath);
}
Program: 9006
Project: 9006
Buggy source:
@Nullable private VcsFile getPrevFile(@NotNull SessionContext context,@NotNull String wcPath,@Nullable VcsFile oldFile) throws IOException, SVNException {
  if (deletedPaths.contains(wcPath)) {
    return null;
  }
  final SetPathParams pathParams=paths.get(wcPath);
  if (pathParams == null) {
    return oldFile;
  }
  if (pathParams.startEmpty || (pathParams.rev == 0)) {
    return null;
  }
  return context.getFile(pathParams.rev,wcPath);
}

Fixed version (ground truth):
@Nullable private VcsFile getPrevFile(@NotNull SessionContext context,@NotNull String wcPath,@Nullable VcsFile oldFile) throws IOException, SVNException {
  if (deletedPaths.contains(wcPath))   return null;
  final SetPathParams pathParams=paths.get(wcPath);
  if (pathParams == null)   return oldFile;
  if (pathParams.startEmpty || pathParams.rev == 0)   return null;
  return context.getFile(pathParams.rev,wcPath);
}
Program: 9007
Project: 9007
Buggy source:
public SetPathParams(@NotNull String path,int rev,boolean startEmpty,@NotNull String[] lockToken,@NotNull String depth){
  this.path=path;
  this.rev=rev;
  this.startEmpty=startEmpty;
  this.lockToken=lockToken;
  this.depth=DeltaParams.Depth.parse(depth);
}

Fixed version (ground truth):
public SetPathParams(@NotNull String path,int rev,boolean startEmpty,@NotNull String[] lockToken,@NotNull String depth){
  this.path=path;
  this.rev=rev;
  this.startEmpty=startEmpty;
  this.lockToken=lockToken;
  this.depth=Depth.parse(depth);
}
Program: 9009
Project: 9009
Buggy source:
protected void sendResponse(@NotNull SessionContext context,@NotNull String path,int rev) throws IOException, ClientErrorException {
  final SvnServerWriter writer=context.getWriter();
  writer.listBegin().word("String_Node_Str").listBegin().number(rev).listEnd().listEnd();
  final String tokenId=createTokenId();
  final SetPathParams rootParams=paths.get(path);
  writer.listBegin().word("String_Node_Str").listBegin().listBegin().number(rootParams == null ? rev : rootParams.rev).listEnd().string(tokenId).listEnd().listEnd();
  FileInfo file=context.getRepository().getRevisionInfo(rev).getFile(context.getRepositoryPath(path));
  updateEntry(context,path,getPrevFile(context,path,file),file,tokenId,path.isEmpty());
  writer.listBegin().word("String_Node_Str").listBegin().string(tokenId).listEnd().listEnd();
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
  final SvnServerParser parser=context.getParser();
  parser.readToken(ListBeginToken.class);
  if (!"String_Node_Str".equals(parser.readText())) {
    parser.skipItems();
  }
 else {
    parser.skipItems();
    writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
  }
}

Fixed version (ground truth):
protected void sendResponse(@NotNull SessionContext context,@NotNull String path,int rev) throws IOException, ClientErrorException {
  final SvnServerWriter writer=context.getWriter();
  writer.listBegin().word("String_Node_Str").listBegin().number(rev).listEnd().listEnd();
  final String tokenId=createTokenId();
  final SetPathParams rootParams=paths.get(path);
  writer.listBegin().word("String_Node_Str").listBegin().listBegin().number(rootParams == null ? rev : rootParams.rev).listEnd().string(tokenId).listEnd().listEnd();
  FileInfo file=context.getRepository().getRevisionInfo(rev).getFile(context.getRepositoryPath(path));
  updateEntry(context,path,getPrevFile(context,path,file),file,tokenId,path.isEmpty());
  writer.listBegin().word("String_Node_Str").listBegin().string(tokenId).listEnd().listEnd();
  writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
  final SvnServerParser parser=context.getParser();
  parser.readToken(ListBeginToken.class);
  if (!"String_Node_Str".equals(parser.readText())) {
    parser.readToken(ListBeginToken.class);
    parser.readToken(ListBeginToken.class);
    final int errorCode=parser.readNumber();
    final String errorMessage=parser.readText();
    parser.skipItems();
    parser.readToken(ListEndToken.class);
    parser.readToken(ListEndToken.class);
    log.error("String_Node_Str",errorCode,errorMessage);
    throw new EOFException(errorMessage);
  }
 else {
    parser.skipItems();
    writer.listBegin().word("String_Node_Str").listBegin().listEnd().listEnd();
  }
}
Program: 9010
Project: 9010
Buggy source:
public SvnServerParser(@NotNull InputStream stream){
  this.stream=stream;
}

Fixed version (ground truth):
public SvnServerParser(@NotNull InputStream stream){
  this(stream,DEFAULT_BUFFER_SIZE);
}
Program: 9011
Project: 9011
Buggy source:
@NotNull private StringToken readString(int length) throws IOException {
  int need=length;
  while (need > 0) {
    if (buffer.length == position) {
      buffer=Arrays.copyOf(buffer,buffer.length * 2);
    }
    final int readed=stream.read(buffer,position,Math.min(need,buffer.length - position));
    if (readed < 0) {
      throw new IOException("String_Node_Str");
    }
    need-=readed;
  }
  return new StringToken(Arrays.copyOf(buffer,length));
}

Fixed version (ground truth):
@NotNull private StringToken readString(int length) throws IOException {
  int need=length;
  byte[] localBuffer=buffer;
  while (need > 0) {
    if (localBuffer.length == position) {
      localBuffer=enlargeBuffer(localBuffer);
    }
    final int readed=stream.read(localBuffer,position,Math.min(need,localBuffer.length - position));
    if (readed < 0) {
      throw new IOException("String_Node_Str");
    }
    need-=readed;
    position+=readed;
  }
  return new StringToken(Arrays.copyOf(localBuffer,length));
}
Program: 9012
Project: 9012
Buggy source:
@NotNull private WordToken readWord(int first) throws IOException {
  buffer[position]=(byte)first;
  position++;
  while (true) {
    final int read=stream.read();
    if (read < 0) {
      throw new IOException("String_Node_Str");
    }
    if (isSpace(read)) {
      return new WordToken(new String(buffer,0,position,StandardCharsets.US_ASCII));
    }
    if (!(isAlpha(read) || isDigit(read) || (read == '-'))) {
      throw new IOException("String_Node_Str" + read + "String_Node_Str");
    }
    buffer[position]=(byte)read;
    position++;
  }
}

Fixed version (ground truth):
@NotNull private WordToken readWord(int first) throws IOException {
  byte[] localBuffer=buffer;
  localBuffer[position]=(byte)first;
  position++;
  while (true) {
    final int read=stream.read();
    if (read < 0) {
      throw new IOException("String_Node_Str");
    }
    if (isSpace(read)) {
      return new WordToken(new String(localBuffer,0,position,StandardCharsets.US_ASCII));
    }
    if (!(isAlpha(read) || isDigit(read) || (read == '-'))) {
      throw new IOException("String_Node_Str" + read + "String_Node_Str");
    }
    if (localBuffer.length == position) {
      localBuffer=enlargeBuffer(localBuffer);
    }
    localBuffer[position]=(byte)read;
    position++;
  }
}
Program: 9014
Project: 9014
Buggy source:
@Override public Subscriber<T> call(final Subscriber<? super String> o){
  return new Subscriber<T>(o){
    boolean mayAddSeparator;
    StringBuilder b=new StringBuilder();
    @Override public void onCompleted(){
      String str=b.toString();
      b=null;
      if (!o.isUnsubscribed())       o.onNext(str);
      if (!o.isUnsubscribed())       o.onCompleted();
    }
    @Override public void onError(    Throwable e){
      b=null;
      if (!o.isUnsubscribed())       o.onError(e);
    }
    @Override public void onNext(    Object t){
      if (mayAddSeparator) {
        b.append(separator);
      }
      mayAddSeparator=true;
      b.append(String.valueOf(t));
    }
  }
;
}

Fixed version (ground truth):
@Override public Line call(String text){
  return new Line(lineNumber++,text);
}
Program: 9015
Project: 9015
Buggy source:
public boolean process(byte[] next,ByteBuffer last,boolean endOfInput){
  ByteBuffer bb;
  if (last != null) {
    if (next != null) {
      bb=ByteBuffer.allocate(last.remaining() + next.length);
      bb.put(last);
      bb.put(next);
      bb.flip();
    }
 else {
      bb=last;
    }
  }
 else {
    if (next != null) {
      bb=ByteBuffer.wrap(next);
    }
 else {
      return true;
    }
  }
  CharBuffer cb=CharBuffer.allocate((int)(bb.limit() * charsetDecoder.averageCharsPerByte()));
  CoderResult cr=charsetDecoder.decode(bb,cb,endOfInput);
  cb.flip();
  if (cr.isError()) {
    try {
      cr.throwException();
    }
 catch (    CharacterCodingException e) {
      o.onError(e);
      return false;
    }
  }
  if (bb.remaining() > 0) {
    leftOver=bb;
  }
 else {
    leftOver=null;
  }
  String string=cb.toString();
  if (!string.isEmpty())   o.onNext(string);
  return true;
}

Fixed version (ground truth):
public boolean process(byte[] next,ByteBuffer last,boolean endOfInput){
  if (o.isUnsubscribed())   return false;
  ByteBuffer bb;
  if (last != null) {
    if (next != null) {
      bb=ByteBuffer.allocate(last.remaining() + next.length);
      bb.put(last);
      bb.put(next);
      bb.flip();
    }
 else {
      bb=last;
    }
  }
 else {
    if (next != null) {
      bb=ByteBuffer.wrap(next);
    }
 else {
      return true;
    }
  }
  CharBuffer cb=CharBuffer.allocate((int)(bb.limit() * charsetDecoder.averageCharsPerByte()));
  CoderResult cr=charsetDecoder.decode(bb,cb,endOfInput);
  cb.flip();
  if (cr.isError()) {
    try {
      cr.throwException();
    }
 catch (    CharacterCodingException e) {
      o.onError(e);
      return false;
    }
  }
  if (bb.remaining() > 0) {
    leftOver=bb;
  }
 else {
    leftOver=null;
  }
  String string=cb.toString();
  if (!string.isEmpty())   o.onNext(string);
  return true;
}
Program: 9017
Project: 9017
Buggy source:
public static Observable<String> from(final Reader i,final int size){
  return Observable.create(new OnSubscribe<String>(){
    @Override public void call(    Subscriber<? super String> o){
      char[] buffer=new char[size];
      try {
        if (o.isUnsubscribed())         return;
        int n=0;
        n=i.read(buffer);
        while (n != -1 && !o.isUnsubscribed()) {
          o.onNext(new String(buffer));
          n=i.read(buffer);
        }
      }
 catch (      IOException e) {
        o.onError(e);
      }
      if (o.isUnsubscribed())       return;
      o.onCompleted();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Reads from the characters from a source   {@link Reader} and outputs {@link Observable} of{@link String}s
 * @param i Source  {@link Reader}
 * @param size internal buffer size
 * @return
 */
public static Observable<String> from(final Reader i,final int size){
  return Observable.create(new OnSubscribe<String>(){
    @Override public void call(    Subscriber<? super String> o){
      char[] buffer=new char[size];
      try {
        if (o.isUnsubscribed())         return;
        int n=0;
        n=i.read(buffer);
        while (n != -1 && !o.isUnsubscribed()) {
          o.onNext(new String(buffer,0,n));
          n=i.read(buffer);
        }
      }
 catch (      IOException e) {
        o.onError(e);
      }
      if (o.isUnsubscribed())       return;
      o.onCompleted();
    }
  }
);
}
Program: 9019
Project: 9019
Buggy source:
public void stop(WebSocketSession session) throws IOException {
  UserSession stopperUser=registry.getBySession(session);
  UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : registry.getByName(stopperUser.getCallingTo());
  JsonObject message=new JsonObject();
  message.addProperty("String_Node_Str","String_Node_Str");
  stoppedUser.sendMessage(message);
}

Fixed version (ground truth):
public void stop(WebSocketSession session) throws IOException {
  UserSession stopperUser=registry.getBySession(session);
  if (stopperUser != null) {
    UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : stopperUser.getCallingTo() != null ? registry.getByName(stopperUser.getCallingTo()) : null;
    if (stoppedUser != null) {
      JsonObject message=new JsonObject();
      message.addProperty("String_Node_Str","String_Node_Str");
      stoppedUser.sendMessage(message);
      stoppedUser.clear();
    }
    stopperUser.clear();
  }
}
Program: 9020
Project: 9020
Buggy source:
public void stop(WebSocketSession session) throws IOException {
  UserSession stopperUser=registry.getBySession(session);
  UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : registry.getByName(stopperUser.getCallingTo());
  JsonObject message=new JsonObject();
  message.addProperty("String_Node_Str","String_Node_Str");
  stoppedUser.sendMessage(message);
}

Fixed version (ground truth):
public void stop(WebSocketSession session) throws IOException {
  UserSession stopperUser=registry.getBySession(session);
  if (stopperUser != null) {
    UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : stopperUser.getCallingTo() != null ? registry.getByName(stopperUser.getCallingTo()) : null;
    if (stoppedUser != null) {
      JsonObject message=new JsonObject();
      message.addProperty("String_Node_Str","String_Node_Str");
      stoppedUser.sendMessage(message);
      stoppedUser.clear();
    }
    stopperUser.clear();
  }
}
Program: 9021
Project: 9021
Buggy source:
public void stop(WebSocketSession session) throws IOException {
  String sessionId=session.getId();
  if (pipelines.containsKey(sessionId)) {
    pipelines.get(sessionId).release();
    CallMediaPipeline pipeline=pipelines.remove(sessionId);
    pipeline.release();
    UserSession stopperUser=registry.getBySession(session);
    UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : registry.getByName(stopperUser.getCallingTo());
    JsonObject message=new JsonObject();
    message.addProperty("String_Node_Str","String_Node_Str");
    stoppedUser.sendMessage(message);
    stopperUser.clear();
    stoppedUser.clear();
  }
}

Fixed version (ground truth):
public void stop(WebSocketSession session) throws IOException {
  String sessionId=session.getId();
  if (pipelines.containsKey(sessionId)) {
    pipelines.get(sessionId).release();
    CallMediaPipeline pipeline=pipelines.remove(sessionId);
    pipeline.release();
    UserSession stopperUser=registry.getBySession(session);
    if (stopperUser != null) {
      UserSession stoppedUser=(stopperUser.getCallingFrom() != null) ? registry.getByName(stopperUser.getCallingFrom()) : stopperUser.getCallingTo() != null ? registry.getByName(stopperUser.getCallingTo()) : null;
      if (stoppedUser != null) {
        JsonObject message=new JsonObject();
        message.addProperty("String_Node_Str","String_Node_Str");
        stoppedUser.sendMessage(message);
        stoppedUser.clear();
      }
      stopperUser.clear();
    }
  }
}
Program: 9023
Project: 9023
Buggy source:
public void releasePipeline(UserSession session) throws IOException {
  String sessionId=session.getSessionId();
  UserSession stoppedUser=(session.getCallingFrom() != null) ? registry.getByName(session.getCallingFrom()) : registry.getByName(session.getCallingTo());
  if (pipelines.containsKey(sessionId)) {
    pipelines.get(sessionId).release();
    pipelines.remove(sessionId);
  }
  session.setWebRtcEndpoint(null);
  session.setPlayingWebRtcEndpoint(null);
  stoppedUser.setWebRtcEndpoint(null);
  stoppedUser.setPlayingWebRtcEndpoint(null);
}

Fixed version (ground truth):
public void releasePipeline(UserSession session){
  String sessionId=session.getSessionId();
  UserSession stoppedUser=(session.getCallingFrom() != null) ? registry.getByName(session.getCallingFrom()) : registry.getByName(session.getCallingTo());
  if (pipelines.containsKey(sessionId)) {
    pipelines.get(sessionId).release();
    pipelines.remove(sessionId);
  }
  session.setWebRtcEndpoint(null);
  session.setPlayingWebRtcEndpoint(null);
  stoppedUser.setWebRtcEndpoint(null);
  stoppedUser.setPlayingWebRtcEndpoint(null);
}
Program: 9024
Project: 9024
Buggy source:
public PlayMediaPipeline(KurentoClient kurento,String user,final WebSocketSession session){
  pipeline=kurento.createMediaPipeline();
  webRtc=new WebRtcEndpoint.Builder(pipeline).build();
  player=new PlayerEndpoint.Builder(pipeline,RECORDING_PATH + user + RECORDING_EXT).build();
  player.connect(webRtc);
  player.addErrorListener(new EventListener<ErrorEvent>(){
    @Override public void onEvent(    ErrorEvent event){
      log.info("String_Node_Str",event.getDescription());
      sendPlayEnd(session);
    }
  }
);
  player.addEndOfStreamListener(new EventListener<EndOfStreamEvent>(){
    @Override public void onEvent(    EndOfStreamEvent event){
      sendPlayEnd(session);
    }
  }
);
}

Fixed version (ground truth):
public PlayMediaPipeline(KurentoClient kurento,String user,final WebSocketSession session){
  pipeline=kurento.createMediaPipeline();
  webRtc=new WebRtcEndpoint.Builder(pipeline).build();
  player=new PlayerEndpoint.Builder(pipeline,RECORDING_PATH + user + RECORDING_EXT).build();
  player.connect(webRtc);
  player.addErrorListener(new EventListener<ErrorEvent>(){
    @Override public void onEvent(    ErrorEvent event){
      log.info("String_Node_Str",event.getDescription());
      sendPlayEnd(session);
    }
  }
);
}
Program: 9025
Project: 9025
Buggy source:
@Override public void onEvent(EndOfStreamEvent event){
  sendPlayEnd(session);
}

Fixed version (ground truth):
@Override public void onEvent(ErrorEvent event){
  log.info("String_Node_Str",event.getDescription());
  sendPlayEnd(session);
}