nus-yam/ex-repair huggingface dataset:
Program: 54467
Project: 54467
Buggy source:
public static <T>CompletableFuture<T> toCompletableFuture(final ListenableFuture<T> listenableFuture){
  CompletableFuture<T> completable=new CompletableFuture<T>(){
    @Override public boolean cancel(    boolean mayInterruptIfRunning){
      boolean result=listenableFuture.cancel(mayInterruptIfRunning);
      super.cancel(mayInterruptIfRunning);
      return result;
    }
  }
;
  Futures.addCallback(listenableFuture,new FutureCallback<T>(){
    @Override public void onSuccess(    T result){
      completable.complete(result);
    }
    @Override public void onFailure(    Throwable t){
      completable.completeExceptionally(t);
    }
  }
);
  return completable;
}

Fixed version (ground truth):
public static <T>CompletableFuture<T> toCompletableFuture(final ListenableFuture<T> listenableFuture){
  CompletableFuture<T> completable=new CompletableFuture<T>(){
    @Override public boolean cancel(    boolean mayInterruptIfRunning){
      boolean result=listenableFuture.cancel(mayInterruptIfRunning);
      super.cancel(mayInterruptIfRunning);
      return result;
    }
  }
;
  Futures.addCallback(listenableFuture,new FutureCallback<T>(){
    @Override @SuppressFBWarnings("String_Node_Str") public void onSuccess(    T result){
      completable.complete(result);
    }
    @Override public void onFailure(    Throwable t){
      completable.completeExceptionally(t);
    }
  }
);
  return completable;
}
Program: 54468
Project: 54468
Buggy source:
@Override public void onSuccess(T result){
  completable.complete(result);
}

Fixed version (ground truth):
@Override @SuppressFBWarnings("String_Node_Str") public void onSuccess(T result){
  completable.complete(result);
}
Program: 54469
Project: 54469
Buggy source:
protected void executeSupervisorDecision(SupervisorDecision decision){
  getLogger().debug("String_Node_Str",decision);
switch (decision) {
case STOP:
{
      this.stopAsync();
    }
}
}

Fixed version (ground truth):
protected void executeSupervisorDecision(SupervisorDecision decision){
  getLogger().debug("String_Node_Str",decision);
switch (decision) {
case STOP:
{
      this.stopAsync();
      break;
    }
case IGNORE:
default :
}
}
Program: 54470
Project: 54470
Buggy source:
public ReplSetHeartbeatReply getReply(){
  return reply;
}

Fixed version (ground truth):
@Nullable public ReplSetHeartbeatReply getReply(){
  return reply;
}
Program: 54471
Project: 54471
Buggy source:
@Override protected void startUp() throws Exception {
  boolean finished=false;
  LOGGER.debug("String_Node_Str");
  heartbeatHandler.startAsync();
  heartbeatHandler.awaitRunning();
  boolean topologyReady;
  int attempts=0;
  do {
    topologyReady=calculateTopologyReady();
    if (!topologyReady) {
      LOGGER.debug("String_Node_Str");
      Thread.sleep(1000);
    }
    attempts++;
  }
 while (!topologyReady || attempts >= 30);
  if (!topologyReady) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + attempts + "String_Node_Str");
  }
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  LOGGER.debug("String_Node_Str");
  heartbeatHandler.startAsync();
  heartbeatHandler.awaitRunning();
  boolean topologyReady;
  int attempts=0;
  do {
    topologyReady=calculateTopologyReady();
    if (!topologyReady) {
      LOGGER.debug("String_Node_Str");
      Thread.sleep(1000);
    }
    attempts++;
  }
 while (!topologyReady && attempts < 30);
  if (!topologyReady) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + attempts + "String_Node_Str");
  }
  LOGGER.info("String_Node_Str");
}
Program: 54472
Project: 54472
Buggy source:
private void readCollectionObject(JsonParser jp,ObjectNode collection,Map<String,List<IndexFilter>> collections) throws JsonProcessingException, JsonMappingException {
  Iterator<Entry<String,JsonNode>> collectionEntriesIterator=collection.fields();
  while (collectionEntriesIterator.hasNext()) {
    List<IndexFilter> indexFilters=new ArrayList<>();
    Map.Entry<String,JsonNode> collectionEntry=collectionEntriesIterator.next();
    try {
      if (collectionEntry.getValue() instanceof ObjectNode) {
        readIndexFilter(jp,collectionEntry.getValue(),indexFilters);
      }
 else       if (collectionEntry.getValue() instanceof ArrayNode) {
        Iterator<JsonNode> indexFiltersIterator=collectionEntry.getValue().elements();
        int position=0;
        while (indexFiltersIterator.hasNext()) {
          try {
            JsonNode indexFilter=indexFiltersIterator.next();
            if (indexFilter instanceof ObjectNode) {
              readIndexFilter(jp,indexFilter,indexFilters);
            }
 else {
              throw new JsonMappingException("String_Node_Str",jp.getCurrentLocation());
            }
            position++;
          }
 catch (          Exception e) {
            throw JsonMappingException.wrapWithPath(e,indexFilters,position);
          }
        }
      }
      collections.put(collectionEntry.getKey(),indexFilters);
    }
 catch (    Exception e) {
      throw JsonMappingException.wrapWithPath(e,collections,collectionEntry.getKey());
    }
  }
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") private void readCollectionObject(JsonParser jp,ObjectNode collection,Map<String,List<IndexFilter>> collections) throws JsonProcessingException, JsonMappingException {
  Iterator<Entry<String,JsonNode>> collectionEntriesIterator=collection.fields();
  while (collectionEntriesIterator.hasNext()) {
    List<IndexFilter> indexFilters=new ArrayList<>();
    Map.Entry<String,JsonNode> collectionEntry=collectionEntriesIterator.next();
    try {
      if (collectionEntry.getValue() instanceof ObjectNode) {
        readIndexFilter(jp,collectionEntry.getValue(),indexFilters);
      }
 else       if (collectionEntry.getValue() instanceof ArrayNode) {
        Iterator<JsonNode> indexFiltersIterator=collectionEntry.getValue().elements();
        int position=0;
        while (indexFiltersIterator.hasNext()) {
          try {
            JsonNode indexFilter=indexFiltersIterator.next();
            if (indexFilter instanceof ObjectNode) {
              readIndexFilter(jp,indexFilter,indexFilters);
            }
 else {
              throw new JsonMappingException("String_Node_Str",jp.getCurrentLocation());
            }
            position++;
          }
 catch (          Exception e) {
            throw JsonMappingException.wrapWithPath(e,indexFilters,position);
          }
        }
      }
      collections.put(collectionEntry.getKey(),indexFilters);
    }
 catch (    Exception e) {
      throw JsonMappingException.wrapWithPath(e,collections,collectionEntry.getKey());
    }
  }
}
Program: 54474
Project: 54474
Buggy source:
protected List<Tuple2<MetaIndex,List<String>>> getMissingIndexesForNewField(Stream<? extends MetaIndex> containedMetaIndexes,MutableMetaDocPart docPart,MetaField newField){
  return containedMetaIndexes.filter(index -> index.getMetaIndexFieldByTableRefAndName(docPart.getTableRef(),newField.getName()) != null).flatMap(index -> Seq.seq(index.iteratorMetaDocPartIndexesIdentifiers(docPart)).filter(identifiers -> identifiers.contains(newField.getIdentifier())).map(identifiers -> new Tuple2<MetaIndex,List<String>>(index,identifiers))).collect(Collectors.toList());
}

