Program: 34289
Project: 34289
Buggy source:
/** 
 * Builds a   {@link Query} by parsing an array of arguments.
 * @param session QuerySession
 * @param arguments String[] Parameter:value list
 * @return {@link Query} Database query object
 */
public static CompletableFuture<Query> fromArguments(QuerySession session,@Nullable String[] arguments) throws ParameterException {
  checkNotNull(session);
  Query query=new Query();
  CompletableFuture<Query> future=new CompletableFuture<>();
  Map<String,String> definedParameters=new HashMap<>();
  if (arguments.length > 0) {
    List<CompletableFuture<?>> futures=new ArrayList<>();
    for (    String arg : arguments) {
      Optional<CompletableFuture<?>> listenable;
      if (flagPattern.matcher(arg).matches()) {
        listenable=parseFlagFromArgument(session,query,arg);
      }
 else {
        Pair<String,String> pair=getParameterKeyValue(arg);
        listenable=parseParameterFromArgument(session,query,pair);
        definedParameters.put(pair.getKey(),pair.getValue());
      }
      if (listenable.isPresent()) {
        futures.add(listenable.get());
      }
    }
    if (!futures.isEmpty()) {
      CompletableFuture<Void> combinedFuture=CompletableFuture.<Void>allOf(futures.toArray(new CompletableFuture[futures.size()]));
      combinedFuture.thenAccept((q) -> future.complete(query));
    }
 else {
      future.complete(query);
    }
  }
 else {
    future.complete(query);
  }
  if (Prism.getConfig().getNode("String_Node_Str","String_Node_Str").getBoolean()) {
    String defaultsUsed="String_Node_Str";
    for (    ParameterHandler handler : Prism.getParameterHandlers()) {
      boolean aliasFound=false;
      for (      String alias : handler.getAliases()) {
        if (definedParameters.containsKey(alias)) {
          aliasFound=true;
          break;
        }
      }
      if (!aliasFound) {
        Optional<Pair<String,String>> pair=handler.processDefault(session,query);
        if (pair.isPresent()) {
          defaultsUsed+=pair.get().getKey() + "String_Node_Str" + pair.get().getValue()+ "String_Node_Str";
        }
      }
    }
    if (!defaultsUsed.isEmpty()) {
      session.getCommandSource().get().sendMessage(Format.subduedHeading(Text.of(String.format("String_Node_Str",defaultsUsed))));
    }
  }
  return future;
}

Fixed version (ground truth):
/** 
 * Builds a   {@link Query} by parsing an array of arguments.
 * @param session QuerySession
 * @param arguments String[] Parameter:value list
 * @return {@link Query} Database query object
 */
public static CompletableFuture<Query> fromArguments(QuerySession session,@Nullable String[] arguments) throws ParameterException {
  checkNotNull(session);
  Query query=new Query();
  CompletableFuture<Query> future=new CompletableFuture<>();
  Map<String,String> definedParameters=new HashMap<>();
  if (arguments != null && arguments.length > 0) {
    List<CompletableFuture<?>> futures=new ArrayList<>();
    for (    String arg : arguments) {
      Optional<CompletableFuture<?>> listenable;
      if (flagPattern.matcher(arg).matches()) {
        listenable=parseFlagFromArgument(session,query,arg);
      }
 else {
        Pair<String,String> pair=getParameterKeyValue(arg);
        listenable=parseParameterFromArgument(session,query,pair);
        definedParameters.put(pair.getKey(),pair.getValue());
      }
      if (listenable.isPresent()) {
        futures.add(listenable.get());
      }
    }
    if (!futures.isEmpty()) {
      CompletableFuture<Void> combinedFuture=CompletableFuture.<Void>allOf(futures.toArray(new CompletableFuture<?>[futures.size()]));
      combinedFuture.thenAccept((q) -> future.complete(query));
    }
 else {
      future.complete(query);
    }
  }
 else {
    future.complete(query);
  }
  if (Prism.getConfig().getNode("String_Node_Str","String_Node_Str").getBoolean()) {
    String defaultsUsed="String_Node_Str";
    for (    ParameterHandler handler : Prism.getParameterHandlers()) {
      boolean aliasFound=false;
      for (      String alias : handler.getAliases()) {
        if (definedParameters.containsKey(alias)) {
          aliasFound=true;
          break;
        }
      }
      if (!aliasFound) {
        Optional<Pair<String,String>> pair=handler.processDefault(session,query);
        if (pair.isPresent()) {
          defaultsUsed+=pair.get().getKey() + "String_Node_Str" + pair.get().getValue()+ "String_Node_Str";
        }
      }
    }
    if (!defaultsUsed.isEmpty()) {
      session.getCommandSource().get().sendMessage(Format.subduedHeading(Text.of(String.format("String_Node_Str",defaultsUsed))));
    }
  }
  return future;
}