Program: 20245
Project: 20245
Buggy source:
@SuppressWarnings("String_Node_Str") public Result createSession(HttpClient client,Command command) throws IOException {
  Capabilities desired=(Capabilities)command.getParameters().get("String_Node_Str");
  desired=desired == null ? new ImmutableCapabilities() : desired;
  int threshold=(int)Math.min(Runtime.getRuntime().freeMemory() / 10,Integer.MAX_VALUE);
  FileBackedOutputStream os=new FileBackedOutputStream(threshold);
  try (CountingOutputStream counter=new CountingOutputStream(os);Writer writer=new OutputStreamWriter(counter,UTF_8);NewAppiumSessionPayload payload=NewAppiumSessionPayload.create(desired)){
    payload.writeTo(writer);
    try (InputStream rawIn=os.asByteSource().openBufferedStream();BufferedInputStream contentStream=new BufferedInputStream(rawIn)){
      Method createSessionMethod=this.getClass().getSuperclass().getDeclaredMethod("String_Node_Str",HttpClient.class,InputStream.class,long.class);
      createSessionMethod.setAccessible(true);
      Optional<Result> result=(Optional<Result>)createSessionMethod.invoke(this,client,contentStream,counter.getCount());
      if (result.isPresent()) {
        Result toReturn=result.get();
        System.out.print(format("String_Node_Str",toReturn.getDialect()));
        return toReturn;
      }
    }
 catch (    NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
      throw new WebDriverException(format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",HttpClient.class.getSimpleName(),InputStream.class.getSimpleName(),long.class.getSimpleName()),e);
    }
  }
  finally {
    os.reset();
  }
  throw new SessionNotCreatedException(format("String_Node_Str" + "String_Node_Str",desired));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Result createSession(HttpClient client,Command command) throws IOException {
  Capabilities desiredCapabilities=(Capabilities)command.getParameters().get("String_Node_Str");
  Capabilities desired=desiredCapabilities == null ? new ImmutableCapabilities() : desiredCapabilities;
  int threshold=(int)Math.min(Runtime.getRuntime().freeMemory() / 10,Integer.MAX_VALUE);
  FileBackedOutputStream os=new FileBackedOutputStream(threshold);
  try {
    CountingOutputStream counter=new CountingOutputStream(os);
    Writer writer=new OutputStreamWriter(counter,UTF_8);
    NewAppiumSessionPayload payload=NewAppiumSessionPayload.create(desired);
    payload.writeTo(writer);
    try (InputStream rawIn=os.asByteSource().openBufferedStream();BufferedInputStream contentStream=new BufferedInputStream(rawIn)){
      Method createSessionMethod=this.getClass().getSuperclass().getDeclaredMethod("String_Node_Str",HttpClient.class,InputStream.class,long.class);
      createSessionMethod.setAccessible(true);
      Optional<Result> result=(Optional<Result>)createSessionMethod.invoke(this,client,contentStream,counter.getCount());
      return result.map(result1 -> {
        Result toReturn=result.get();
        System.out.print(format("String_Node_Str",toReturn.getDialect()));
        return toReturn;
      }
).orElseThrow(() -> new SessionNotCreatedException(format("String_Node_Str",desired)));
    }
 catch (    NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
      throw new WebDriverException(format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",HttpClient.class.getSimpleName(),InputStream.class.getSimpleName(),long.class.getSimpleName()),e);
    }
  }
  finally {
    os.reset();
  }
}