Fixed version (ground truth):
protected List<Tuple2<MetaIndex,List<String>>> getMissingIndexesForNewField(Stream<? extends MetaIndex> containedMetaIndexes,MutableMetaDocPart docPart,MetaField newField){
  return containedMetaIndexes.filter(index -> index.getMetaIndexFieldByTableRefAndName(docPart.getTableRef(),newField.getName()) != null).flatMap(index -> Seq.seq(index.iteratorMetaDocPartIndexesIdentifiers(docPart)).filter(identifiers -> identifiers.contains(newField.getIdentifier())).map(identifiers -> new Tuple2<MetaIndex,List<String>>(index,identifiers))).collect(Collectors.groupingBy(missingIndexEntry -> missingIndexEntry.v2())).entrySet().stream().map(groupedMissingIndexEntries -> groupedMissingIndexEntries.getValue().get(0)).collect(Collectors.toList());
}
Program: 54475
Project: 54475
Buggy source:
/** 
 * @param newMillisFunction the first argument is the millis that it has wait on the lastiteration (or 0 for the first) and the second the attempts. The result is the number of millis that will wait or a negative number if it should give up.
 * @param delegate          the exception handler on which delegate when giving up.
 */
public IncrementalWaitExceptionHandler(IntBinaryOperator newMillisFunction,ExceptionHandler<Result,T> delegate){
  super(delegate);
  this.newMillisFunction=newMillisFunction;
  this.currentMillis=0;
}

Fixed version (ground truth):
/** 
 * @param newMillisFunction the first argument is the millis that it has wait on the lastiteration (or 0 for the first) and the second the attempts. The result is the number of millis that will wait or a negative number if it should give up.
 * @param delegate          the exception handler on which delegate when giving up.
 */
public IncrementalWaitExceptionHandler(IntBinaryOperator newMillisFunction,ExceptionHandler<Result,T> delegate){
  super(delegate);
  this.newMillisFunction=newMillisFunction;
  this.currentMillis=1;
}
Program: 54476
Project: 54476
Buggy source:
@Override protected void configure(){
  bind(TableRefFactory.class).to(TableRefFactoryImpl.class).asEagerSingleton();
  int maxCriticalAttempts=100;
  int maxInfrequentAttempts=5;
  int maxFrequentAttempts=100;
  int maxDefaultAttempts=10;
  bind(Retrier.class).toInstance(new SmartRetrier(attempts -> attempts >= maxCriticalAttempts,attempts -> attempts >= maxInfrequentAttempts,attempts -> attempts >= maxFrequentAttempts,attempts -> attempts >= maxDefaultAttempts));
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(TableRefFactory.class).to(TableRefFactoryImpl.class).asEagerSingleton();
  int maxCriticalAttempts=100;
  int maxInfrequentAttempts=5;
  int maxFrequentAttempts=100;
  int maxDefaultAttempts=10;
  bind(Retrier.class).toInstance(new SmartRetrier(attempts -> attempts >= maxCriticalAttempts,attempts -> attempts >= maxInfrequentAttempts,attempts -> attempts >= maxFrequentAttempts,attempts -> attempts >= maxDefaultAttempts,CoreModule::millisToWait));
}
Program: 54477
Project: 54477
Buggy source:
public SmartRetrier(IntPredicate criticalGiveUpPredicate,IntPredicate infrequentGiveUpPredicate,IntPredicate frequentGiveUpPredicate,IntPredicate defaultGiveUpPredicate){
  this.infrequentGiveUpPredicate=infrequentGiveUpPredicate;
  this.frequentGiveUpPredicate=frequentGiveUpPredicate;
  this.defaultGiveUpPredicate=defaultGiveUpPredicate;
  this.criticalGiveUpPredicate=criticalGiveUpPredicate;
}

Fixed version (ground truth):
public SmartRetrier(IntPredicate criticalGiveUpPredicate,IntPredicate infrequentGiveUpPredicate,IntPredicate frequentGiveUpPredicate,IntPredicate defaultGiveUpPredicate,MillisToWaitFunction millisToWaitFunction){
  this.infrequentGiveUpPredicate=infrequentGiveUpPredicate;
  this.frequentGiveUpPredicate=frequentGiveUpPredicate;
  this.defaultGiveUpPredicate=defaultGiveUpPredicate;
  this.criticalGiveUpPredicate=criticalGiveUpPredicate;
  this.millisToWaitFunction=millisToWaitFunction;
}
Program: 54478
Project: 54478
Buggy source:
private <Result,T extends Exception>ExceptionHandler<Result,T> createWithTimeHandler(IntPredicate giveUpPredicate,ExceptionHandler<Result,T> delegateHandler){
  return new IncrementalWaitExceptionHandler<>((attepts,millis) -> getMillisToWait(attepts,millis,giveUpPredicate),delegateHandler);
}

Fixed version (ground truth):
private <Result,T extends Exception>ExceptionHandler<Result,T> createWithTimeHandler(IntPredicate giveUpPredicate,ExceptionHandler<Result,T> delegateHandler){
  return new IncrementalWaitExceptionHandler<>((millis,attempts) -> getMillisToWait(attempts,millis,giveUpPredicate),delegateHandler);
}
Program: 54480
Project: 54480
Buggy source:
private Flow<BsonDocument,Pair<Integer,Integer>,NotUsed> createCloneDocsWorker(MongodServer localServer,String toDb,String collection){
  return Flow.of(BsonDocument.class).grouped(insertBufferSize).map(docs -> {
    return new Pair<>(insertDocuments(localServer,toDb,collection,docs),docs.size());
  }
);
}

