nus-yam/ex-repair huggingface dataset:
Program: 13211
Project: 13211
Buggy source:
@Override protected Void visitLongLiteral(LongLiteral node,SubscriptContext context){
  validateNestedArrayAccess(context);
  long value=node.getValue();
  if (value < 1 || value > MAX_VALUE) {
    throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",MAX_VALUE));
  }
  context.index(new Long(node.getValue()).intValue());
  return null;
}

Fixed version (ground truth):
@Override protected Void visitLongLiteral(LongLiteral node,SubscriptContext context){
  validateNestedArrayAccess(context);
  long value=node.getValue();
  if (value < 1 || value > MAX_VALUE) {
    throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",MAX_VALUE));
  }
  context.index((int)value);
  return null;
}
Program: 13212
Project: 13212
Buggy source:
@Override public void startProjection(ExecutionState executionState){
  this.executionState=executionState;
}

Fixed version (ground truth):
@Override public void startProjection(ExecutionState executionState){
}
Program: 13213
Project: 13213
Buggy source:
public long killJobs(Collection<UUID> toKill){
  long numKilled=0L;
  writeLock.lock();
  for (  KillAllListener killAllListener : killAllListeners) {
    for (    UUID job : toKill) {
      killAllListener.killJob(job);
    }
  }
  try {
    for (    UUID jobId : toKill) {
      JobExecutionContext ctx=activeContexts.get(jobId);
      if (ctx != null) {
        ctx.kill();
        numKilled++;
      }
    }
  }
  finally {
    writeLock.unlock();
  }
  return numKilled;
}

Fixed version (ground truth):
public long killJobs(Collection<UUID> toKill){
  long numKilled=0L;
  writeLock.lock();
  try {
    for (    KillAllListener killAllListener : killAllListeners) {
      for (      UUID job : toKill) {
        killAllListener.killJob(job);
      }
    }
    for (    UUID jobId : toKill) {
      JobExecutionContext ctx=activeContexts.get(jobId);
      if (ctx != null) {
        ctx.kill();
        numKilled++;
      }
    }
  }
  finally {
    writeLock.unlock();
  }
  return numKilled;
}
Program: 13214
Project: 13214
Buggy source:
public ShardProjectorChain(UUID jobId,int numShardsEstimate,List<Projection> projections,RowDownstream finalDownstream,ProjectorFactory projectorFactory,RamAccountingContext ramAccountingContext){
  this.jobId=jobId;
  this.projections=projections;
  this.executionState=executionState;
  this.ramAccountingContext=ramAccountingContext;
  nodeProjectors=new ArrayList<>();
  int idx=0;
  for (  Projection projection : projections) {
    if (projection.requiredGranularity() == RowGranularity.SHARD) {
      shardProjectionsIndex=idx;
      break;
    }
    idx++;
  }
  Projector previousUpstream=null;
  for (int i=shardProjectionsIndex + 1; i < projections.size(); i++) {
    Projector projector=projectorFactory.create(projections.get(i),ramAccountingContext,jobId);
    nodeProjectors.add(projector);
    if (previousUpstream != null) {
      previousUpstream.downstream(projector);
    }
 else {
      firstNodeProjector=projector;
    }
    previousUpstream=projector;
  }
  if (nodeProjectors.isEmpty()) {
    firstNodeProjector=finalDownstream;
  }
 else {
    nodeProjectors.get(nodeProjectors.size() - 1).downstream(finalDownstream);
  }
  if (shardProjectionsIndex >= 0) {
    shardProjectors=new ArrayList<>((shardProjectionsIndex + 1) * numShardsEstimate);
  }
 else {
    shardProjectors=ImmutableList.of();
  }
}

Fixed version (ground truth):
public ShardProjectorChain(UUID jobId,int numShardsEstimate,List<Projection> projections,RowDownstream finalDownstream,ProjectorFactory projectorFactory,RamAccountingContext ramAccountingContext){
  this.jobId=jobId;
  this.projections=projections;
  this.ramAccountingContext=ramAccountingContext;
  nodeProjectors=new ArrayList<>();
  int idx=0;
  for (  Projection projection : projections) {
    if (projection.requiredGranularity() == RowGranularity.SHARD) {
      shardProjectionsIndex=idx;
      break;
    }
    idx++;
  }
  Projector previousUpstream=null;
  for (int i=shardProjectionsIndex + 1; i < projections.size(); i++) {
    Projector projector=projectorFactory.create(projections.get(i),ramAccountingContext,jobId);
    nodeProjectors.add(projector);
    if (previousUpstream != null) {
      previousUpstream.downstream(projector);
    }
 else {
      firstNodeProjector=projector;
    }
    previousUpstream=projector;
  }
  if (nodeProjectors.isEmpty()) {
    firstNodeProjector=finalDownstream;
  }
 else {
    nodeProjectors.get(nodeProjectors.size() - 1).downstream(finalDownstream);
  }
  if (shardProjectionsIndex >= 0) {
    shardProjectors=new ArrayList<>((shardProjectionsIndex + 1) * numShardsEstimate);
  }
 else {
    shardProjectors=ImmutableList.of();
  }
}
Program: 13215
Project: 13215
Buggy source:
private Tuple<String[],Symbol[]> convertAssignments(Map<Reference,Symbol> assignments){
  String[] assignmentColumns=new String[assignments.size()];
  Symbol[] assignmentSymbols=new Symbol[assignments.size()];
  Iterator<Reference> it=assignments.keySet().iterator();
  int i=0;
  while (it.hasNext()) {
    Reference key=it.next();
    assignmentColumns[i]=key.ident().columnIdent().fqn();
    assignmentSymbols[i]=assignments.get(key);
    i++;
  }
  return new Tuple<>(assignmentColumns,assignmentSymbols);
}

