nus-yam/ex-repair huggingface dataset:
Program: 82242
Project: 82242
Buggy source:
@Test public void combineShouldBeCorrect() throws IOException {
  Map<Shard,List<String>> execResults=Maps.newHashMap();
  execResults.put(new Shard("String_Node_Str","String_Node_Str"),Lists.newArrayList("String_Node_Str","String_Node_Str"));
  execResults.put(new Shard("String_Node_Str","String_Node_Str"),Lists.newArrayList("String_Node_Str","String_Node_Str"));
  List<String> expected=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  TermsCommand cmd=new TermsCommand();
  List<String> returned=cmd.combine(execResults);
  assertEquals(expected,returned);
}

Fixed version (ground truth):
@Test public void combineShouldBeCorrect() throws IOException, InterruptedException {
  Map<Shard,List<String>> execResults=Maps.newHashMap();
  execResults.put(new Shard("String_Node_Str","String_Node_Str"),Lists.newArrayList("String_Node_Str","String_Node_Str"));
  execResults.put(new Shard("String_Node_Str","String_Node_Str"),Lists.newArrayList("String_Node_Str","String_Node_Str"));
  List<String> expected=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  TermsCommand cmd=new TermsCommand();
  List<String> returned=cmd.combine(new TestCombiningContext(),execResults);
  assertEquals(expected,returned);
}
Program: 82243
Project: 82243
Buggy source:
@SuppressWarnings("String_Node_Str") protected Map<String,String> getArguments(String commandName,boolean optional){
  Command<?> command=_command.get(commandName);
  if (command == null) {
    return null;
  }
  Class<? extends Command<?>> clazz=(Class<? extends Command<?>>)command.getClass();
  Map<String,String> arguments=new TreeMap<String,String>();
  Argument[] args=getArgumentArray(clazz,optional);
  addArguments(arguments,args);
  if (optional) {
    if (!(command instanceof ShardRoute)) {
      Argument[] argumentArray=getArgumentArray((Class<? extends Command<?>>)Command.class,optional);
      addArguments(arguments,argumentArray);
    }
  }
 else {
    if (!(command instanceof TableRoute)) {
      Argument[] argumentArray=getArgumentArray((Class<? extends Command<?>>)Command.class,optional);
      addArguments(arguments,argumentArray);
    }
  }
  return arguments;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected Map<String,String> getArguments(String commandName,boolean optional){
  Command<?> command=_command.get(commandName);
  if (command == null) {
    return null;
  }
  Class<Command<?>> clazz=(Class<Command<?>>)command.getClass();
  Map<String,String> arguments=new TreeMap<String,String>();
  Argument[] args=getArgumentArray(clazz,optional);
  addArguments(arguments,args);
  if (optional) {
    if (!(command instanceof ShardRoute)) {
      Argument[] argumentArray=getArgumentArray(Command.class,optional);
      addArguments(arguments,argumentArray);
    }
  }
 else {
    if (!(command instanceof TableRoute)) {
      Argument[] argumentArray=getArgumentArray(Command.class,optional);
      addArguments(arguments,argumentArray);
    }
  }
  return arguments;
}
Program: 82244
Project: 82244
Buggy source:
protected Argument[] getArgumentArray(Class<? extends Command<?>> clazz,boolean optional){
  if (optional) {
    OptionalArguments arguments=clazz.getAnnotation(OptionalArguments.class);
    if (arguments == null) {
      return null;
    }
    return arguments.value();
  }
 else {
    RequiredArguments arguments=clazz.getAnnotation(RequiredArguments.class);
    if (arguments == null) {
      return null;
    }
    return arguments.value();
  }
}

Fixed version (ground truth):
protected Argument[] getArgumentArray(Class<?> clazz,boolean optional){
  if (optional) {
    OptionalArguments arguments=clazz.getAnnotation(OptionalArguments.class);
    if (arguments == null) {
      return null;
    }
    return arguments.value();
  }
 else {
    RequiredArguments arguments=clazz.getAnnotation(RequiredArguments.class);
    if (arguments == null) {
      return null;
    }
    return arguments.value();
  }
}
Program: 82245
Project: 82245
Buggy source:
@Override public void configure(String fieldNameForThisInstance,Map<String,String> properties,Configuration configuration){
  _ctx=SpatialContext.GEO;
  SpatialPrefixTree grid=getSpatialPrefixTree(properties);
  _strategy=new RecursivePrefixTreeStrategy(grid,fieldNameForThisInstance);
  _shapeReadWriter=new ShapeReadWriter<SpatialContext>(_ctx);
  addSupportedIndexedShapes(Shape.class);
  addSupportedOperations(SpatialOperation.IsDisjointTo);
  addSupportedOperations(SpatialOperation.Intersects);
  addSupportedOperations(SpatialOperation.IsWithin);
  addSupportedOperations(SpatialOperation.Contains);
}

Fixed version (ground truth):
@Override public void configure(String fieldNameForThisInstance,Map<String,String> properties,Configuration configuration){
  _ctx=SpatialContext.GEO;
  SpatialPrefixTree grid=getSpatialPrefixTree(properties);
  boolean docValue=false;
  if (properties.get(DOC_VALUE) != null) {
    docValue=true;
  }
  _strategy=new RecursivePrefixTreeStrategy(grid,fieldNameForThisInstance,docValue);
  _shapeReadWriter=new ShapeReadWriter<SpatialContext>(_ctx);
  addSupportedIndexedShapes(Shape.class);
  addSupportedOperations(SpatialOperation.IsDisjointTo);
  addSupportedOperations(SpatialOperation.Intersects);
  addSupportedOperations(SpatialOperation.IsWithin);
  addSupportedOperations(SpatialOperation.Contains);
}
Program: 82246
Project: 82246
Buggy source:
@Override public void configure(String fieldNameForThisInstance,Map<String,String> properties,Configuration configuration){
  _ctx=SpatialContext.GEO;
  SpatialPrefixTree grid=getSpatialPrefixTree(properties);
  _strategy=new TermQueryPrefixTreeStrategy(grid,fieldNameForThisInstance);
  _shapeReadWriter=new ShapeReadWriter<SpatialContext>(_ctx);
  addSupportedIndexedShapes(Point.class);
  addSupportedOperations(SpatialOperation.Intersects);
}

Fixed version (ground truth):
@Override public void configure(String fieldNameForThisInstance,Map<String,String> properties,Configuration configuration){
  _ctx=SpatialContext.GEO;
  boolean docValue=false;
  if (properties.get(DOC_VALUE) != null) {
    docValue=true;
  }
  SpatialPrefixTree grid=getSpatialPrefixTree(properties);
  _strategy=new TermQueryPrefixTreeStrategy(grid,fieldNameForThisInstance,docValue);
  _shapeReadWriter=new ShapeReadWriter<SpatialContext>(_ctx);
  addSupportedIndexedShapes(Point.class);
  addSupportedOperations(SpatialOperation.Intersects);
}
Program: 82247
Project: 82247
Buggy source:
@Override public boolean needsTaskCommit(TaskAttemptContext context) throws IOException {
  return _runTaskCommit;
}

Fixed version (ground truth):
@Override public boolean needsTaskCommit(TaskAttemptContext context) throws IOException {
  int numReduceTasks=context.getNumReduceTasks();
  TaskAttemptID taskAttemptID=context.getTaskAttemptID();
  return taskAttemptID.isMap() && numReduceTasks != 0 ? false : true;
}
Program: 82248
Project: 82248
Buggy source:
@Override public void run(){
  while (_running.get()) {
    _writeLock.lock();
    try {
      if (_output != null && _lastWrite.get() + MAX_OPEN_FOR_WRITING < System.currentTimeMillis()) {
        LOG.info("String_Node_Str",_path);
        try {
          _output.close();
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",e);
        }
 finally {
          _output=null;
        }
        try {
          cleanupOldFiles();
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",e);
        }
      }
    }
  finally {
      _writeLock.unlock();
    }
    try {
      Thread.sleep(DAEMON_POLL_TIME);
    }
 catch (    InterruptedException e) {
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  _writeLock.lock();
  try {
    try {
      cleanupOldFiles();
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
  }
  finally {
    _writeLock.unlock();
  }
  while (_running.get()) {
    _writeLock.lock();
    try {
      if (_output != null && _lastWrite.get() + MAX_OPEN_FOR_WRITING < System.currentTimeMillis()) {
        LOG.info("String_Node_Str",_path);
        try {
          _output.close();
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",e);
        }
 finally {
          _output=null;
        }
        try {
          cleanupOldFiles();
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",e);
        }
      }
    }
  finally {
      _writeLock.unlock();
    }
    try {
      Thread.sleep(DAEMON_POLL_TIME);
    }
 catch (    InterruptedException e) {
      return;
    }
  }
}
Program: 82249
Project: 82249
Buggy source:
@Override public void put(BytesRef key,BytesRef value) throws IOException {
  ensureOpen();
  if (value == null) {
    delete(key);
    return;
  }
  _writeLock.lock();
  ensureOpenForWriting();
  try {
    Operation op=getPutOperation(OperationType.PUT,key,value);
    Path path=write(op);
    BytesRef deepCopyOf=BytesRef.deepCopyOf(value);
    _size.addAndGet(deepCopyOf.bytes.length);
    Value old=_pointers.put(BytesRef.deepCopyOf(key),new Value(deepCopyOf,path));
    if (old != null) {
      _size.addAndGet(-old._bytesRef.bytes.length);
    }
    if (!path.equals(_outputPath)) {
      cleanupOldFiles();
    }
  }
 catch (  RemoteException e) {
    throw new IOException("String_Node_Str",e);
  }
catch (  LeaseExpiredException e) {
    throw new IOException("String_Node_Str",e);
  }
 finally {
    _writeLock.unlock();
  }
}

Fixed version (ground truth):
@Override public void put(BytesRef key,BytesRef value) throws IOException {
  ensureOpen();
  if (value == null) {
    delete(key);
    return;
  }
  _writeLock.lock();
  ensureOpenForWriting();
  try {
    Operation op=getPutOperation(OperationType.PUT,key,value);
    Path path=write(op);
    BytesRef deepCopyOf=BytesRef.deepCopyOf(value);
    _size.addAndGet(deepCopyOf.bytes.length);
    Value old=_pointers.put(BytesRef.deepCopyOf(key),new Value(deepCopyOf,path));
    if (old != null) {
      _size.addAndGet(-old._bytesRef.bytes.length);
    }
  }
 catch (  RemoteException e) {
    throw new IOException("String_Node_Str",e);
  }
catch (  LeaseExpiredException e) {
    throw new IOException("String_Node_Str",e);
  }
 finally {
    _writeLock.unlock();
  }
}
Program: 82250
Project: 82250
Buggy source:
public HdfsKeyValueStore(Configuration configuration,Path path,long maxAmountAllowedPerFile) throws IOException {
  _maxAmountAllowedPerFile=maxAmountAllowedPerFile;
  _configuration=configuration;
  _path=path;
  _configuration.setBoolean("String_Node_Str",true);
  _fileSystem=FileSystem.get(_path.toUri(),_configuration);
  _readWriteLock=new ReentrantReadWriteLock();
  _writeLock=_readWriteLock.writeLock();
  _readLock=_readWriteLock.readLock();
  _fileStatus.set(getSortedSet(_path));
  if (!_fileStatus.get().isEmpty()) {
    _currentFileCounter.set(Long.parseLong(_fileStatus.get().last().getPath().getName()));
  }
  loadIndexes();
  openWriter();
  _daemon=startDaemon();
  cleanupOldFiles();
  Metrics.newGauge(new MetricName(ORG_APACHE_BLUR,HDFS_KV,SIZE,path.getParent().toString()),new Gauge<Long>(){
    @Override public Long value(){
      return _size.get();
    }
  }
);
}

Fixed version (ground truth):
public HdfsKeyValueStore(Configuration configuration,Path path,long maxAmountAllowedPerFile) throws IOException {
  _maxAmountAllowedPerFile=maxAmountAllowedPerFile;
  _configuration=configuration;
  _path=path;
  _configuration.setBoolean("String_Node_Str",true);
  _fileSystem=FileSystem.get(_path.toUri(),_configuration);
  _fileSystem.mkdirs(_path);
  _readWriteLock=new ReentrantReadWriteLock();
  _writeLock=_readWriteLock.writeLock();
  _readLock=_readWriteLock.readLock();
  _fileStatus.set(getSortedSet(_path));
  if (!_fileStatus.get().isEmpty()) {
    _currentFileCounter.set(Long.parseLong(_fileStatus.get().last().getPath().getName()));
  }
  removeAnyTruncatedFiles();
  loadIndexes();
  _daemon=startDaemon();
  Metrics.newGauge(new MetricName(ORG_APACHE_BLUR,HDFS_KV,SIZE,path.getParent().toString()),new Gauge<Long>(){
    @Override public Long value(){
      return _size.get();
    }
  }
);
}
Program: 82251
Project: 82251
Buggy source:
private Thread startDaemon(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      while (_running.get()) {
        _writeLock.lock();
        try {
          if (_output != null && _lastWrite.get() + MAX_OPEN_FOR_WRITING < System.currentTimeMillis()) {
            LOG.info("String_Node_Str",_path);
            try {
              _output.close();
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
            }
 finally {
              _output=null;
            }
            try {
              cleanupOldFiles();
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
            }
          }
        }
  finally {
          _writeLock.unlock();
        }
        try {
          Thread.sleep(DAEMON_POLL_TIME);
        }
 catch (        InterruptedException e) {
          return;
        }
      }
    }
  }
);
  thread.setName("String_Node_Str" + _path + "String_Node_Str");
  thread.setDaemon(true);
  thread.start();
  return thread;
}

Fixed version (ground truth):
private Thread startDaemon(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      _writeLock.lock();
      try {
        try {
          cleanupOldFiles();
        }
 catch (        IOException e) {
          LOG.error("String_Node_Str",e);
        }
      }
  finally {
        _writeLock.unlock();
      }
      while (_running.get()) {
        _writeLock.lock();
        try {
          if (_output != null && _lastWrite.get() + MAX_OPEN_FOR_WRITING < System.currentTimeMillis()) {
            LOG.info("String_Node_Str",_path);
            try {
              _output.close();
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
            }
 finally {
              _output=null;
            }
            try {
              cleanupOldFiles();
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
            }
          }
        }
  finally {
          _writeLock.unlock();
        }
        try {
          Thread.sleep(DAEMON_POLL_TIME);
        }
 catch (        InterruptedException e) {
          return;
        }
      }
    }
  }
);
  thread.setName("String_Node_Str" + _path + "String_Node_Str");
  thread.setDaemon(true);
  thread.start();
  return thread;
}
Program: 82252
Project: 82252
Buggy source:
private void rollFile() throws IOException {
  logSize();
  LOG.info("String_Node_Str" + _outputPath + "String_Node_Str");
  _output.close();
  openWriter();
}