Fixed version (ground truth):
private Flow<BsonDocument,Pair<Integer,Integer>,NotUsed> createCloneDocsWorker(MongodServer localServer,String toDb,String collection){
  return Flow.of(BsonDocument.class).grouped(commitHeuristic.getDocumentsPerCommit()).map(docs -> retrier.retry(() -> new Tuple3<>(clock.instant(),insertDocuments(localServer,toDb,collection,docs),docs.size()),Hint.FREQUENT_ROLLBACK,Hint.TIME_SENSIBLE)).map(tuple -> {
    commitHeuristic.notifyDocumentInsertionCommit(tuple.t2(),clock.millis() - tuple.t1().toEpochMilli());
    return new Pair<>(tuple.t2(),tuple.t3());
  }
);
}
Program: 54481
Project: 54481
Buggy source:
private int insertDocuments(MongodServer localServer,String toDb,String collection,List<BsonDocument> docsToInsert){
}

Fixed version (ground truth):
private int insertDocuments(MongodServer localServer,String toDb,String collection,List<BsonDocument> docsToInsert) throws RollbackException {
  try (WriteMongodTransaction transaction=createWriteMongodTransaction(localServer)){
    Status<InsertResult> insertResult=transaction.execute(new Request(toDb,null,true,null),InsertCommand.INSTANCE,new InsertArgument.Builder(collection).addDocuments(docsToInsert).setWriteConcern(WriteConcern.fsync()).setOrdered(true).build());
    if (!insertResult.isOk()) {
      throw new CloningException("String_Node_Str");
    }
    int insertedDocs=insertResult.getResult().getN();
    if (insertedDocs != docsToInsert.size()) {
      throw new CloningException("String_Node_Str" + docsToInsert.size() + "String_Node_Str"+ insertResult+ "String_Node_Str");
    }
    transaction.commit();
    return insertedDocs;
  }
 catch (  UserException ex) {
    throw new CloningException("String_Node_Str",ex);
  }
}
Program: 54483
Project: 54483
Buggy source:
@Override public ExecutorService createExecutorService(String prefix,boolean blockerTasks,int maxThreads){
  ExecutorService executorService;
  if (blockerTasks) {
    ThreadFactory threadFactory=blockerThreadFactoryFunction.apply(prefix);
    ThreadPoolExecutor threadPoolExecutor=new ThreadPoolExecutor(maxThreads,maxThreads,10L,TimeUnit.MINUTES,new LinkedBlockingQueue<>(),threadFactory);
    threadPoolExecutor.allowCoreThreadTimeOut(true);
    executorService=threadPoolExecutor;
  }
 else {
    ForkJoinWorkerThreadFactory threadFactory=forkJoinThreadFactoryFunction.apply(prefix);
    executorService=new ForkJoinPool(maxThreads,threadFactory,null,true);
  }
  shutdownHelper.terminateOnShutdown(executorService);
  return executorService;
}

Fixed version (ground truth):
@Override @SuppressFBWarnings(value={"String_Node_Str"},justification="String_Node_Str") public ExecutorService createExecutorService(String prefix,boolean blockerTasks,int maxThreads){
  ExecutorService executorService;
  if (blockerTasks) {
    ThreadFactory threadFactory=blockerThreadFactoryFunction.apply(prefix);
    ThreadPoolExecutor threadPoolExecutor=new ThreadPoolExecutor(maxThreads,maxThreads,10L,TimeUnit.MINUTES,new LinkedBlockingQueue<>(),threadFactory);
    threadPoolExecutor.allowCoreThreadTimeOut(true);
    executorService=threadPoolExecutor;
  }
 else {
    ForkJoinWorkerThreadFactory threadFactory=forkJoinThreadFactoryFunction.apply(prefix);
    executorService=new ForkJoinPool(maxThreads,threadFactory,null,true);
  }
  shutdownHelper.terminateOnShutdown(executorService);
  return executorService;
}
Program: 54484
Project: 54484
Buggy source:
public void setMemberState(MemberState memberState){
  this.memberState=memberState;
  if (memberState != null) {
    metrics.getMemberState().setValue(memberState.name());
    metrics.getMemberStateCounters()[memberState.ordinal()].inc();
  }
 else {
    metrics.getMemberState().setValue(null);
  }
}

Fixed version (ground truth):
public void setMemberState(MemberState memberState){
  this.memberState=memberState;
  if (memberState != null) {
    metrics.getMemberState().setValue(memberState.name());
    metrics.getMemberStateCounters().get(memberState).inc();
  }
 else {
    metrics.getMemberState().setValue(null);
  }
}
Program: 54485
Project: 54485
Buggy source:
public Counter[] getMemberStateCounters(){
  return memberStateCounters;
}

Fixed version (ground truth):
public ImmutableMap<MemberState,Counter> getMemberStateCounters(){
  return memberStateCounters;
}
Program: 54486
Project: 54486
Buggy source:
@Inject public ReplMetrics(ToroMetricRegistry registry){
  memberState=registry.gauge(factory.createMetricName("String_Node_Str"));
  memberStateCounters=new Counter[MemberState.values().length];
  for (  MemberState memberState : MemberState.values()) {
    memberStateCounters[memberState.ordinal()]=registry.counter(factory.createMetricName(memberState.name().substring(3).toLowerCase(Locale.US) + "String_Node_Str"));
  }
  lastOpTimeFetched=registry.gauge(factory.createMetricName("String_Node_Str"));
  lastOpTimeApplied=registry.gauge(factory.createMetricName("String_Node_Str"));
}

Fixed version (ground truth):
@Inject public ReplMetrics(ToroMetricRegistry registry){
  memberState=registry.gauge(factory.createMetricName("String_Node_Str"));
  ImmutableMap.Builder<MemberState,Counter> memberStateCountersBuilder=ImmutableMap.builder();
  for (  MemberState memberState : MemberState.values()) {
    memberStateCountersBuilder.put(memberState,registry.counter(factory.createMetricName(memberState.name().substring(3).toLowerCase(Locale.US) + "String_Node_Str")));
  }
  memberStateCounters=Maps.immutableEnumMap(memberStateCountersBuilder.build());
  lastOpTimeFetched=registry.gauge(factory.createMetricName("String_Node_Str"));
  lastOpTimeApplied=registry.gauge(factory.createMetricName("String_Node_Str"));
}
Program: 54487
Project: 54487
Buggy source:
@Override public void awaitUntilUnpaused() throws InterruptedException {
  mutex.lock();
  try {
    fetcherIsPaused=true;
    fetcherPausedCond.signalAll();
    fetcherCanContinueCond.await();
  }
  finally {
    mutex.unlock();
  }
}