Fixed version (ground truth):
private Tuple<String[],Symbol[]> convertAssignments(Map<Reference,Symbol> assignments){
  String[] assignmentColumns=new String[assignments.size()];
  Symbol[] assignmentSymbols=new Symbol[assignments.size()];
  int i=0;
  for (  Map.Entry<Reference,Symbol> entry : assignments.entrySet()) {
    Reference key=entry.getKey();
    assignmentColumns[i]=key.ident().columnIdent().fqn();
    assignmentSymbols[i]=entry.getValue();
    i++;
  }
  return new Tuple<>(assignmentColumns,assignmentSymbols);
}
Program: 13217
Project: 13217
Buggy source:
private LuceneDocCollector createDocCollector(OrderBy orderBy,Integer limit,Projector projector,List<Symbol> input) throws Exception {
  CollectNode node=new CollectNode(0,"String_Node_Str",null,input,ImmutableList.<Projection>of());
  node.whereClause(WhereClause.MATCH_ALL);
  node.orderBy(orderBy);
  node.limit(limit);
  node.whereClause(WhereClause.MATCH_ALL);
  UUID jobId=UUID.randomUUID();
  node.jobId(jobId);
  node.toCollect(input);
  node.maxRowGranularity(RowGranularity.DOC);
  ShardProjectorChain projectorChain=Mockito.mock(ShardProjectorChain.class);
  Mockito.when(projectorChain.newShardDownstreamProjector(Matchers.any(ProjectionToProjectorVisitor.class))).thenReturn(projector);
  JobExecutionContext.Builder builder=jobContextService.newBuilder(jobId);
  jobCollectContext=new JobCollectContext(jobId,node,CLUSTER.getInstance(MapSideDataCollectOperation.class),RAM_ACCOUNTING_CONTEXT,collectingProjector);
  builder.addSubContext(node.executionNodeId(),jobCollectContext);
  LuceneDocCollector collector=(LuceneDocCollector)shardCollectService.getCollector(node,projectorChain,jobCollectContext,0);
  collector.pageSize(PAGE_SIZE);
  return collector;
}