Fixed version (ground truth):
private void rollFile() throws IOException {
  LOG.info("String_Node_Str" + _outputPath + "String_Node_Str");
  _output.close();
  openWriter();
}
Program: 82253
Project: 82253
Buggy source:
private void openWriter() throws IOException {
  logSize();
  long nextSegment=_currentFileCounter.incrementAndGet();
  String name=buffer(nextSegment);
  _outputPath=new Path(_path,name);
  LOG.info("String_Node_Str",_outputPath);
  _output=_fileSystem.create(_outputPath,false);
  _output.write(MAGIC);
  _output.writeInt(VERSION);
  syncInternal();
}

Fixed version (ground truth):
private void openWriter() throws IOException {
  long nextSegment=_currentFileCounter.incrementAndGet();
  String name=buffer(nextSegment);
  _outputPath=new Path(_path,name);
  LOG.info("String_Node_Str",_outputPath);
  _output=_fileSystem.create(_outputPath,false);
  _output.write(MAGIC);
  _output.writeInt(VERSION);
  syncInternal();
}
Program: 82254
Project: 82254
Buggy source:
@Test public void testFileGC() throws IOException {
  HdfsKeyValueStore store=new HdfsKeyValueStore(_configuration,_path,1000);
  FileSystem fileSystem=_path.getFileSystem(_configuration);
  assertEquals(1,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.close();
}

Fixed version (ground truth):
@Test public void testFileGC() throws IOException {
  HdfsKeyValueStore store=new HdfsKeyValueStore(_configuration,_path,1000);
  store.put(new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"));
  FileSystem fileSystem=_path.getFileSystem(_configuration);
  assertEquals(1,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  store.cleanupOldFiles();
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.close();
}
Program: 82255
Project: 82255
Buggy source:
@Test public void testFileRolling() throws IOException {
  HdfsKeyValueStore store=new HdfsKeyValueStore(_configuration,_path,1000);
  FileSystem fileSystem=_path.getFileSystem(_configuration);
  assertEquals(1,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.close();
}

Fixed version (ground truth):
@Test public void testFileRolling() throws IOException {
  HdfsKeyValueStore store=new HdfsKeyValueStore(_configuration,_path,1000);
  FileSystem fileSystem=_path.getFileSystem(_configuration);
  store.put(new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"));
  assertEquals(1,fileSystem.listStatus(_path).length);
  store.put(new BytesRef("String_Node_Str"),new BytesRef(new byte[2000]));
  assertEquals(2,fileSystem.listStatus(_path).length);
  store.close();
}
Program: 82256
Project: 82256
Buggy source:
public Query parse(final String queryStr) throws ParseException {
  final Map<String,Query> subQueries=new HashMap<String,Query>();
  final StringBuilder builder=new StringBuilder();
  match(queryStr,new Group(){
    int _subQueryIndex=0;
    @Override public void match(    int start,    int end) throws ParseException {
      if (_lastStart != start) {
        builder.append(queryStr.substring(_lastEnd,start));
      }
      String realQuery=queryStr.substring(start,end);
      LOG.debug("String_Node_Str",realQuery);
      String superQueryStr=getMatchText(realQuery);
      LOG.debug("String_Node_Str",superQueryStr);
      String key=_prefixToSub + _subQueryIndex;
      QueryParser newParser=getNewParser();
      Query query=newParser.parse(superQueryStr);
      if (!isSameGroupName(query)) {
        throw new ParseException("String_Node_Str" + superQueryStr + "String_Node_Str");
      }
      if (_superSearch) {
        query=newSuperQuery(query);
      }
 else {
        query=wrapFilter(query);
      }
      subQueries.put(key,query);
      builder.append(_prefixToSub).append(':').append(_subQueryIndex);
      _subQueryIndex++;
      _lastStart=start;
      _lastEnd=end;
    }
    private String getMatchText(    String match){
      return match.substring(1,match.length() - 1);
    }
  }
);
  if (_lastEnd < queryStr.length()) {
    builder.append(queryStr.substring(_lastEnd));
  }
  Query query=super.parse(builder.toString());
  return reprocess(replaceRealQueries(query,subQueries));
}

Fixed version (ground truth):
public Query parse(final String queryStr) throws ParseException {
  final Map<String,Query> subQueries=new HashMap<String,Query>();
  final StringBuilder builder=new StringBuilder();
  match(queryStr,new Group(){
    int _subQueryIndex=0;
    @Override public void match(    int start,    int end) throws ParseException {
      if (_lastStart != start) {
        builder.append(queryStr.substring(_lastEnd,start));
      }
      String realQuery=queryStr.substring(start,end);
      LOG.debug("String_Node_Str",realQuery);
      String superQueryStr=getMatchText(realQuery);
      LOG.debug("String_Node_Str",superQueryStr);
      String key=_prefixToSub + _subQueryIndex;
      QueryParser newParser=getNewParser();
      Query query=newParser.parse(superQueryStr);
      if (!isSameGroupName(query)) {
        throw new ParseException("String_Node_Str" + superQueryStr + "String_Node_Str");
      }
      if (_superSearch) {
        query=newSuperQuery(query);
      }
 else {
        query=wrapFilter(query);
      }
      subQueries.put(key,query);
      builder.append(_prefixToSub).append(':').append(_subQueryIndex);
      _subQueryIndex++;
      _lastStart=start;
      _lastEnd=end;
    }
    private String getMatchText(    String match){
      return match.substring(1,match.length() - 1);
    }
  }
);
  if (_lastEnd < queryStr.length()) {
    builder.append(queryStr.substring(_lastEnd));
  }
  Query query=super.parse(builder.toString());
  return fixNegatives(reprocess(replaceRealQueries(query,subQueries)));
}
Program: 82257
Project: 82257
Buggy source:
private Query parseSq(String qstr) throws ParseException {
  SuperParser superParser=new SuperParser(LUCENE_VERSION,_fieldManager,true,null,ScoreType.SUPER,new Term("String_Node_Str"));
  return superParser.parse(qstr);
}

Fixed version (ground truth):
private Query parseSq(String qstr) throws ParseException {
  SuperParser superParser=new SuperParser(LUCENE_VERSION,_fieldManager,true,null,ScoreType.SUPER,new Term("String_Node_Str","String_Node_Str"));
  return superParser.parse(qstr);
}
Program: 82258
Project: 82258
Buggy source:
private SuperQuery sq(Query q){
  return new SuperQuery(q,ScoreType.SUPER,new Term("String_Node_Str"));
}

Fixed version (ground truth):
private SuperQuery sq(Query q){
  return new SuperQuery(q,ScoreType.SUPER,new Term("String_Node_Str","String_Node_Str"));
}
Program: 82259
Project: 82259
Buggy source:
private void checkCurrentAuth(HttpServletRequest request,HttpServletResponse response) throws IOException {
  IProvider provider=Config.getProvider();
  Map<String,Object> responseData=new HashMap<String,Object>();
  if (provider.isLoginRequired()) {
    String authToken=HttpUtil.getFirstParam(request.getParameterMap().get(AUTH_TOKEN));
    if (StringUtils.isNotBlank(authToken) && provider.getUser(authToken,request) != null) {
      responseData.put(LOGIN_STATUS_FIELD,true);
    }
 else {
      responseData.put(LOGIN_STATUS_FIELD,false);
      responseData.put(LOGIN_FIELDS_FIELD,provider.getLoginFields());
    }
  }
 else {
    responseData.put(LOGIN_STATUS_FIELD,true);
  }
  HttpUtil.sendResponse(response,new ObjectMapper().writeValueAsString(responseData),HttpUtil.JSON);
}

Fixed version (ground truth):
private void checkCurrentAuth(HttpServletRequest request,HttpServletResponse response) throws IOException {
  IProvider provider=Config.getProvider();
  Map<String,Object> responseData=new HashMap<String,Object>();
  if (provider.isLoginRequired()) {
    String authToken=HttpUtil.getFirstParam((String[])request.getParameterMap().get(AUTH_TOKEN));
    if (StringUtils.isNotBlank(authToken) && provider.getUser(authToken,request) != null) {
      responseData.put(LOGIN_STATUS_FIELD,true);
    }
 else {
      responseData.put(LOGIN_STATUS_FIELD,false);
      responseData.put(LOGIN_FIELDS_FIELD,provider.getLoginFields());
    }
  }
 else {
    responseData.put(LOGIN_STATUS_FIELD,true);
  }
  HttpUtil.sendResponse(response,new ObjectMapper().writeValueAsString(responseData),HttpUtil.JSON);
}
Program: 82260
Project: 82260
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static Map<String,Object> fetchRow(String table,String query,String[] families,String remoteHost) throws IOException, BlurException, TException {
  try {
    Iface client=Config.getClient(remoteHost);
    Selector selector=new Selector();
    String rowid=StringUtils.remove(query,"String_Node_Str");
    selector.setRowId(rowid);
    selector.setColumnFamiliesToFetch(new HashSet<String>(Arrays.asList(families)));
    FetchResult fetchRow=client.fetchRow(table,selector);
    Map<String,Object> results=new HashMap<String,Object>();
    results.put(TOTAL_KEY,fetchRow.getRowResult().getRow() == null ? 0 : 1);
    Map<String,List> rows=new HashMap<String,List>();
    Row row=fetchRow.getRowResult().getRow();
    if (row != null) {
      for (      Record record : row.getRecords()) {
        String family=record.getFamily();
        List<ResultRow> fam=(List<ResultRow>)getFam(family,rows,false);
        ResultRow rowData=getRow(row.getId(),fam);
        rowData.getRecords().add(buildRow(record.getColumns(),record.getRecordId()));
      }
    }
    results.put(DATA_KEY,rows);
    results.put(FAMILY_KEY,new HashSet<String>(Arrays.asList(families)));
    return results;
  }
  finally {
    UserContext.reset();
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static Map<String,Object> fetchRow(String table,String query,String[] families,String remoteHost) throws IOException, BlurException, TException {
  try {
    Iface client=Config.getClient(remoteHost);
    Selector selector=new Selector();
    String rowid=StringUtils.remove(query,"String_Node_Str");
    selector.setRowId(rowid);
    selector.setColumnFamiliesToFetch(new HashSet<String>(Arrays.asList(families)));
    FetchResult fetchRow=client.fetchRow(table,selector);
    Map<String,Object> results=new HashMap<String,Object>();
    results.put(TOTAL_KEY,fetchRow.getRowResult().getRow() == null ? 0 : 1);
    Map<String,List> rows=new HashMap<String,List>();
    Row row=fetchRow.getRowResult().getRow();
    if (row != null && row.getRecords() != null) {
      for (      Record record : row.getRecords()) {
        String family=record.getFamily();
        List<ResultRow> fam=(List<ResultRow>)getFam(family,rows,false);
        ResultRow rowData=getRow(row.getId(),fam);
        rowData.getRecords().add(buildRow(record.getColumns(),record.getRecordId()));
      }
    }
    results.put(DATA_KEY,rows);
    results.put(FAMILY_KEY,new HashSet<String>(Arrays.asList(families)));
    return results;
  }
  finally {
    UserContext.reset();
  }
}
Program: 82261
Project: 82261
Buggy source:
@Override public void run(){
  try {
    entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
 finally {
    finished.incrementAndGet();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    finished.incrementAndGet();
  }
}
Program: 82262
Project: 82262
Buggy source:
private void processInternal(ExecutorService executor) throws IOException {
  List<Entry<Object,Info>> entries=new ArrayList<Entry<Object,Info>>(_infoMap.entrySet());
  Collections.sort(entries,COMPARATOR);
  if (executor == null) {
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        e.getValue().process(_counts,_minimumsBeforeReturning,_running);
      }
    }
  }
 else {
    final AtomicInteger finished=new AtomicInteger();
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        final Entry<Object,Info> entry=e;
        executor.submit(new Runnable(){
          @Override public void run(){
            try {
              entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
            }
 catch (            IOException e) {
              LOG.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
 finally {
              finished.incrementAndGet();
            }
          }
        }
);
      }
    }
    while (finished.get() < entries.size()) {
synchronized (this) {
        try {
          wait(1);
        }
 catch (        InterruptedException e) {
          throw new IOException(e);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processInternal(ExecutorService executor) throws IOException {
  List<Entry<Object,Info>> entries=new ArrayList<Entry<Object,Info>>(_infoMap.entrySet());
  Collections.sort(entries,COMPARATOR);
  if (executor == null) {
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        e.getValue().process(_counts,_minimumsBeforeReturning,_running);
      }
    }
  }
 else {
    final AtomicInteger finished=new AtomicInteger();
    for (    Entry<Object,Info> e : entries) {
      if (_running.get()) {
        final Entry<Object,Info> entry=e;
        executor.submit(new Runnable(){
          @Override public void run(){
            try {
              entry.getValue().process(_counts,_minimumsBeforeReturning,_running);
            }
 catch (            Throwable e) {
              LOG.error("String_Node_Str",e);
            }
 finally {
              finished.incrementAndGet();
            }
          }
        }
);
      }
    }
    while (finished.get() < entries.size()) {
synchronized (this) {
        try {
          wait(1);
        }
 catch (        InterruptedException e) {
          throw new IOException(e);
        }
      }
    }
  }
}
Program: 82263
Project: 82263
Buggy source:
private void flushToTmpIndex() throws IOException {
  if (_documents.isEmpty()) {
    return;
  }
  _usingLocalTmpindex=true;
  if (_localTmpWriter == null) {
    String localDirPath=System.getProperty(JAVA_IO_TMPDIR);
    _localTmpPath=new File(localDirPath,UUID.randomUUID().toString() + "String_Node_Str");
    _localTmpDir=new ProgressableDirectory(FSDirectory.open(_localTmpPath),BlurOutputFormat.getProgressable());
    _localTmpWriter=new IndexWriter(_localTmpDir,_overFlowConf.clone());
    List<List<Field>> docs=new ArrayList<List<Field>>(_documents.values());
    docs.get(0).add(new StringField(BlurConstants.PRIME_DOC,BlurConstants.PRIME_DOC_VALUE,Store.NO));
    _localTmpWriter.addDocuments(docs);
  }
 else {
    _localTmpWriter.addDocuments(_documents.values());
  }
  _documents.clear();
}

Fixed version (ground truth):
private void flushToTmpIndex() throws IOException {
  if (_documents.isEmpty()) {
    return;
  }
  _usingLocalTmpindex=true;
  if (_localTmpWriter == null) {
    String localDirPath=System.getProperty(JAVA_IO_TMPDIR);
    _localTmpPath=new File(localDirPath,UUID.randomUUID().toString() + "String_Node_Str");
    HdfsDirectory directory=new HdfsDirectory(_configuration,new Path(_localTmpPath.toURI()));
    _localTmpDir=new ProgressableDirectory(directory,BlurOutputFormat.getProgressable());
    _localTmpWriter=new IndexWriter(_localTmpDir,_overFlowConf.clone());
    List<List<Field>> docs=new ArrayList<List<Field>>(_documents.values());
    docs.get(0).add(new StringField(BlurConstants.PRIME_DOC,BlurConstants.PRIME_DOC_VALUE,Store.NO));
    _localTmpWriter.addDocuments(docs);
  }
 else {
    _localTmpWriter.addDocuments(_documents.values());
  }
  _documents.clear();
}
Program: 82265
Project: 82265
Buggy source:
/** 
 * Checks the query by running validation against the   {@link BlurQuery} andthe  {@link Selector} provided.
 * @param blurQuery the  {@link BlurQuery} to validate.
 * @throws BlurException
 */
public void checkQuery(BlurQuery blurQuery) throws BlurException {
  if (blurQuery.selector != null) {
    if (blurQuery.selector.recordOnly) {
      if (blurQuery.fetch > _maxQueryRecordFetch) {
        LOG.warn("String_Node_Str",_maxQueryRecordFetch);
        blurQuery.fetch=(int)blurQuery.minimumNumberOfResults;
      }
    }
 else {
      if (blurQuery.fetch > _maxQueryRowFetch) {
        LOG.warn("String_Node_Str",_maxQueryRowFetch);
        blurQuery.fetch=(int)blurQuery.minimumNumberOfResults;
      }
    }
  }
  if (blurQuery.fetch > _maxQueryResultsFetch) {
    LOG.warn("String_Node_Str",_maxQueryResultsFetch);
    blurQuery.fetch=(int)blurQuery.minimumNumberOfResults;
  }
  if (blurQuery.fetch > blurQuery.minimumNumberOfResults) {
    LOG.warn("String_Node_Str",blurQuery.fetch,blurQuery.minimumNumberOfResults);
    blurQuery.fetch=(int)blurQuery.minimumNumberOfResults;
  }
  Query query=blurQuery.getQuery();
  if (blurQuery.getRowId() != null) {
    if (query.isRowQuery()) {
      throw new BException("String_Node_Str",query,blurQuery);
    }
  }
  List<SortField> sortFields=blurQuery.getSortFields();
  if (sortFields != null && !sortFields.isEmpty()) {
    boolean rowQuery=query.isRowQuery();
    if (rowQuery) {
      throw new BException("String_Node_Str",query,blurQuery);
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks the query by running validation against the   {@link BlurQuery} andthe  {@link Selector} provided.
 * @param blurQuery the  {@link BlurQuery} to validate.
 * @throws BlurException
 */
public void checkQuery(BlurQuery blurQuery) throws BlurException {
  if (blurQuery.selector != null) {
    if (blurQuery.selector.recordOnly) {
      if (blurQuery.fetch > _maxQueryRecordFetch) {
        LOG.warn("String_Node_Str",blurQuery.fetch,_maxQueryRecordFetch);
        blurQuery.fetch=_maxQueryRecordFetch;
      }
    }
 else {
      if (blurQuery.fetch > _maxQueryRowFetch) {
        LOG.warn("String_Node_Str",blurQuery.fetch,_maxQueryRowFetch);
        blurQuery.fetch=_maxQueryRowFetch;
      }
    }
  }
  if (blurQuery.fetch > _maxQueryResultsFetch) {
    LOG.warn("String_Node_Str",blurQuery.fetch,_maxQueryResultsFetch);
    blurQuery.fetch=_maxQueryResultsFetch;
  }
  if (blurQuery.fetch > blurQuery.minimumNumberOfResults) {
    LOG.warn("String_Node_Str",blurQuery.fetch,blurQuery.minimumNumberOfResults);
    blurQuery.fetch=(int)blurQuery.minimumNumberOfResults;
  }
  Query query=blurQuery.getQuery();
  if (blurQuery.getRowId() != null) {
    if (query.isRowQuery()) {
      throw new BException("String_Node_Str",query,blurQuery);
    }
  }
  List<SortField> sortFields=blurQuery.getSortFields();
  if (sortFields != null && !sortFields.isEmpty()) {
    boolean rowQuery=query.isRowQuery();
    if (rowQuery) {
      throw new BException("String_Node_Str",query,blurQuery);
    }
  }
}
Program: 82266
Project: 82266
Buggy source:
private void cleanup(){
  clearMapOfOldTables(_layout);
  boolean closed=false;
  Map<String,Map<String,BlurIndex>> oldIndexesThatNeedToBeClosed=clearMapOfOldTables(_indexes);
  for (  String table : oldIndexesThatNeedToBeClosed.keySet()) {
    Map<String,BlurIndex> indexes=oldIndexesThatNeedToBeClosed.get(table);
    if (indexes == null) {
      continue;
    }
    for (    String shard : indexes.keySet()) {
      BlurIndex index=indexes.get(shard);
      if (index == null) {
        continue;
      }
      close(index,table,shard);
      closed=true;
    }
  }
  for (  String table : _indexes.keySet()) {
    Map<String,BlurIndex> shardMap=_indexes.get(table);
    if (shardMap != null) {
      Set<String> shards=new HashSet<String>(shardMap.keySet());
      Set<String> shardsToServe=getShardsToServe(table);
      shards.removeAll(shardsToServe);
      if (!shards.isEmpty()) {
        LOG.info("String_Node_Str",table,shards);
      }
      for (      String shard : shards) {
        LOG.info("String_Node_Str",table,shard);
        BlurIndex index=shardMap.remove(shard);
        close(index,table,shard);
        closed=true;
      }
    }
    if (closed) {
      TableContext.clear(table);
    }
  }
}

Fixed version (ground truth):
private void cleanup(){
  clearMapOfOldTables(_layout);
  clearMapOfOldTables(_distributedLayoutFactory.getLayoutCache());
  boolean closed=false;
  Map<String,Map<String,BlurIndex>> oldIndexesThatNeedToBeClosed=clearMapOfOldTables(_indexes);
  for (  String table : oldIndexesThatNeedToBeClosed.keySet()) {
    Map<String,BlurIndex> indexes=oldIndexesThatNeedToBeClosed.get(table);
    if (indexes == null) {
      continue;
    }
    for (    String shard : indexes.keySet()) {
      BlurIndex index=indexes.get(shard);
      if (index == null) {
        continue;
      }
      close(index,table,shard);
      closed=true;
    }
  }
  for (  String table : _indexes.keySet()) {
    Map<String,BlurIndex> shardMap=_indexes.get(table);
    if (shardMap != null) {
      Set<String> shards=new HashSet<String>(shardMap.keySet());
      Set<String> shardsToServe=getShardsToServe(table);
      shards.removeAll(shardsToServe);
      if (!shards.isEmpty()) {
        LOG.info("String_Node_Str",table,shards);
      }
      for (      String shard : shards) {
        LOG.info("String_Node_Str",table,shard);
        BlurIndex index=shardMap.remove(shard);
        close(index,table,shard);
        closed=true;
      }
    }
    if (closed) {
      TableContext.clear(table);
    }
  }
}
Program: 82267
Project: 82267
Buggy source:
private DistributedLayoutFactory getDefaultLayoutFactory(){
  return new DistributedLayoutFactory(){
    @Override public DistributedLayout createDistributedLayout(    String table,    List<String> shardList,    List<String> shardServerList,    List<String> offlineShardServers){
      DistributedLayoutManager layoutManager=new DistributedLayoutManager();
      layoutManager.setNodes(shardServerList);
      layoutManager.setNodesOffline(offlineShardServers);
      layoutManager.setShards(shardList);
      layoutManager.init();
      return layoutManager;
    }
    @Override public DistributedLayout readCurrentLayout(    String table){
      throw new RuntimeException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
private DistributedLayoutFactory getDefaultLayoutFactory(){
  return new DistributedLayoutFactory(){
    @Override public DistributedLayout createDistributedLayout(    String table,    List<String> shardList,    List<String> shardServerList,    List<String> offlineShardServers){
      DistributedLayoutManager layoutManager=new DistributedLayoutManager();
      layoutManager.setNodes(shardServerList);
      layoutManager.setNodesOffline(offlineShardServers);
      layoutManager.setShards(shardList);
      layoutManager.init();
      return layoutManager;
    }
    @Override public DistributedLayout readCurrentLayout(    String table){
      throw new RuntimeException("String_Node_Str");
    }
    @Override public Map<String,?> getLayoutCache(){
      throw new RuntimeException("String_Node_Str");
    }
  }
;
}
Program: 82268
Project: 82268
Buggy source:
private String findExistingStoragePath(String table) throws KeeperException, InterruptedException {
  String tableStoragePath=ZookeeperPathConstants.getTablePath(_cluster,table);
  ZkUtils.mkNodesStr(_zooKeeper,tableStoragePath);
  List<String> children=new ArrayList<String>(_zooKeeper.getChildren(tableStoragePath,false));
  String path=null;
  for (  String child : children) {
    int index=child.lastIndexOf(SEP);
    if (index >= 0) {
      if (child.substring(0,index).equals(table)) {
        if (path == null || child.compareTo(path) > 0) {
          path=child;
        }
      }
    }
  }
  return tableStoragePath + "String_Node_Str" + path;
}

Fixed version (ground truth):
private String findExistingStoragePath(String table) throws KeeperException, InterruptedException {
  String tableStoragePath=ZookeeperPathConstants.getTablePath(_cluster,table);
  ZkUtils.mkNodesStr(_zooKeeper,tableStoragePath);
  List<String> children=new ArrayList<String>(_zooKeeper.getChildren(tableStoragePath,false));
  String path=null;
  for (  String child : children) {
    int index=child.lastIndexOf(SEP);
    if (index >= 0) {
      if (child.substring(0,index).equals(table)) {
        if (path == null || child.compareTo(path) > 0) {
          path=child;
        }
      }
    }
  }
  if (path == null) {
    return null;
  }
  return tableStoragePath + "String_Node_Str" + path;
}
Program: 82269
Project: 82269
Buggy source:
@Override public DistributedLayout createDistributedLayout(String table,List<String> shardList,List<String> shardServerList,List<String> offlineShardServers){
  MasterBasedDistributedLayout layout=_cachedLayoutMap.get(table);
  List<String> onlineShardServerList=getOnlineShardServerList(shardServerList,offlineShardServers);
  if (layout == null || layout.isOutOfDate(shardList,onlineShardServerList)) {
    LOG.info("String_Node_Str",table);
    MasterBasedDistributedLayout newLayout=newLayout(table,shardList,onlineShardServerList);
    _cachedLayoutMap.put(table,newLayout);
    return newLayout;
  }
 else {
    return layout;
  }
}

Fixed version (ground truth):
@Override public DistributedLayout createDistributedLayout(String table,List<String> shardList,List<String> shardServerList,List<String> offlineShardServers){
  LOG.info("String_Node_Str",table);
  MasterBasedDistributedLayout layout=_cachedLayoutMap.get(table);
  List<String> onlineShardServerList=getOnlineShardServerList(shardServerList,offlineShardServers);
  if (layout == null || layout.isOutOfDate(shardList,onlineShardServerList)) {
    LOG.info("String_Node_Str",table);
    MasterBasedDistributedLayout newLayout=newLayout(table,shardList,onlineShardServerList);
    _cachedLayoutMap.put(table,newLayout);
    return newLayout;
  }
 else {
    LOG.info("String_Node_Str",table);
    return layout;
  }
}
Program: 82270
Project: 82270
Buggy source:
@Override public DistributedLayout readCurrentLayout(String table){
  LOG.info("String_Node_Str",table);
  try {
    String existingStoragePath=findExistingStoragePath(table);
    if (existingStoragePath == null) {
      return null;
    }
    Stat stat=_zooKeeper.exists(existingStoragePath,false);
    if (stat != null) {
      LOG.info("String_Node_Str",table);
      byte[] data=_zooKeeper.getData(existingStoragePath,false,stat);
      if (data != null) {
        return fromBytes(data);
      }
    }
    return null;
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public DistributedLayout readCurrentLayout(String table){
  LOG.info("String_Node_Str",table);
  try {
    String existingStoragePath=findExistingStoragePath(table);
    if (existingStoragePath == null) {
      LOG.info("String_Node_Str",table,existingStoragePath);
      return null;
    }
    Stat stat=_zooKeeper.exists(existingStoragePath,false);
    if (stat != null) {
      LOG.info("String_Node_Str",table,existingStoragePath);
      LOG.info("String_Node_Str",table);
      byte[] data=_zooKeeper.getData(existingStoragePath,false,stat);
      if (data != null) {
        return fromBytes(data);
      }
 else {
        return null;
      }
    }
 else {
      LOG.info("String_Node_Str",table,existingStoragePath);
      return null;
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}
Program: 82271
Project: 82271
Buggy source:
@Override public Map<String,String> shardServerLayout(String table) throws BlurException, TException {
  try {
    checkTable(table);
    Map<String,Map<String,String>> layout=_shardServerLayout.get();
    Map<String,String> tableLayout=layout.get(table);
    if (tableLayout == null) {
      return new HashMap<String,String>();
    }
    return tableLayout;
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,table);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,table);
  }
}

Fixed version (ground truth):
@Override public Map<String,String> shardServerLayout(String table) throws BlurException, TException {
  try {
    checkTable(table);
    Map<String,String> tableLayout=getTableLayout(table);
    return tableLayout;
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,table);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,table);
  }
}
Program: 82274
Project: 82274
Buggy source:
@Override public void enqueueMutate(final RowMutation mutation) throws BlurException, TException {
  try {
    checkTable(mutation.table);
    checkForUpdates(mutation.table);
    MutationHelper.validateMutation(mutation);
    String table=mutation.getTable();
    int numberOfShards=getShardCount(table);
    Map<String,String> tableLayout=_shardServerLayout.get().get(table);
    if (tableLayout.size() != numberOfShards) {
      throw new BException("String_Node_Str");
    }
    String shardName=MutationHelper.getShardName(table,mutation.rowId,numberOfShards,_blurPartitioner);
    String node=tableLayout.get(shardName);
    _client.execute(node,new BlurCommand<Void>(){
      @Override public Void call(      Client client) throws BlurException, TException {
        client.enqueueMutate(mutation);
        return null;
      }
    }
,_maxMutateRetries,_mutateDelay,_maxMutateDelay);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,mutation);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,mutation);
  }
}

Fixed version (ground truth):
@Override public void enqueueMutate(final RowMutation mutation) throws BlurException, TException {
  try {
    checkTable(mutation.table);
    checkForUpdates(mutation.table);
    MutationHelper.validateMutation(mutation);
    String table=mutation.getTable();
    int numberOfShards=getShardCount(table);
    Map<String,String> tableLayout=getTableLayout(table);
    if (tableLayout.size() != numberOfShards) {
      throw new BException("String_Node_Str");
    }
    String shardName=MutationHelper.getShardName(table,mutation.rowId,numberOfShards,_blurPartitioner);
    String node=tableLayout.get(shardName);
    _client.execute(node,new BlurCommand<Void>(){
      @Override public Void call(      Client client) throws BlurException, TException {
        client.enqueueMutate(mutation);
        return null;
      }
    }
,_maxMutateRetries,_mutateDelay,_maxMutateDelay);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,mutation);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,mutation);
  }
}
Program: 82276
Project: 82276
Buggy source:
@Override public void mutate(final RowMutation mutation) throws BlurException, TException {
  try {
    checkTable(mutation.table);
    checkForUpdates(mutation.table);
    MutationHelper.validateMutation(mutation);
    String table=mutation.getTable();
    int numberOfShards=getShardCount(table);
    Map<String,String> tableLayout=_shardServerLayout.get().get(table);
    if (tableLayout.size() != numberOfShards) {
      throw new BException("String_Node_Str");
    }
    String shardName=MutationHelper.getShardName(table,mutation.rowId,numberOfShards,_blurPartitioner);
    String node=tableLayout.get(shardName);
    _client.execute(node,new BlurCommand<Void>(){
      @Override public Void call(      Client client) throws BlurException, TException {
        client.mutate(mutation);
        return null;
      }
    }
,_maxMutateRetries,_mutateDelay,_maxMutateDelay);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,mutation);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,mutation);
  }
}

Fixed version (ground truth):
@Override public void mutate(final RowMutation mutation) throws BlurException, TException {
  try {
    checkTable(mutation.table);
    checkForUpdates(mutation.table);
    MutationHelper.validateMutation(mutation);
    String table=mutation.getTable();
    int numberOfShards=getShardCount(table);
    Map<String,String> tableLayout=getTableLayout(table);
    if (tableLayout.size() != numberOfShards) {
      throw new BException("String_Node_Str");
    }
    String shardName=MutationHelper.getShardName(table,mutation.rowId,numberOfShards,_blurPartitioner);
    String node=tableLayout.get(shardName);
    _client.execute(node,new BlurCommand<Void>(){
      @Override public Void call(      Client client) throws BlurException, TException {
        client.mutate(mutation);
        return null;
      }
    }
,_maxMutateRetries,_mutateDelay,_maxMutateDelay);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,mutation);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,mutation);
  }
}