Fixed version (ground truth):
@Override @SuppressFBWarnings(value={"String_Node_Str"},justification="String_Node_Str") public void awaitUntilUnpaused() throws InterruptedException {
  mutex.lock();
  try {
    fetcherIsPaused=true;
    fetcherPausedCond.signalAll();
    fetcherCanContinueCond.await();
  }
  finally {
    mutex.unlock();
  }
}
Program: 54488
Project: 54488
Buggy source:
private void updateState(List<OplogOperation> fetchedOps,long fetchTime){
  int fetchedOpsSize=fetchedOps.size();
  previousBatchSize=fetchedOpsSize;
  previousBatchTime=fetchTime;
  if (fetchedOpsSize == 0) {
    return;
  }
  opsReadCounter+=fetchedOpsSize;
  OplogOperation lastOp=fetchedOps.get(fetchedOpsSize - 1);
  lastFetchedHash=lastOp.getHash();
  lastFetchedOpTime=lastOp.getOpTime();
  metrics.getLastOpTimeFetched().setValue(state.lastFetchedOpTime.toString());
}

Fixed version (ground truth):
private void updateState(List<OplogOperation> fetchedOps,long fetchTime){
  int fetchedOpsSize=fetchedOps.size();
  if (fetchedOpsSize == 0) {
    return;
  }
  OplogOperation lastOp=fetchedOps.get(fetchedOpsSize - 1);
  lastFetchedHash=lastOp.getHash();
  lastFetchedOpTime=lastOp.getOpTime();
  metrics.getLastOpTimeFetched().setValue(state.lastFetchedOpTime.toString());
}
Program: 54489
Project: 54489
Buggy source:
private void checkRollback(OplogReader reader,@Nullable OplogOperation firstCursorOp) throws StopReplicationException, RollbackReplicationException {
}

Fixed version (ground truth):
private void checkRollback(OplogReader reader,@Nullable OplogOperation firstCursorOp) throws StopReplicationException, RollbackReplicationException {
  if (firstCursorOp == null) {
    try {
      OplogOperation lastOp=reader.getLastOp();
      if (lastOp.getOpTime().compareTo(state.lastFetchedOpTime) < 0) {
        throw new RollbackReplicationException("String_Node_Str");
      }
    }
 catch (    OplogStartMissingException ex) {
      throw new StopReplicationException("String_Node_Str");
    }
catch (    OplogOperationUnsupported ex) {
      throw new StopReplicationException("String_Node_Str",ex);
    }
catch (    MongoException ex) {
      throw new StopReplicationException("String_Node_Str" + "String_Node_Str",ex);
    }
  }
 else {
    if (firstCursorOp.getHash() != state.lastFetchedHash || !firstCursorOp.getOpTime().equals(state.lastFetchedOpTime)) {
      throw new RollbackReplicationException("String_Node_Str" + state.lastFetchedOpTime + "String_Node_Str"+ state.lastFetchedHash+ "String_Node_Str"+ firstCursorOp.getOpTime()+ "String_Node_Str"+ firstCursorOp.getHash()+ "String_Node_Str");
    }
  }
}
Program: 54490
Project: 54490
Buggy source:
@Override public ForkJoinWorkerThreadFactory apply(String prefix){
  return new ForkJoinWorkerThreadFactory(){
    private volatile int idProvider=0;
    @Override public ForkJoinWorkerThread newThread(    ForkJoinPool pool){
      ForkJoinWorkerThread newThread=ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
      int id=idProvider++;
      newThread.setName(prefix + '-' + id);
      return newThread;
    }
  }
;
}

Fixed version (ground truth):
@Override public ForkJoinWorkerThreadFactory apply(String prefix){
  return new CustomForkJoinThreadFactory(prefix);
}
Program: 54491
Project: 54491
Buggy source:
@Override protected void configure(){
  bind(Integer.class).annotatedWith(ParallelLevel.class).toInstance(Runtime.getRuntime().availableProcessors());
  ThreadFactory threadFactory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ThreadFactory.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(ToroDbIdleService.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(ToroDbRunnableService.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(MongoWP.class).toInstance(threadFactory);
  bind(ForkJoinWorkerThreadFactory.class).toInstance(ForkJoinPool.defaultForkJoinWorkerThreadFactory);
  bind(DefaultConcurrentToolsFactory.BlockerThreadFactoryFunction.class).toInstance(new BlockerThreadFactoryFunction(){
    @Override public ThreadFactory apply(    String prefix){
      return new ThreadFactoryBuilder().setNameFormat(prefix + "String_Node_Str").build();
    }
  }
);
  bind(DefaultConcurrentToolsFactory.ForkJoinThreadFactoryFunction.class).toInstance(new ForkJoinThreadFactoryFunction(){
    @Override public ForkJoinWorkerThreadFactory apply(    String prefix){
      return new ForkJoinWorkerThreadFactory(){
        private volatile int idProvider=0;
        @Override public ForkJoinWorkerThread newThread(        ForkJoinPool pool){
          ForkJoinWorkerThread newThread=ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
          int id=idProvider++;
          newThread.setName(prefix + '-' + id);
          return newThread;
        }
      }
;
    }
  }
);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(Integer.class).annotatedWith(ParallelLevel.class).toInstance(Runtime.getRuntime().availableProcessors());
  ThreadFactory threadFactory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ThreadFactory.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(ToroDbIdleService.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(ToroDbRunnableService.class).toInstance(threadFactory);
  bind(ThreadFactory.class).annotatedWith(MongoWP.class).toInstance(threadFactory);
  bind(ForkJoinWorkerThreadFactory.class).toInstance(ForkJoinPool.defaultForkJoinWorkerThreadFactory);
  bind(DefaultConcurrentToolsFactory.BlockerThreadFactoryFunction.class).toInstance(new CustomBlockerThreadFactoryFunction());
  bind(DefaultConcurrentToolsFactory.ForkJoinThreadFactoryFunction.class).toInstance(new CustomForkJoinThreadFactoryFunction());
}
Program: 54492
Project: 54492
Buggy source:
public static KeyStore getKeyStore(SSL ssl) throws FileNotFoundException, KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
  InputStream is=new FileInputStream(ssl.getKeyStoreFile());
  char[] storePassword=null;
  if (ssl.getKeyStorePassword() != null) {
    storePassword=ssl.getKeyStorePassword().toCharArray();
  }
  KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
  ks.load(is,storePassword);
  return ks;
}

Fixed version (ground truth):
public static KeyStore getKeyStore(SSL ssl) throws FileNotFoundException, KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
  try (InputStream is=new FileInputStream(ssl.getKeyStoreFile())){
    char[] storePassword=null;
    if (ssl.getKeyStorePassword() != null) {
      storePassword=ssl.getKeyStorePassword().toCharArray();
    }
    KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
    ks.load(is,storePassword);
    return ks;
  }
 }
Program: 54493
Project: 54493
Buggy source:
public static IllegalArgumentException transformJsonMappingException(JsonMappingException jsonMappingException){
  JsonPointer jsonPointer=JsonPointer.compile("String_Node_Str");
  for (  Reference reference : jsonMappingException.getPath()) {
    jsonPointer=jsonPointer.append(JsonPointer.compile("String_Node_Str" + reference.getFieldName()));
  }
  if (LOGGER.isDebugEnabled()) {
    return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage(),jsonMappingException);
  }
  return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage());
}