Fixed version (ground truth):
private LuceneDocCollector createDocCollector(OrderBy orderBy,Integer limit,Projector projector,List<Symbol> input) throws Exception {
  CollectNode node=new CollectNode(0,"String_Node_Str",null,input,ImmutableList.<Projection>of());
  node.whereClause(WhereClause.MATCH_ALL);
  node.orderBy(orderBy);
  node.limit(limit);
  node.whereClause(WhereClause.MATCH_ALL);
  UUID jobId=UUID.randomUUID();
  node.jobId(jobId);
  node.maxRowGranularity(RowGranularity.DOC);
  ShardProjectorChain projectorChain=Mockito.mock(ShardProjectorChain.class);
  Mockito.when(projectorChain.newShardDownstreamProjector(Matchers.any(ProjectionToProjectorVisitor.class))).thenReturn(projector);
  JobExecutionContext.Builder builder=jobContextService.newBuilder(jobId);
  jobCollectContext=new JobCollectContext(jobId,node,CLUSTER.getInstance(MapSideDataCollectOperation.class),RAM_ACCOUNTING_CONTEXT,collectingProjector);
  builder.addSubContext(node.executionNodeId(),jobCollectContext);
  LuceneDocCollector collector=(LuceneDocCollector)shardCollectService.getCollector(node,projectorChain,jobCollectContext,0);
  collector.pageSize(PAGE_SIZE);
  return collector;
}
Program: 13218
Project: 13218
Buggy source:
@Override public void start(){
  if (!this.upstreamResult.isEmpty()) {
    Futures.addCallback(Futures.allAsList(this.upstreamResult),new FutureCallback<List<TaskResult>>(){
      @Override public void onSuccess(      @Nullable List<TaskResult> result){
        doStart(result);
      }
      @Override public void onFailure(      @Nonnull Throwable t){
        throw new TaskExecutionException(AbstractChainedTask.this,t);
      }
    }
);
  }
 else {
    doStart(ImmutableList.<TaskResult>of());
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (!this.upstreamResult.isEmpty()) {
    Futures.addCallback(Futures.allAsList(this.upstreamResult),new FutureCallback<List<TaskResult>>(){
      @Override public void onSuccess(      @Nullable List<TaskResult> result){
        doStart(result);
      }
      @Override public void onFailure(      @Nonnull Throwable t){
        result.setException(t);
      }
    }
);
  }
 else {
    doStart(ImmutableList.<TaskResult>of());
  }
}
Program: 13219
Project: 13219
Buggy source:
@Override public void onFailure(@Nonnull Throwable t){
  throw new TaskExecutionException(AbstractChainedTask.this,t);
}

Fixed version (ground truth):
@Override public void onFailure(@Nonnull Throwable t){
  result.setException(t);
}
Program: 13220
Project: 13220
Buggy source:
public static PartitionName toPartitionName(TableInfo tableInfo,List<Assignment> partitionProperties,Object[] parameters){
  Preconditions.checkArgument(tableInfo.isPartitioned(),"String_Node_Str",tableInfo.ident().fqn());
  Preconditions.checkArgument(partitionProperties.size() == tableInfo.partitionedBy().size(),"String_Node_Str",tableInfo.ident().fqn(),tableInfo.partitionedBy().size(),partitionProperties.size());
  Map<ColumnIdent,Object> properties=assignmentsToMap(partitionProperties,parameters);
  BytesRef[] values=new BytesRef[properties.size()];
  for (  Map.Entry<ColumnIdent,Object> entry : properties.entrySet()) {
    Object value=entry.getValue();
    int idx=tableInfo.partitionedBy().indexOf(entry.getKey());
    try {
      ReferenceInfo referenceInfo=tableInfo.partitionedByColumns().get(idx);
      Object converted=referenceInfo.type().value(value);
      values[idx]=converted == null ? null : DataTypes.STRING.value(converted);
    }
 catch (    IndexOutOfBoundsException ex) {
      throw new IllegalArgumentException(String.format("String_Node_Str",entry.getKey().sqlFqn()));
    }
  }
  return new PartitionName(tableInfo.ident().name(),Arrays.asList(values));
}

Fixed version (ground truth):
public static PartitionName toPartitionName(TableInfo tableInfo,List<Assignment> partitionProperties,Object[] parameters){
  Preconditions.checkArgument(tableInfo.isPartitioned(),"String_Node_Str",tableInfo.ident().fqn());
  Preconditions.checkArgument(partitionProperties.size() == tableInfo.partitionedBy().size(),"String_Node_Str",tableInfo.ident().fqn(),tableInfo.partitionedBy().size(),partitionProperties.size());
  Map<ColumnIdent,Object> properties=assignmentsToMap(partitionProperties,parameters);
  BytesRef[] values=new BytesRef[properties.size()];
  for (  Map.Entry<ColumnIdent,Object> entry : properties.entrySet()) {
    Object value=entry.getValue();
    int idx=tableInfo.partitionedBy().indexOf(entry.getKey());
    try {
      ReferenceInfo referenceInfo=tableInfo.partitionedByColumns().get(idx);
      Object converted=referenceInfo.type().value(value);
      values[idx]=converted == null ? null : DataTypes.STRING.value(converted);
    }
 catch (    IndexOutOfBoundsException ex) {
      throw new IllegalArgumentException(String.format("String_Node_Str",entry.getKey().sqlFqn()));
    }
  }
  return new PartitionName(tableInfo.ident(),Arrays.asList(values));
}
Program: 13221
Project: 13221
Buggy source:
public static String indexName(TableInfo tableInfo,Optional<List<BytesRef>> values){
  if (tableInfo.isPartitioned()) {
    return new PartitionName(tableInfo.ident(),values.get()).stringValue();
  }
 else {
    return tableInfo.ident().name();
  }
}

Fixed version (ground truth):
public static String indexName(TableInfo tableInfo,Optional<List<BytesRef>> values){
  if (tableInfo.isPartitioned()) {
    return new PartitionName(tableInfo.ident(),values.get()).stringValue();
  }
 else {
    return tableInfo.ident().esName();
  }
}
Program: 13222
Project: 13222
Buggy source:
/** 
 * return the ES index names the query should go to
 */
public static String[] indices(TableInfo tableInfo,WhereClause whereClause){
  String[] indices;
  if (whereClause.noMatch()) {
    indices=org.elasticsearch.common.Strings.EMPTY_ARRAY;
  }
 else   if (!tableInfo.isPartitioned()) {
    indices=new String[]{tableInfo.ident().name()};
  }
 else   if (whereClause.partitions().isEmpty()) {
    if (whereClause.noMatch()) {
      return new String[0];
    }
    indices=new String[tableInfo.partitions().size()];
    int i=0;
    for (    PartitionName partitionName : tableInfo.partitions()) {
      indices[i]=partitionName.stringValue();
      i++;
    }
  }
 else {
    indices=whereClause.partitions().toArray(new String[whereClause.partitions().size()]);
  }
  return indices;
}

Fixed version (ground truth):
/** 
 * return the ES index names the query should go to
 */
public static String[] indices(TableInfo tableInfo,WhereClause whereClause){
  String[] indices;
  if (whereClause.noMatch()) {
    indices=org.elasticsearch.common.Strings.EMPTY_ARRAY;
  }
 else   if (!tableInfo.isPartitioned()) {
    indices=new String[]{tableInfo.ident().esName()};
  }
 else   if (whereClause.partitions().isEmpty()) {
    if (whereClause.noMatch()) {
      return new String[0];
    }
    indices=new String[tableInfo.partitions().size()];
    int i=0;
    for (    PartitionName partitionName : tableInfo.partitions()) {
      indices[i]=partitionName.stringValue();
      i++;
    }
  }
 else {
    indices=whereClause.partitions().toArray(new String[whereClause.partitions().size()]);
  }
  return indices;
}
Program: 13223
Project: 13223
Buggy source:
@Override public String[] concreteIndices(){
  return new String[]{ident.name()};
}

Fixed version (ground truth):
@Override public String[] concreteIndices(){
  return new String[]{ident.esName()};
}
Program: 13225
Project: 13225
Buggy source:
@Inject public ShardCollectService(ClusterService clusterService,Settings settings,TransportActionProvider transportActionProvider,ShardId shardId,IndexService indexService,ScriptService scriptService,CacheRecycler cacheRecycler,PageCacheRecycler pageCacheRecycler,BigArrays bigArrays,SQLXContentQueryParser sqlxContentQueryParser,Functions functions,ShardReferenceResolver referenceResolver,BlobIndices blobIndices,BlobShardReferenceResolver blobShardReferenceResolver){
  this.clusterService=clusterService;
  this.shardId=shardId;
  this.indexService=indexService;
  this.scriptService=scriptService;
  this.cacheRecycler=cacheRecycler;
  this.pageCacheRecycler=pageCacheRecycler;
  this.bigArrays=bigArrays;
  this.sqlxContentQueryParser=sqlxContentQueryParser;
  this.queryBuilder=new ESQueryBuilder();
  this.blobIndices=blobIndices;
  isBlobShard=BlobIndices.isBlobShard(this.shardId);
  this.docInputSymbolVisitor=new CollectInputSymbolVisitor<>(functions,(isBlobShard ? BlobReferenceResolver.INSTANCE : LuceneDocLevelReferenceResolver.INSTANCE));
  this.shardImplementationSymbolVisitor=new ImplementationSymbolVisitor((isBlobShard ? blobShardReferenceResolver : referenceResolver),functions,RowGranularity.SHARD);
  this.shardNormalizer=new EvaluatingNormalizer(functions,RowGranularity.SHARD,(isBlobShard ? blobShardReferenceResolver : referenceResolver));
  this.projectorVisitor=new ProjectionToProjectorVisitor(clusterService,settings,transportActionProvider,shardImplementationSymbolVisitor,shardNormalizer);
}

Fixed version (ground truth):
@Inject public ShardCollectService(ClusterService clusterService,Settings settings,TransportActionProvider transportActionProvider,ShardId shardId,IndexService indexService,ScriptService scriptService,CacheRecycler cacheRecycler,PageCacheRecycler pageCacheRecycler,BigArrays bigArrays,SQLXContentQueryParser sqlxContentQueryParser,Functions functions,ShardReferenceResolver referenceResolver,BlobIndices blobIndices,BlobShardReferenceResolver blobShardReferenceResolver){
  this.clusterService=clusterService;
  this.shardId=shardId;
  this.indexService=indexService;
  this.scriptService=scriptService;
  this.cacheRecycler=cacheRecycler;
  this.pageCacheRecycler=pageCacheRecycler;
  this.bigArrays=bigArrays;
  this.sqlxContentQueryParser=sqlxContentQueryParser;
  this.queryBuilder=new ESQueryBuilder();
  this.blobIndices=blobIndices;
  isBlobShard=BlobIndices.isBlobShard(this.shardId);
  DocLevelReferenceResolver<? extends Input<?>> resolver=(isBlobShard ? BlobReferenceResolver.INSTANCE : LuceneDocLevelReferenceResolver.INSTANCE);
  this.docInputSymbolVisitor=new CollectInputSymbolVisitor<>(functions,resolver);
  this.shardImplementationSymbolVisitor=new ImplementationSymbolVisitor((isBlobShard ? blobShardReferenceResolver : referenceResolver),functions,RowGranularity.SHARD);
  this.shardNormalizer=new EvaluatingNormalizer(functions,RowGranularity.SHARD,(isBlobShard ? blobShardReferenceResolver : referenceResolver));
  this.projectorVisitor=new ProjectionToProjectorVisitor(clusterService,settings,transportActionProvider,shardImplementationSymbolVisitor,shardNormalizer);
}
Program: 13226
Project: 13226
Buggy source:
private void addChildImplementations(){
  childImplementations.put(HTTP,new PortExpression(HTTP){
    @Override public Integer value(){
      return portFromAddress(httpServer.info().address().publishAddress());
    }
  }
);
  childImplementations.put(TRANSPORT,new PortExpression(TRANSPORT){
    @Override public Integer value(){
      return portFromAddress(nodeService.stats().getNode().address());
    }
  }
);
}

Fixed version (ground truth):
private void addChildImplementations(){
  childImplementations.put(HTTP,new PortExpression(HTTP){
    @Override public Integer value(){
      if (nodeService.info().getHttp() == null) {
        return null;
      }
      return portFromAddress(nodeService.info().getHttp().address().publishAddress());
    }
  }
);
  childImplementations.put(TRANSPORT,new PortExpression(TRANSPORT){
    @Override public Integer value(){
      return portFromAddress(nodeService.stats().getNode().address());
    }
  }
);
}
Program: 13227
Project: 13227
Buggy source:
@Inject public NodePortExpression(NodeService nodeService,HttpServer httpServer){
  super(NAME);
  this.nodeService=nodeService;
  this.httpServer=httpServer;
  addChildImplementations();
}

Fixed version (ground truth):
@Inject public NodePortExpression(NodeService nodeService){
  super(NAME);
  this.nodeService=nodeService;
  addChildImplementations();
}
Program: 13229
Project: 13229
Buggy source:
@Inject public ShardCollectService(ClusterService clusterService,Settings settings,TransportActionProvider transportActionProvider,ShardId shardId,IndexService indexService,ScriptService scriptService,CacheRecycler cacheRecycler,PageCacheRecycler pageCacheRecycler,BigArrays bigArrays,SQLXContentQueryParser sqlxContentQueryParser,Functions functions,ShardReferenceResolver referenceResolver,BlobIndices blobIndices,BlobShardReferenceResolver blobShardReferenceResolver){
  this.clusterService=clusterService;
  this.shardId=shardId;
  this.indexService=indexService;
  this.scriptService=scriptService;
  this.cacheRecycler=cacheRecycler;
  this.pageCacheRecycler=pageCacheRecycler;
  this.bigArrays=bigArrays;
  this.sqlxContentQueryParser=sqlxContentQueryParser;
  this.queryBuilder=new ESQueryBuilder();
  this.blobIndices=blobIndices;
  isBlobShard=BlobIndices.isBlobShard(this.shardId);
  this.docInputSymbolVisitor=new CollectInputSymbolVisitor<>(functions,(isBlobShard ? BlobReferenceResolver.INSTANCE : LuceneDocLevelReferenceResolver.INSTANCE));
  this.shardImplementationSymbolVisitor=new ImplementationSymbolVisitor((isBlobShard ? blobShardReferenceResolver : referenceResolver),functions,RowGranularity.SHARD);
  this.shardNormalizer=new EvaluatingNormalizer(functions,RowGranularity.SHARD,(isBlobShard ? blobShardReferenceResolver : referenceResolver));
  this.projectorVisitor=new ProjectionToProjectorVisitor(clusterService,settings,transportActionProvider,shardImplementationSymbolVisitor,shardNormalizer);
}

Fixed version (ground truth):
@Inject public ShardCollectService(ClusterService clusterService,Settings settings,TransportActionProvider transportActionProvider,ShardId shardId,IndexService indexService,ScriptService scriptService,CacheRecycler cacheRecycler,PageCacheRecycler pageCacheRecycler,BigArrays bigArrays,SQLXContentQueryParser sqlxContentQueryParser,Functions functions,ShardReferenceResolver referenceResolver,BlobIndices blobIndices,BlobShardReferenceResolver blobShardReferenceResolver){
  this.clusterService=clusterService;
  this.shardId=shardId;
  this.indexService=indexService;
  this.scriptService=scriptService;
  this.cacheRecycler=cacheRecycler;
  this.pageCacheRecycler=pageCacheRecycler;
  this.bigArrays=bigArrays;
  this.sqlxContentQueryParser=sqlxContentQueryParser;
  this.queryBuilder=new ESQueryBuilder();
  this.blobIndices=blobIndices;
  isBlobShard=BlobIndices.isBlobShard(this.shardId);
  DocLevelReferenceResolver<? extends Input<?>> resolver=(isBlobShard ? BlobReferenceResolver.INSTANCE : LuceneDocLevelReferenceResolver.INSTANCE);
  this.docInputSymbolVisitor=new CollectInputSymbolVisitor<>(functions,resolver);
  this.shardImplementationSymbolVisitor=new ImplementationSymbolVisitor((isBlobShard ? blobShardReferenceResolver : referenceResolver),functions,RowGranularity.SHARD);
  this.shardNormalizer=new EvaluatingNormalizer(functions,RowGranularity.SHARD,(isBlobShard ? blobShardReferenceResolver : referenceResolver));
  this.projectorVisitor=new ProjectionToProjectorVisitor(clusterService,settings,transportActionProvider,shardImplementationSymbolVisitor,shardNormalizer);
}
Program: 13230
Project: 13230
Buggy source:
@Override protected String visitQualifiedNameReference(QualifiedNameReference node,Void context){
  List<String> parts=new ArrayList<>();
  for (  String part : node.getName().getParts()) {
    parts.add(formatIdentifier(part));
  }
  return WHITESPACE_JOINER.join(parts);
}

Fixed version (ground truth):
@Override protected String visitQualifiedNameReference(QualifiedNameReference node,Void context){
  List<String> parts=new ArrayList<>();
  for (  String part : node.getName().getParts()) {
    parts.add(formatIdentifier(part));
  }
  return Joiner.on('.').join(parts);
}
Program: 13231
Project: 13231
Buggy source:
@Override protected String visitNode(Node node,Void context){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override protected String visitNode(Node node,Void context){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",node.toString()));
}
Program: 13232
Project: 13232
Buggy source:
/** 
 * Returns the cause throwable of a   {@link org.elasticsearch.transport.RemoteTransportException}and   {@link org.elasticsearch.action.search.ReduceSearchPhaseException}. Also transform throwable to   {@link io.crate.exceptions.CrateException}.
 */
public Throwable esToCrateException(Throwable e){
  e=Exceptions.unwrap(e);
  if (e instanceof IllegalArgumentException || e instanceof ParsingException) {
    return new SQLParseException(e.getMessage(),(Exception)e);
  }
 else   if (e instanceof UnsupportedOperationException) {
    return new UnsupportedFeatureException(e.getMessage());
  }
 else   if (e instanceof DocumentAlreadyExistsException) {
    return new DuplicateKeyException("String_Node_Str",e);
  }
 else   if (e instanceof IndexAlreadyExistsException) {
    return new TableAlreadyExistsException(((IndexAlreadyExistsException)e).index().name(),e);
  }
 else   if ((e instanceof InvalidIndexNameException)) {
    if (e.getMessage().contains("String_Node_Str")) {
      return new TableAlreadyExistsException(((InvalidIndexNameException)e).index().getName(),e);
    }
    return new InvalidTableNameException(((InvalidIndexNameException)e).index().getName(),e);
  }
 else   if (e instanceof IndexMissingException) {
    return new TableUnknownException(((IndexMissingException)e).index().name(),e);
  }
 else   if (e instanceof ReduceSearchPhaseException && e.getCause() instanceof VersionConflictException) {
    return e.getCause();
  }
  return e;
}

Fixed version (ground truth):
/** 
 * Returns the cause throwable of a   {@link org.elasticsearch.transport.RemoteTransportException}and   {@link org.elasticsearch.action.search.ReduceSearchPhaseException}. Also transform throwable to   {@link io.crate.exceptions.CrateException}.
 */
public Throwable esToCrateException(Throwable e){
  e=Exceptions.unwrap(e);
  if (e instanceof IllegalArgumentException || e instanceof ParsingException) {
    return new SQLParseException(e.getMessage(),(Exception)e);
  }
 else   if (e instanceof UnsupportedOperationException) {
    return new UnsupportedFeatureException(e.getMessage(),(Exception)e);
  }
 else   if (e instanceof DocumentAlreadyExistsException) {
    return new DuplicateKeyException("String_Node_Str",e);
  }
 else   if (e instanceof IndexAlreadyExistsException) {
    return new TableAlreadyExistsException(((IndexAlreadyExistsException)e).index().name(),e);
  }
 else   if ((e instanceof InvalidIndexNameException)) {
    if (e.getMessage().contains("String_Node_Str")) {
      return new TableAlreadyExistsException(((InvalidIndexNameException)e).index().getName(),e);
    }
    return new InvalidTableNameException(((InvalidIndexNameException)e).index().getName(),e);
  }
 else   if (e instanceof IndexMissingException) {
    return new TableUnknownException(((IndexMissingException)e).index().name(),e);
  }
 else   if (e instanceof ReduceSearchPhaseException && e.getCause() instanceof VersionConflictException) {
    return e.getCause();
  }
  return e;
}
Program: 13233
Project: 13233
Buggy source:
@Override public SchemaInfo schema(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public SchemaInfo schema(){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13234
Project: 13234
Buggy source:
@Override public TableInfo table(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public TableInfo table(){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13235
Project: 13235
Buggy source:
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13236
Project: 13236
Buggy source:
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13237
Project: 13237
Buggy source:
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13238
Project: 13238
Buggy source:
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void upstreamResult(List<ListenableFuture<Object[][]>> result){
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13239
Project: 13239
Buggy source:
@Override public XContentBuilder toXContent(XContentBuilder builder,Params params) throws IOException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public XContentBuilder toXContent(XContentBuilder builder,Params params) throws IOException {
  throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",getClass().getSimpleName()));
}
Program: 13240
Project: 13240
Buggy source:
public AggregationCollector(Aggregation a,AggregationFunction aggregationFunction,Input... inputs){
  if (a.fromStep() == Aggregation.Step.PARTIAL && inputs.length > 1) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
switch (a.fromStep()) {
case ITER:
    fromImpl=new FromIter();
  break;
case PARTIAL:
fromImpl=new FromPartial();
break;
case FINAL:
throw new UnsupportedOperationException("String_Node_Str");
default :
throw new UnsupportedOperationException();
}
switch (a.toStep()) {
case ITER:
throw new UnsupportedOperationException("String_Node_Str");
case PARTIAL:
toImpl=new ToPartial();
break;
case FINAL:
toImpl=new ToFinal();
break;
default :
throw new UnsupportedOperationException();
}
this.inputs=inputs;
this.aggregationFunction=aggregationFunction;
}

Fixed version (ground truth):
public AggregationCollector(Aggregation a,AggregationFunction aggregationFunction,Input... inputs){
  if (a.fromStep() == Aggregation.Step.PARTIAL && inputs.length > 1) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
switch (a.fromStep()) {
case ITER:
    fromImpl=new FromIter();
  break;
case PARTIAL:
fromImpl=new FromPartial();
break;
case FINAL:
throw new UnsupportedOperationException("String_Node_Str");
default :
throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",a.fromStep().name()));
}
switch (a.toStep()) {
case ITER:
throw new UnsupportedOperationException("String_Node_Str");
case PARTIAL:
toImpl=new ToPartial();
break;
case FINAL:
toImpl=new ToFinal();
break;
default :
throw new UnsupportedOperationException(String.format(Locale.ENGLISH,"String_Node_Str",a.toStep().name()));
}
this.inputs=inputs;
this.aggregationFunction=aggregationFunction;
}
Program: 13241
Project: 13241
Buggy source:
@Override public Long load(@Nonnull String key) throws Exception {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public Long load(@Nonnull String key) throws Exception {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 13242
Project: 13242
Buggy source:
@Override public Symbol visitFunction(Function symbol,Void context){
  boolean needsCopy=false;
  List<Symbol> arguments=symbol.arguments();
  for (int i=0; i < arguments.size(); i++) {
    Symbol argument=arguments.get(i);
    arguments.set(i,process(argument,null));
    if (argument.symbolType() == SymbolType.REFERENCE) {
      needsCopy=true;
    }
  }
  try {
    return needsCopy ? symbol.deepCopy() : symbol;
  }
 catch (  IOException e) {
    throw new RuntimeException(SymbolFormatter.format("String_Node_Str",symbol),e);
  }
}

Fixed version (ground truth):
@Override public Symbol visitFunction(Function symbol,Void context){
  boolean needsCopy=false;
  List<Symbol> arguments=Lists.newArrayList(symbol.arguments());
  for (int i=0; i < arguments.size(); i++) {
    Symbol argument=arguments.get(i);
    arguments.set(i,process(argument,null));
    if (argument.symbolType() == SymbolType.REFERENCE) {
      needsCopy=true;
    }
  }
  try {
    return needsCopy ? symbol.deepCopy() : symbol;
  }
 catch (  IOException e) {
    throw new RuntimeException(SymbolFormatter.format("String_Node_Str",symbol),e);
  }
}
Program: 13243
Project: 13243
Buggy source:
public void readUnlock(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public void readUnlock(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 13244
Project: 13244
Buggy source:
@Test public void testInsertNestedObjectLiteral() throws Exception {
  InsertAnalysis analysis=(InsertAnalysis)analyze("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertThat(analysis.sourceMaps().size(),is(1));
  Object[] arrayValue=(Object[])analysis.sourceMaps().get(0).get("String_Node_Str");
  assertThat(arrayValue.length,is(2));
  assertThat(arrayValue[0],instanceOf(Map.class));
  assertThat((String)((Map<String,Object>)arrayValue[0]).get("String_Node_Str"),is("String_Node_Str"));
  assertThat((String)((Map<String,Object>)arrayValue[1]).get("String_Node_Str"),is("String_Node_Str"));
  assertThat(Arrays.toString((Object[])((Map<String,Object>)arrayValue[0]).get("String_Node_Str")),is("String_Node_Str"));
  assertThat(Arrays.toString((Object[])((Map<String,Object>)arrayValue[1]).get("String_Node_Str")),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testInsertNestedObjectLiteral() throws Exception {
  InsertFromValuesAnalysis analysis=(InsertFromValuesAnalysis)analyze("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertThat(analysis.sourceMaps().size(),is(1));
  Object[] arrayValue=(Object[])analysis.sourceMaps().get(0).get("String_Node_Str");
  assertThat(arrayValue.length,is(2));
  assertThat(arrayValue[0],instanceOf(Map.class));
  assertThat((String)((Map<String,Object>)arrayValue[0]).get("String_Node_Str"),is("String_Node_Str"));
  assertThat((String)((Map<String,Object>)arrayValue[1]).get("String_Node_Str"),is("String_Node_Str"));
  assertThat(Arrays.toString((Object[])((Map<String,Object>)arrayValue[0]).get("String_Node_Str")),is("String_Node_Str"));
  assertThat(Arrays.toString((Object[])((Map<String,Object>)arrayValue[1]).get("String_Node_Str")),is("String_Node_Str"));
}
Program: 13245
Project: 13245
Buggy source:
@Override public void apply(ImmutableSettings.Builder settingsBuilder,Object[] parameters,Expression expression){
  Preconditions.checkArgument(!(expression instanceof ArrayLiteral),String.format("String_Node_Str",NUMBER_OF_REPLICAS));
  Object refreshIntervalValue=ExpressionToObjectVisitor.convert(expression,parameters);
  try {
    Long refreshInterval=ExpressionToNumberVisitor.convert(expression,parameters).longValue();
  }
 catch (  IllegalArgumentException e) {
    throw new IllegalArgumentException("String_Node_Str" + REFRESH_INTERVAL + "String_Node_Str",e);
  }
  settingsBuilder.put(REFRESH_INTERVAL,refreshIntervalValue.toString());
}

Fixed version (ground truth):
@Override public void apply(ImmutableSettings.Builder settingsBuilder,Object[] parameters,Expression expression){
  Preconditions.checkArgument(!(expression instanceof ArrayLiteral),String.format("String_Node_Str",NUMBER_OF_REPLICAS));
  Object refreshIntervalValue=ExpressionToObjectVisitor.convert(expression,parameters);
  try {
    ExpressionToNumberVisitor.convert(expression,parameters).longValue();
  }
 catch (  IllegalArgumentException e) {
    throw new IllegalArgumentException("String_Node_Str" + REFRESH_INTERVAL + "String_Node_Str",e);
  }
  settingsBuilder.put(REFRESH_INTERVAL,refreshIntervalValue.toString());
}
Program: 13246
Project: 13246
Buggy source:
private Iterator<RoutineInfo> customIterators(){
  try {
    Iterator<RoutineInfo> cAnalyzersIterator;
    Iterator<RoutineInfo> cCharFiltersIterator;
    Iterator<RoutineInfo> cTokenFiltersIterator;
    Iterator<RoutineInfo> cTokenizersIterator;
    cAnalyzersIterator=Iterators.transform(ftResolver.getCustomAnalyzers().entrySet().iterator(),new Function<Map.Entry<String,Settings>,RoutineInfo>(){
      @Nullable @Override public RoutineInfo apply(      @Nullable Map.Entry<String,Settings> input){
        return new RoutineInfo(input.getKey(),RoutineType.ANALYZER.getName());
      }
    }
);
    cCharFiltersIterator=Iterators.transform(ftResolver.getCustomCharFilters().entrySet().iterator(),new Function<Map.Entry<String,Settings>,RoutineInfo>(){
      @Nullable @Override public RoutineInfo apply(      @Nullable Map.Entry<String,Settings> input){
        return new RoutineInfo(input.getKey(),RoutineType.CHAR_FILTER.getName());
      }
    }
);
    cTokenFiltersIterator=Iterators.transform(ftResolver.getCustomTokenFilters().entrySet().iterator(),new Function<Map.Entry<String,Settings>,RoutineInfo>(){
      @Nullable @Override public RoutineInfo apply(      @Nullable Map.Entry<String,Settings> input){
        return new RoutineInfo(input.getKey(),RoutineType.TOKEN_FILTER.getName());
      }
    }
);
    cTokenizersIterator=Iterators.transform(ftResolver.getCustomTokenizers().entrySet().iterator(),new Function<Map.Entry<String,Settings>,RoutineInfo>(){
      @Nullable @Override public RoutineInfo apply(      @Nullable Map.Entry<String,Settings> input){
        return new RoutineInfo(input.getKey(),RoutineType.TOKENIZER.getName());
      }
    }
);
    return Iterators.concat(cAnalyzersIterator,cCharFiltersIterator,cTokenFiltersIterator,cTokenizersIterator);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
private Iterator<RoutineInfo> customIterators(){
}
Program: 13247
Project: 13247
Buggy source:
@Nullable @Override public RoutineInfo apply(@Nullable Map.Entry<String,Settings> input){
  return new RoutineInfo(input.getKey(),RoutineType.TOKENIZER.getName());
}

Fixed version (ground truth):
@Nullable @Override public RoutineInfo apply(@Nullable String input){
  return new RoutineInfo(input,RoutineType.TOKENIZER.getName());
}
Program: 13248
Project: 13248
Buggy source:
public RoutineInfos(Functions functions,FulltextAnalyzerResolver ftResolver){
  this.functions=functions;
  this.ftResolver=ftResolver;
}

Fixed version (ground truth):
public RoutineInfos(FulltextAnalyzerResolver ftResolver){
  this.ftResolver=ftResolver;
}
Program: 13249
Project: 13249
Buggy source:
@Inject protected InformationSchemaCollectService(Functions functions,ReferenceInfos referenceInfos,FulltextAnalyzerResolver ftResolver){
  routineInfos=new RoutineInfos(functions,ftResolver);
  this.docInputSymbolVisitor=new CollectInputSymbolVisitor<>(functions,InformationDocLevelReferenceResolver.INSTANCE);
  tablesIterable=FluentIterable.from(referenceInfos).transformAndConcat(new Function<SchemaInfo,Iterable<TableInfo>>(){
    @Nullable @Override public Iterable<TableInfo> apply(    @Nullable SchemaInfo input){
      return FluentIterable.from(input).filter(new Predicate<TableInfo>(){
        @Override public boolean apply(        @Nullable TableInfo input){
          return !PartitionName.isPartition(input.ident().name());
        }
      }
);
    }
  }
);
  tablePartitionsIterable=FluentIterable.from(new TablePartitionInfos(tablesIterable));
  columnsIterable=FluentIterable.from(tablesIterable).transformAndConcat(new Function<TableInfo,Iterable<ColumnContext>>(){
    @Nullable @Override public Iterable<ColumnContext> apply(    @Nullable TableInfo input){
      return new ColumnsIterator(input);
    }
  }
);
  tableConstraintsIterable=FluentIterable.from(tablesIterable).filter(new Predicate<TableInfo>(){
    @Override public boolean apply(    @Nullable TableInfo input){
      return input != null && input.primaryKey().size() > 0;
    }
  }
);
  routinesIterable=FluentIterable.from(routineInfos).filter(new Predicate<RoutineInfo>(){
    @Override public boolean apply(    @Nullable RoutineInfo input){
      return input != null;
    }
  }
);
  this.iterables=ImmutableMap.of("String_Node_Str",tablesIterable,"String_Node_Str",columnsIterable,"String_Node_Str",tableConstraintsIterable,"String_Node_Str",tablePartitionsIterable,"String_Node_Str",routinesIterable);
}

Fixed version (ground truth):
@Inject protected InformationSchemaCollectService(Functions functions,ReferenceInfos referenceInfos,FulltextAnalyzerResolver ftResolver){
}
Program: 13250
Project: 13250
Buggy source:
/** 
 * get bucket number by doing modulo hashcode of first row-element
 */
@Override protected int getBucket(@Nullable Object[] row){
  if (row == null || row.length == 0 || row[0] == null) {
    return 0;
  }
 else {
    return Math.abs(row[0].hashCode()) % this.numBuckets;
  }
}

Fixed version (ground truth):
/** 
 * get bucket number by doing modulo hashcode of first row-element
 */
@Override protected int getBucket(@Nullable Object[] row){
  if (row == null || row.length == 0 || row[0] == null) {
    return 0;
  }
 else {
    int hash=row[0].hashCode();
    if (hash == Integer.MIN_VALUE) {
      hash=0;
    }
    return Math.abs(hash) % numBuckets;
  }
}
Program: 13251
Project: 13251
Buggy source:
@Override public boolean apply(URI input){
  return Math.abs(input.hashCode()) % numReaders == readerNumber;
}

Fixed version (ground truth):
@Override public boolean apply(URI input){
  int hash=input.hashCode();
  if (hash == Integer.MIN_VALUE) {
    hash=0;
  }
  return Math.abs(hash) % numReaders == readerNumber;
}
Program: 13252
Project: 13252
Buggy source:
private Predicate<URI> generateUriPredicate(FileInput fileInput){
  Predicate<URI> moduloPredicate;
  boolean sharedStorage=Objects.firstNonNull(shared,fileInput.sharedStorageDefault());
  if (sharedStorage) {
    moduloPredicate=new Predicate<URI>(){
      @Override public boolean apply(      URI input){
        return Math.abs(input.hashCode()) % numReaders == readerNumber;
      }
    }
;
  }
 else {
    moduloPredicate=MATCH_ALL_PREDICATE;
  }
  if (globPredicate != null) {
    return Predicates.and(moduloPredicate,globPredicate);
  }
  return moduloPredicate;
}

Fixed version (ground truth):
private Predicate<URI> generateUriPredicate(FileInput fileInput){
  Predicate<URI> moduloPredicate;
  boolean sharedStorage=Objects.firstNonNull(shared,fileInput.sharedStorageDefault());
  if (sharedStorage) {
    moduloPredicate=new Predicate<URI>(){
      @Override public boolean apply(      URI input){
        int hash=input.hashCode();
        if (hash == Integer.MIN_VALUE) {
          hash=0;
        }
        return Math.abs(hash) % numReaders == readerNumber;
      }
    }
;
  }
 else {
    moduloPredicate=MATCH_ALL_PREDICATE;
  }
  if (globPredicate != null) {
    return Predicates.and(moduloPredicate,globPredicate);
  }
  return moduloPredicate;
}
Program: 13253
Project: 13253
Buggy source:
@Override public void upstreamFinished(){
  if (remainingUpstreams.decrementAndGet() <= 0) {
    rows=grouper.finish();
  }
}

Fixed version (ground truth):
@Override public void upstreamFinished(){
  if (remainingUpstreams.decrementAndGet() <= 0) {
    grouper.finish();
  }
}
Program: 13254
Project: 13254
Buggy source:
@Override public boolean equals(Object obj){
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  IndexWriterProjection that=(IndexWriterProjection)o;
  if (!bulkActions.equals(that.bulkActions))   return false;
  if (!clusteredBySymbol.equals(that.clusteredBySymbol))   return false;
  if (!concurrency.equals(that.concurrency))   return false;
  if (!Arrays.equals(excludes,that.excludes))   return false;
  if (!idSymbols.equals(that.idSymbols))   return false;
  if (!Arrays.equals(includes,that.includes))   return false;
  if (!partitionedBySymbols.equals(that.partitionedBySymbols))   return false;
  if (!primaryKeys.equals(that.primaryKeys))   return false;
  if (!rawSourceSymbol.equals(that.rawSourceSymbol))   return false;
  if (!tableName.equals(that.tableName))   return false;
  return true;
}
Program: 13255
Project: 13255
Buggy source:
private void updateDigest(ByteBuffer bbf){
  if (md == null) {
    try {
      md=MessageDigest.getInstance("String_Node_Str");
    }
 catch (    NoSuchAlgorithmException e) {
      e.printStackTrace();
    }
  }
  md.update(bbf.slice());
}

Fixed version (ground truth):
private void updateDigest(ByteBuffer bbf) throws IOException {
  if (md == null) {
    try {
      md=MessageDigest.getInstance("String_Node_Str");
    }
 catch (    NoSuchAlgorithmException e) {
      throw new IOException(e);
    }
  }
  md.update(bbf.slice());
}
Program: 13256
Project: 13256
Buggy source:
@Override public void run(){
  try {
    FileInputStream inputStream=new FileInputStream(pendingFile);
    int bufSize=4096;
    int bytesRead;
    int size;
    int maxFileGrowthWait=5;
    int fileGrowthWaited=0;
    byte[] buffer=new byte[bufSize];
    long remainingBytes=bytesToSend;
    while (remainingBytes > 0) {
      size=(int)Math.min(bufSize,remainingBytes);
      bytesRead=inputStream.read(buffer,0,size);
      if (bytesRead < size) {
        waitUntilFileHasGrown(pendingFile);
        fileGrowthWaited++;
        if (fileGrowthWaited == maxFileGrowthWait) {
          throw new HeadChunkFileTooSmallException(pendingFile.getAbsolutePath());
        }
        if (bytesRead < 1) {
          continue;
        }
      }
      remainingBytes-=bytesRead;
      transportService.submitRequest(recipientNode,BlobHeadRequestHandler.Actions.PUT_BLOB_HEAD_CHUNK,new PutBlobHeadChunkRequest(transferId,new BytesArray(buffer,0,bytesRead)),TransportRequestOptions.options(),EmptyTransportResponseHandler.INSTANCE_SAME).txGet();
    }
  }
 catch (  FileNotFoundException ex) {
    logger.error("String_Node_Str",ex);
  }
catch (  IOException ex) {
    logger.error("String_Node_Str",ex);
  }
 finally {
    blobTransferTarget.putHeadChunkTransferFinished(transferId);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    try (FileInputStream inputStream=new FileInputStream(pendingFile)){
      int bufSize=4096;
      int bytesRead;
      int size;
      int maxFileGrowthWait=5;
      int fileGrowthWaited=0;
      byte[] buffer=new byte[bufSize];
      long remainingBytes=bytesToSend;
      while (remainingBytes > 0) {
        size=(int)Math.min(bufSize,remainingBytes);
        bytesRead=inputStream.read(buffer,0,size);
        if (bytesRead < size) {
          waitUntilFileHasGrown(pendingFile);
          fileGrowthWaited++;
          if (fileGrowthWaited == maxFileGrowthWait) {
            throw new HeadChunkFileTooSmallException(pendingFile.getAbsolutePath());
          }
          if (bytesRead < 1) {
            continue;
          }
        }
        remainingBytes-=bytesRead;
        transportService.submitRequest(recipientNode,BlobHeadRequestHandler.Actions.PUT_BLOB_HEAD_CHUNK,new PutBlobHeadChunkRequest(transferId,new BytesArray(buffer,0,bytesRead)),TransportRequestOptions.options(),EmptyTransportResponseHandler.INSTANCE_SAME).txGet();
      }
    }
   }
 catch (  FileNotFoundException ex) {
    logger.error("String_Node_Str",ex);
  }
catch (  IOException ex) {
    logger.error("String_Node_Str",ex);
  }
 finally {
    blobTransferTarget.putHeadChunkTransferFinished(transferId);
  }
}
Program: 13260
Project: 13260
Buggy source:
@Nullable private String encodeIdent(){
  if (values.size() == 0) {
    return null;
  }
  BytesStreamOutput out=new BytesStreamOutput();
  try {
    out.writeVInt(values.size());
    for (    String value : values) {
      DataType.STRING.streamer().writeTo(out,value == null ? value : new BytesRef(value));
    }
    out.close();
  }
 catch (  IOException e) {
  }
  String identBase32=new Base32(true).encodeAsString(out.bytes().toBytes()).toLowerCase(Locale.ROOT);
  return paddingPattern.matcher(identBase32).replaceAll("String_Node_Str");
}

Fixed version (ground truth):
@Nullable private String encodeIdent(){
  if (values.size() == 0) {
    return null;
  }
  BytesStreamOutput out=new BytesStreamOutput();
  try {
    out.writeVInt(values.size());
    for (    String value : values) {
      DataType.STRING.streamer().writeTo(out,value == null ? value : new BytesRef(value));
    }
    out.close();
  }
 catch (  IOException e) {
  }
  String identBase32=BASE32.encodeAsString(out.bytes().toBytes()).toLowerCase(Locale.ROOT);
  return PADDING_PATTERN.matcher(identBase32).replaceAll("String_Node_Str");
}