Program: 82193
Project: 82193
Buggy source:
@Override public void finishBulkMutate(final String bulkId,boolean apply,boolean blockUntilComplete) throws IOException {
  final String table=_tableContext.getTable();
  final String shard=_shardContext.getShard();
  final BulkEntry bulkEntry=_bulkWriters.get(bulkId);
  if (bulkEntry == null) {
    LOG.info("String_Node_Str",bulkId,apply,table,shard);
    return;
  }
  LOG.info("String_Node_Str",bulkId,apply,table,shard);
  bulkEntry._writer.close();
  Configuration configuration=_tableContext.getConfiguration();
  final Path path=bulkEntry._path;
  final FileSystem fileSystem=path.getFileSystem(configuration);
  if (!apply) {
    fileSystem.delete(path,false);
    Path parent=path.getParent();
    removeParentIfLastFile(fileSystem,parent);
  }
 else {
    Runnable runnable=new Runnable(){
      @Override public void run(){
        try {
          process(new IndexAction(){
            private Path _sorted;
            @Override public void performMutate(            IndexSearcherCloseable searcher,            IndexWriter writer) throws IOException {
              Configuration configuration=_tableContext.getConfiguration();
              SequenceFile.Sorter sorter=new Sorter(fileSystem,Text.class,RowMutationWritable.class,configuration);
              _sorted=new Path(path.getParent(),shard + "String_Node_Str");
              LOG.info("String_Node_Str",path,_sorted,table,shard,bulkId);
              sorter.sort(path,_sorted);
              LOG.info("String_Node_Str",_sorted,table,shard,bulkId);
              Reader reader=new SequenceFile.Reader(fileSystem,_sorted,configuration);
              Text key=new Text();
              RowMutationWritable value=new RowMutationWritable();
              Text last=null;
              List<RowMutation> list=new ArrayList<RowMutation>();
              while (reader.next(key,value)) {
                if (!key.equals(last)) {
                  flushMutates(searcher,writer,list);
                  last=new Text(key);
                  list.clear();
                }
                list.add(value.getRowMutation().deepCopy());
              }
              flushMutates(searcher,writer,list);
              reader.close();
              LOG.info("String_Node_Str",table,shard,bulkId);
            }
            private void flushMutates(            IndexSearcherCloseable searcher,            IndexWriter writer,            List<RowMutation> list) throws IOException {
              if (!list.isEmpty()) {
                List<RowMutation> reduceMutates;
                try {
                  reduceMutates=MutatableAction.reduceMutates(list);
                }
 catch (                BlurException e) {
                  throw new IOException(e);
                }
                for (                RowMutation mutation : reduceMutates) {
                  MutatableAction mutatableAction=new MutatableAction(_shardContext);
                  mutatableAction.mutate(mutation);
                  mutatableAction.performMutate(searcher,writer);
                }
              }
            }
            private void cleanupFiles() throws IOException {
              fileSystem.delete(path,false);
              fileSystem.delete(_sorted,false);
              Path parent=path.getParent();
              removeParentIfLastFile(fileSystem,parent);
            }
            @Override public void doPreRollback(            IndexWriter writer) throws IOException {
            }
            @Override public void doPreCommit(            IndexSearcherCloseable indexSearcher,            IndexWriter writer) throws IOException {
            }
            @Override public void doPostRollback(            IndexWriter writer) throws IOException {
              cleanupFiles();
            }
            @Override public void doPostCommit(            IndexWriter writer) throws IOException {
              cleanupFiles();
            }
          }
);
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",table,shard,bulkId);
        }
      }
    }
;
    if (blockUntilComplete) {
      runnable.run();
    }
 else {
      Thread thread=new Thread(runnable);
      thread.setName("String_Node_Str" + table + "String_Node_Str"+ shard+ "String_Node_Str"+ bulkId+ "String_Node_Str");
      thread.start();
    }
  }
}

Fixed version (ground truth):
@Override public void finishBulkMutate(final String bulkId,boolean apply,boolean blockUntilComplete) throws IOException {
  final String table=_tableContext.getTable();
  final String shard=_shardContext.getShard();
  final BulkEntry bulkEntry=_bulkWriters.get(bulkId);
  if (bulkEntry == null) {
    LOG.info("String_Node_Str",bulkId,apply,table,shard);
    return;
  }
  LOG.info("String_Node_Str",bulkId,apply,table,shard);
  bulkEntry._writer.close();
  Configuration configuration=_tableContext.getConfiguration();
  final Path path=bulkEntry._path;
  final FileSystem fileSystem=path.getFileSystem(configuration);
  if (!apply) {
    fileSystem.delete(path,false);
    Path parent=path.getParent();
    removeParentIfLastFile(fileSystem,parent);
  }
 else {
    Runnable runnable=new Runnable(){
      @Override public void run(){
        try {
          process(new IndexAction(){
            private Path _sorted;
            @Override public void performMutate(            IndexSearcherCloseable searcher,            IndexWriter writer) throws IOException {
              Configuration configuration=_tableContext.getConfiguration();
              SequenceFile.Sorter sorter=new Sorter(fileSystem,Text.class,RowMutationWritable.class,configuration);
              _sorted=new Path(path.getParent(),shard + "String_Node_Str");
              LOG.info("String_Node_Str",path,_sorted,table,shard,bulkId);
              sorter.sort(path,_sorted);
              LOG.info("String_Node_Str",_sorted,table,shard,bulkId);
              Reader reader=new SequenceFile.Reader(fileSystem,_sorted,configuration);
              Text key=new Text();
              RowMutationWritable value=new RowMutationWritable();
              Text last=null;
              List<RowMutation> list=new ArrayList<RowMutation>();
              while (reader.next(key,value)) {
                if (!key.equals(last)) {
                  flushMutates(searcher,writer,list);
                  last=new Text(key);
                  list.clear();
                }
                list.add(value.getRowMutation().deepCopy());
              }
              flushMutates(searcher,writer,list);
              reader.close();
              LOG.info("String_Node_Str",table,shard,bulkId);
            }
            private void flushMutates(            IndexSearcherCloseable searcher,            IndexWriter writer,            List<RowMutation> list) throws IOException {
              if (!list.isEmpty()) {
                List<RowMutation> reduceMutates;
                try {
                  reduceMutates=MutatableAction.reduceMutates(list);
                }
 catch (                BlurException e) {
                  throw new IOException(e);
                }
                for (                RowMutation mutation : reduceMutates) {
                  MutatableAction mutatableAction=new MutatableAction(_shardContext);
                  mutatableAction.mutate(mutation);
                  mutatableAction.performMutate(searcher,writer);
                }
              }
            }
            private void cleanupFiles() throws IOException {
              fileSystem.delete(path,false);
              fileSystem.delete(_sorted,false);
              Path parent=path.getParent();
              removeParentIfLastFile(fileSystem,parent);
            }
            @Override public void doPreRollback(            IndexWriter writer) throws IOException {
            }
            @Override public void doPreCommit(            IndexSearcherCloseable indexSearcher,            IndexWriter writer) throws IOException {
            }
            @Override public void doPostRollback(            IndexWriter writer) throws IOException {
              cleanupFiles();
            }
            @Override public void doPostCommit(            IndexWriter writer) throws IOException {
              cleanupFiles();
            }
          }
);
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",table,shard,bulkId,e);
        }
      }
    }
;
    if (blockUntilComplete) {
      runnable.run();
    }
 else {
      Thread thread=new Thread(runnable);
      thread.setName("String_Node_Str" + table + "String_Node_Str"+ shard+ "String_Node_Str"+ bulkId+ "String_Node_Str");
      thread.start();
    }
  }
}