Fixed version (ground truth):
public static IllegalArgumentException transformJsonMappingException(JsonMappingException jsonMappingException){
  JsonPointer jsonPointer=JsonPointer.compile("String_Node_Str");
  for (  Reference reference : jsonMappingException.getPath()) {
    if (reference.getIndex() != -1) {
      jsonPointer=jsonPointer.append(JsonPointer.compile("String_Node_Str" + reference.getIndex()));
    }
    if (reference.getFieldName() != null) {
      jsonPointer=jsonPointer.append(JsonPointer.compile("String_Node_Str" + reference.getFieldName()));
    }
  }
  if (LOGGER.isDebugEnabled()) {
    return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage(),jsonMappingException);
  }
  return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage());
}
Program: 54494
Project: 54494
Buggy source:
public static JsonPointer toJsonPointer(Path path){
  JsonPointer pointer=JsonPointer.valueOf(null);
  for (  Path.Node pathNode : path) {
    if (pathNode.getIndex() != null) {
      pointer=pointer.append(JsonPointer.valueOf("String_Node_Str" + pathNode.getIndex()));
    }
 else     if (pathNode.getName() != null) {
      pointer=pointer.append(JsonPointer.valueOf("String_Node_Str" + pathNode.getName()));
    }
  }
  return pointer;
}

Fixed version (ground truth):
public static JsonPointer toJsonPointer(Path path){
  JsonPointer pointer=JsonPointer.valueOf(null);
  for (  Path.Node pathNode : path) {
    if (pathNode.getIndex() != null) {
      pointer=pointer.append(JsonPointer.valueOf("String_Node_Str" + pathNode.getIndex()));
    }
    if (pathNode.getName() != null) {
      pointer=pointer.append(JsonPointer.valueOf("String_Node_Str" + pathNode.getName()));
    }
  }
  return pointer;
}
Program: 54495
Project: 54495
Buggy source:
/** 
 * Creates a flow that batches and analyze a input of   {@link AnalyzedOplogBatch remote jobs}. This flow tries to accummulate several remote jobs into a bigger one and does not emit until: <ul> <li>A maximum number of operations are batched</li> <li>Or a maximum time has happen since the last emit</li> <li>Or the recived job is not   {@link AnalyzedOplogBatch#isReadyForMore()}</li> </ul>
 * @return
 */
private Flow<OplogBatch,AnalyzedStreamElement,NotUsed> createBatcherFlow(ApplierContext context){
  Predicate<OplogBatch> finishBatchPredicate=(  OplogBatch rawBatch) -> !rawBatch.isReadyForMore();
  Supplier<RawStreamElement> zeroFun=() -> RawStreamElement.INITIAL_ELEMENT;
  BiFunction<RawStreamElement,OplogBatch,RawStreamElement> acumFun=(streamElem,newBatch) -> streamElem.concat(newBatch);
  BatchAnalyzer batchAnalyzer=batchAnalyzerFactory.createBatchAnalyzer(context);
  return Flow.of(OplogBatch.class).via(new BatchFlow<>(batchLimits.maxSize,batchLimits.maxPeriod,finishBatchPredicate,zeroFun,acumFun)).filter(rawElem -> rawElem.rawBatch != null && !rawElem.rawBatch.isEmpty()).map(rawElem -> {
    List<OplogOperation> rawOps=rawElem.rawBatch.getOps();
    List<AnalyzedOplogBatch> analyzed=batchAnalyzer.apply(rawOps);
    return new AnalyzedStreamElement(rawElem,analyzed);
  }
);
}

Fixed version (ground truth):
/** 
 * Creates a flow that batches and analyze a input of   {@link AnalyzedOplogBatch remote jobs}. This flow tries to accummulate several remote jobs into a bigger one and does not emit until: <ul> <li>A maximum number of operations are batched</li> <li>Or a maximum time has happen since the last emit</li> <li>Or the recived job is not   {@link AnalyzedOplogBatch#isReadyForMore()}</li> </ul>
 * @return
 */
private Flow<OplogBatch,AnalyzedStreamElement,NotUsed> createBatcherFlow(ApplierContext context){
  Predicate<OplogBatch> finishBatchPredicate=(  OplogBatch rawBatch) -> !rawBatch.isReadyForMore();
  ToIntFunction<OplogBatch> costFunction=(rawBatch) -> rawBatch.count();
  Supplier<RawStreamElement> zeroFun=() -> RawStreamElement.INITIAL_ELEMENT;
  BiFunction<RawStreamElement,OplogBatch,RawStreamElement> acumFun=(streamElem,newBatch) -> streamElem.concat(newBatch);
  BatchAnalyzer batchAnalyzer=batchAnalyzerFactory.createBatchAnalyzer(context);
  return Flow.of(OplogBatch.class).via(new BatchFlow<>(batchLimits.maxSize,batchLimits.maxPeriod,finishBatchPredicate,costFunction,zeroFun,acumFun)).filter(rawElem -> rawElem.rawBatch != null && !rawElem.rawBatch.isEmpty()).map(rawElem -> {
    List<OplogOperation> rawOps=rawElem.rawBatch.getOps();
    List<AnalyzedOplogBatch> analyzed=batchAnalyzer.apply(rawOps);
    return new AnalyzedStreamElement(rawElem,analyzed);
  }
);
}
Program: 54496
Project: 54496
Buggy source:
public BatchFlow(int maxBatchSize,FiniteDuration period,Predicate<E> predicate,Supplier<A> zero,BiFunction<A,E,A> aggregate){
  this.maxBatchSize=maxBatchSize;
  this.period=period;
  this.predicate=predicate;
  this.zero=zero;
  this.aggregate=aggregate;
}

Fixed version (ground truth):
public BatchFlow(int maxBatchSize,FiniteDuration period,Predicate<E> predicate,ToIntFunction<E> costFunction,Supplier<A> zero,BiFunction<A,E,A> aggregate){
  this.maxBatchSize=maxBatchSize;
  this.period=period;
  this.predicate=predicate;
  this.costFunction=costFunction;
  this.zero=zero;
  this.aggregate=aggregate;
}
Program: 54497
Project: 54497
Buggy source:
private Status<CreateIndexesResult> insertIndex(BsonDocument indexDoc,String database,WriteMongodTransaction trans){
  try {
    CreateIndexesCommand command=CreateIndexesCommand.INSTANCE;
    CreateIndexesArgument arg=command.unmarshallArg(indexDoc);
    CreateIndexesResult result=executeCommand(database,command,arg,trans);
    return Status.ok(result);
  }
 catch (  MongoException ex) {
    return Status.from(ex);
  }
}

Fixed version (ground truth):
private Status<CreateIndexesResult> insertIndex(BsonDocument indexDoc,String database,WriteMongodTransaction trans){
  try {
    CreateIndexesCommand command=CreateIndexesCommand.INSTANCE;
    CreateIndexesArgument arg=command.unmarshallArg(indexDoc);
    return executeCommand(database,command,arg,trans);
  }
 catch (  MongoException ex) {
    return Status.from(ex);
  }
}
Program: 54498
Project: 54498
Buggy source:
private void applyUpdate(UpdateOplogOperation op,WriteMongodTransaction trans,ApplierContext applierContext) throws OplogApplyingException {
  boolean upsert=op.isUpsert() || applierContext.treatUpdateAsUpsert();
  UpdateResult result;
  try {
    result=executeCommand(op.getDatabase(),UpdateCommand.INSTANCE,new UpdateArgument(op.getCollection(),Collections.singletonList(new UpdateStatement(op.getFilter(),op.getModification(),upsert,true)),true,WriteConcern.fsync()),trans);
  }
 catch (  MongoException ex) {
    throw new OplogApplyingException(ex);
  }
  if (!result.isOk()) {
    throw new OplogApplyingException(new MongoException(result.getErrorMessage(),ErrorCode.UNKNOWN_ERROR));
  }
  if (!upsert && result.getModifiedCounter() != 0) {
    LOGGER.info("String_Node_Str" + "String_Node_Str",op.getOpTime(),op.getHash(),op.getFilter());
  }
  if (upsert && !result.getUpserts().isEmpty()) {
    LOGGER.warn("String_Node_Str" + op);
  }
}

Fixed version (ground truth):
private void applyUpdate(UpdateOplogOperation op,WriteMongodTransaction trans,ApplierContext applierContext) throws OplogApplyingException {
}
Program: 54499
Project: 54499
Buggy source:
private <Arg,Result>Result executeCommand(String db,Command<? super Arg,? super Result> command,Arg arg,WriteMongodTransaction trans) throws MongoException {
  Request req=new Request(db,null,true,null);
  Status<Result> result=trans.execute(req,command,arg);
  if (result == null) {
    throw new ConflictingOperationInProgressException("String_Node_Str" + command.getCommandName() + "String_Node_Str");
  }
  return result.getResult();
}

Fixed version (ground truth):
private <Arg,Result>Status<Result> executeCommand(String db,Command<? super Arg,? super Result> command,Arg arg,WriteMongodTransaction trans) throws MongoException {
  Request req=new Request(db,null,true,null);
  Status<Result> result=trans.execute(req,command,arg);
  if (result == null) {
    throw new ConflictingOperationInProgressException("String_Node_Str" + command.getCommandName() + "String_Node_Str");
  }
  return result;
}
Program: 54500
Project: 54500
Buggy source:
private void applyDelete(DeleteOplogOperation op,WriteMongodTransaction trans,ApplierContext applierContext) throws OplogApplyingException {
  try {
    Long result=executeCommand(op.getDatabase(),DeleteCommand.INSTANCE,new DeleteArgument(op.getCollection(),Collections.singletonList(new DeleteStatement(op.getFilter(),op.isJustOne())),true,WriteConcern.fsync()),trans);
    if (result == 0 && applierContext.treatUpdateAsUpsert()) {
      LOGGER.info("String_Node_Str" + "String_Node_Str",op.getOpTime(),op.getHash(),op.getFilter());
    }
  }
 catch (  MongoException ex) {
    throw new OplogApplyingException(ex);
  }
}

Fixed version (ground truth):
private void applyDelete(DeleteOplogOperation op,WriteMongodTransaction trans,ApplierContext applierContext) throws OplogApplyingException {
  try {
    Status<Long> status=executeCommand(op.getDatabase(),DeleteCommand.INSTANCE,new DeleteArgument(op.getCollection(),Collections.singletonList(new DeleteStatement(op.getFilter(),op.isJustOne())),true,WriteConcern.fsync()),trans);
    if (!status.isOK()) {
      throw new OplogApplyingException(new MongoException(status));
    }
    if (status.getResult() == 0 && applierContext.treatUpdateAsUpsert()) {
      LOGGER.info("String_Node_Str" + "String_Node_Str",op.getOpTime(),op.getHash(),op.getFilter());
    }
  }
 catch (  MongoException ex) {
    throw new OplogApplyingException(ex);
  }
}
Program: 54501
Project: 54501
Buggy source:
private OplogFetcher createOplogFetcher(Stream<OplogOperation> opsStream){
  return new LimitedOplogFetcher(new IteratorMongoCursor<>("String_Node_Str","String_Node_Str",1,false,HostAndPort.fromParts("String_Node_Str",27017),opsStream.iterator()));
}

Fixed version (ground truth):
private OplogFetcher createOplogFetcher(Stream<OplogOperation> opsStream){
  return new LimitedOplogFetcher(new IteratorMongoCursor<>("String_Node_Str","String_Node_Str",1,HostAndPort.fromParts("String_Node_Str",27017),opsStream.iterator()));
}
Program: 54502
Project: 54502
Buggy source:
@Inject public AkkaDbClonerProvider(ToroDbExecutorService executor,@ParallelLevel int parallelLevel,@DocsPerTransaction int docsPerTransaction,CommitHeuristic commitHeuristic,Clock clock){
  this.executor=executor;
  this.parallelLevel=parallelLevel;
  this.commitHeuristic=commitHeuristic;
  this.clock=clock;
  this.docsPerTransaction=docsPerTransaction;
}

Fixed version (ground truth):
/** 
 * @param executor
 * @param streamExecutor
 * @param parallelLevel
 * @param docsPerTransaction
 * @param commitHeuristic
 * @param clock
 * @param retrier
 */
@Inject public AkkaDbClonerProvider(ToroDbExecutorService executor,StreamExecutor streamExecutor,@ParallelLevel int parallelLevel,@DocsPerTransaction int docsPerTransaction,CommitHeuristic commitHeuristic,Clock clock,Retrier retrier){
  this.executor=executor;
  this.streamExecutor=streamExecutor;
  this.parallelLevel=parallelLevel;
  this.commitHeuristic=commitHeuristic;
  this.clock=clock;
  this.docsPerTransaction=docsPerTransaction;
  this.retrier=retrier;
}
Program: 54503
Project: 54503
Buggy source:
@Override public AkkaDbCloner get(){
  LOGGER.info("String_Node_Str",parallelLevel,docsPerTransaction);
  return new AkkaDbCloner(executor,parallelLevel - 1,parallelLevel * docsPerTransaction,docsPerTransaction,commitHeuristic,clock);
}

Fixed version (ground truth):
@Override public AkkaDbCloner get(){
  LOGGER.info("String_Node_Str",parallelLevel,docsPerTransaction);
  return new AkkaDbCloner(executor,parallelLevel - 1,streamExecutor,parallelLevel * docsPerTransaction,docsPerTransaction,commitHeuristic,clock,retrier);
}
Program: 54505
Project: 54505
Buggy source:
public static IllegalArgumentException transformJsonMappingException(JsonMappingException jsonMappingException){
  JsonPointer jsonPointer=JsonPointer.compile("String_Node_Str");
  for (  Reference reference : jsonMappingException.getPath()) {
    jsonPointer=jsonPointer.append(JsonPointer.compile("String_Node_Str" + reference.getFieldName()));
  }
  return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage());
}

Fixed version (ground truth):
public static IllegalArgumentException transformJsonMappingException(JsonMappingException jsonMappingException){
  JsonPointer jsonPointer=JsonPointer.compile("String_Node_Str");
  for (  Reference reference : jsonMappingException.getPath()) {
    jsonPointer=jsonPointer.append(JsonPointer.compile("String_Node_Str" + reference.getFieldName()));
  }
  if (LOGGER.isDebugEnabled()) {
    return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage(),jsonMappingException);
  }
  return new IllegalArgumentException("String_Node_Str" + jsonPointer + "String_Node_Str"+ jsonMappingException.getMessage());
}
Program: 54506
Project: 54506
Buggy source:
@Override public AkkaDbCloner get(){
  LOGGER.info("String_Node_Str",parallelLevel,docsPerTransaction);
  return new AkkaDbCloner(executor,parallelLevel - 1,streamExecutor,parallelLevel * docsPerTransaction,docsPerTransaction,commitHeuristic,clock,retrier);
}

Fixed version (ground truth):
@Override public AkkaDbCloner get(){
  LOGGER.info("String_Node_Str",parallelLevel,docsPerTransaction);
  return new AkkaDbCloner(executor,Math.max(1,parallelLevel - 1),streamExecutor,parallelLevel * docsPerTransaction,docsPerTransaction,commitHeuristic,clock,retrier);
}
Program: 54507
Project: 54507
Buggy source:
public PostgreSQLErrorHandler(){
  super(rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str",CREATE_SCHEMA,CREATE_TABLE,ADD_COLUMN,CREATE_INDEX,DROP_SCHEMA,DROP_TABLE,DROP_INDEX));
}

Fixed version (ground truth):
public PostgreSQLErrorHandler(){
  super(rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str"),rule("String_Node_Str",CREATE_SCHEMA,CREATE_TABLE,ADD_COLUMN,CREATE_INDEX,DROP_SCHEMA,DROP_TABLE,DROP_INDEX,META_INSERT));
}
Program: 54508
Project: 54508
Buggy source:
@Override public WriteBackendTransaction openWriteTransaction(){
  Preconditions.checkState(!closed,"String_Node_Str");
  Preconditions.checkState(currentTransaction == null,"String_Node_Str" + currentTransaction);
  WriteBackendTransactionImpl transaction=new WriteBackendTransactionImpl(sqlInterface,this,r2dTranslator,identifierFactory);
  currentTransaction=transaction;
  return transaction;
}

Fixed version (ground truth):
@Override public WriteBackendTransaction openWriteTransaction(){
  Preconditions.checkState(!closed,"String_Node_Str");
  Preconditions.checkState(currentTransaction == null,"String_Node_Str" + currentTransaction);
  WriteBackendTransactionImpl transaction=new WriteBackendTransactionImpl(sqlInterface,this,r2dTranslator,identifierFactory,ridGenerator);
  currentTransaction=transaction;
  return transaction;
}
Program: 54509
Project: 54509
Buggy source:
public BackendConnectionImpl(BackendImpl backend,SqlInterface sqlInterface,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory){
  this.backend=backend;
  this.sqlInterface=sqlInterface;
  this.r2dTranslator=r2dTranslator;
  this.identifierFactory=identifierFactory;
}

Fixed version (ground truth):
public BackendConnectionImpl(BackendImpl backend,SqlInterface sqlInterface,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory,RidGenerator ridGenerator){
  this.backend=backend;
  this.sqlInterface=sqlInterface;
  this.r2dTranslator=r2dTranslator;
  this.identifierFactory=identifierFactory;
  this.ridGenerator=ridGenerator;
}
Program: 54510
Project: 54510
Buggy source:
@Override public BackendConnection openConnection(){
  return new BackendConnectionImpl(this,sqlInterface,r2dTranslator,identifierFactory);
}

Fixed version (ground truth):
@Override public BackendConnection openConnection(){
  return new BackendConnectionImpl(this,sqlInterface,r2dTranslator,identifierFactory,ridGenerator);
}
Program: 54511
Project: 54511
Buggy source:
@Inject public BackendImpl(DbBackendService dbBackendService,SqlInterface sqlInterface,SqlHelper sqlHelper,SchemaUpdater schemaUpdater,MetainfoRepository metainfoRepository,TableRefFactory tableRefFactory,MaxRowIdFactory maxRowIdFactory,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory){
  this.dbBackendService=dbBackendService;
  this.sqlInterface=sqlInterface;
  this.sqlHelper=sqlHelper;
  this.schemaUpdater=schemaUpdater;
  this.metainfoRepository=metainfoRepository;
  this.tableRefFactory=tableRefFactory;
  this.maxRowIdFactory=maxRowIdFactory;
  this.r2dTranslator=r2dTranslator;
  this.identifierFactory=identifierFactory;
}

Fixed version (ground truth):
@Inject public BackendImpl(DbBackendService dbBackendService,SqlInterface sqlInterface,SqlHelper sqlHelper,SchemaUpdater schemaUpdater,MetainfoRepository metainfoRepository,TableRefFactory tableRefFactory,MaxRowIdFactory maxRowIdFactory,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory,RidGenerator ridGenerator){
  this.dbBackendService=dbBackendService;
  this.sqlInterface=sqlInterface;
  this.sqlHelper=sqlHelper;
  this.schemaUpdater=schemaUpdater;
  this.metainfoRepository=metainfoRepository;
  this.tableRefFactory=tableRefFactory;
  this.maxRowIdFactory=maxRowIdFactory;
  this.r2dTranslator=r2dTranslator;
  this.identifierFactory=identifierFactory;
  this.ridGenerator=ridGenerator;
}
Program: 54512
Project: 54512
Buggy source:
@Override public void renameCollection(MetaDatabase fromDb,MetaCollection fromColl,MutableMetaDatabase toDb,MutableMetaCollection toColl){
  Preconditions.checkState(!isClosed(),"String_Node_Str");
  copyMetaCollection(fromColl,toDb,toColl);
  getSqlInterface().getStructureInterface().renameCollection(getDsl(),fromDb.getIdentifier(),fromColl,toDb.getIdentifier(),toColl);
  dropMetaCollection(fromDb.getName(),fromColl);
}

Fixed version (ground truth):
@Override public void renameCollection(MetaDatabase fromDb,MetaCollection fromColl,MutableMetaDatabase toDb,MutableMetaCollection toColl){
  Preconditions.checkState(!isClosed(),"String_Node_Str");
  copyMetaCollection(fromDb,fromColl,toDb,toColl);
  getSqlInterface().getStructureInterface().renameCollection(getDsl(),fromDb.getIdentifier(),fromColl,toDb.getIdentifier(),toColl);
  dropMetaCollection(fromDb.getName(),fromColl);
}
Program: 54513
Project: 54513
Buggy source:
public WriteBackendTransactionImpl(SqlInterface sqlInterface,BackendConnectionImpl backendConnection,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory){
  super(sqlInterface.getDbBackend().createWriteConnection(),sqlInterface,backendConnection,r2dTranslator);
  this.identifierFactory=identifierFactory;
}

Fixed version (ground truth):
public WriteBackendTransactionImpl(SqlInterface sqlInterface,BackendConnectionImpl backendConnection,R2DTranslator r2dTranslator,IdentifierFactory identifierFactory,RidGenerator ridGenerator){
  super(sqlInterface.getDbBackend().createWriteConnection(),sqlInterface,backendConnection,r2dTranslator);
  this.identifierFactory=identifierFactory;
  this.ridGenerator=ridGenerator;
}
Program: 54514
Project: 54514
Buggy source:
private void copyMetaCollection(MetaCollection fromColl,MutableMetaDatabase toDb,MutableMetaCollection toColl){
  Iterator<? extends MetaDocPart> fromMetaDocPartIterator=fromColl.streamContainedMetaDocParts().iterator();
  while (fromMetaDocPartIterator.hasNext()) {
    MetaDocPart fromMetaDocPart=fromMetaDocPartIterator.next();
    MutableMetaDocPart toMetaDocPart=toColl.addMetaDocPart(fromMetaDocPart.getTableRef(),identifierFactory.toDocPartIdentifier(toDb,toColl.getName(),fromMetaDocPart.getTableRef()));
    getSqlInterface().getMetaDataWriteInterface().addMetaDocPart(getDsl(),toDb.getName(),toColl.getName(),toMetaDocPart.getTableRef(),toMetaDocPart.getIdentifier());
    copyScalar(identifierFactory,fromMetaDocPart,toDb,toColl,toMetaDocPart);
    copyFields(identifierFactory,fromMetaDocPart,toDb,toColl,toMetaDocPart);
  }
}

Fixed version (ground truth):
private void copyMetaCollection(MetaDatabase fromDb,MetaCollection fromColl,MutableMetaDatabase toDb,MutableMetaCollection toColl){
  Iterator<? extends MetaDocPart> fromMetaDocPartIterator=fromColl.streamContainedMetaDocParts().iterator();
  while (fromMetaDocPartIterator.hasNext()) {
    MetaDocPart fromMetaDocPart=fromMetaDocPartIterator.next();
    MutableMetaDocPart toMetaDocPart=toColl.addMetaDocPart(fromMetaDocPart.getTableRef(),identifierFactory.toDocPartIdentifier(toDb,toColl.getName(),fromMetaDocPart.getTableRef()));
    getSqlInterface().getMetaDataWriteInterface().addMetaDocPart(getDsl(),toDb.getName(),toColl.getName(),toMetaDocPart.getTableRef(),toMetaDocPart.getIdentifier());
    copyScalar(identifierFactory,fromMetaDocPart,toDb,toColl,toMetaDocPart);
    copyFields(identifierFactory,fromMetaDocPart,toDb,toColl,toMetaDocPart);
    int nextRid=ridGenerator.getDocPartRidGenerator(fromDb.getName(),fromColl.getName()).nextRid(fromMetaDocPart.getTableRef());
    ridGenerator.getDocPartRidGenerator(toDb.getName(),toColl.getName()).setNextRid(toMetaDocPart.getTableRef(),nextRid - 1);
  }
}
Program: 54515
Project: 54515
Buggy source:
protected void executeSql(DSLContext dsl,String resourcePath,SqlHelper sqlHelper) throws IOException, SQLException {
  InputStream resourceAsStream=getClass().getClassLoader().getResourceAsStream(resourcePath);
  if (resourceAsStream == null) {
    throw new SystemException("String_Node_Str" + resourcePath + "String_Node_Str");
  }
  try {
    String statementAsString=CharStreams.toString(new BufferedReader(new InputStreamReader(resourceAsStream,Charset.forName("String_Node_Str"))));
    sqlHelper.executeStatement(dsl,statementAsString,Context.UNKNOWN);
  }
  finally {
    resourceAsStream.close();
  }
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") protected void executeSql(DSLContext dsl,String resourcePath,SqlHelper sqlHelper) throws IOException, SQLException {
  InputStream resourceAsStream=getClass().getResourceAsStream(resourcePath);
  if (resourceAsStream == null) {
    throw new SystemException("String_Node_Str" + resourcePath + "String_Node_Str");
  }
  try {
    String statementAsString=CharStreams.toString(new BufferedReader(new InputStreamReader(resourceAsStream,Charset.forName("String_Node_Str"))));
    sqlHelper.executeStatement(dsl,statementAsString,Context.UNKNOWN);
  }
  finally {
    resourceAsStream.close();
  }
}