{"record":{"id":"94c04ef665a0c816","repo":"eclipse-vertx/vert.x","slug":"protocolversion-must-not-be-null","errorCode":null,"errorMessage":"protocolVersion must not be null","messagePattern":"protocolVersion must not be null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpClientOptions.java","lineNumber":759,"sourceCode":"\n  /**\n   * Get the protocol version.\n   *\n   * @return the protocol version\n   */\n  public HttpVersion getProtocolVersion() {\n    return protocolVersion;\n  }\n\n  /**\n   * Set the protocol version.\n   *\n   * @param protocolVersion the protocol version\n   * @return a reference to this, so the API can be used fluently\n   */\n  public HttpClientOptions setProtocolVersion(HttpVersion protocolVersion) {\n    if (protocolVersion == null) {\n      throw new IllegalArgumentException(\"protocolVersion must not be null\");\n    }\n    this.protocolVersion = protocolVersion;\n    return this;\n  }\n\n  /**\n   * Set the maximum HTTP chunk size\n   * @param maxChunkSize the maximum chunk size\n   * @return a reference to this, so the API can be used fluently\n   */\n  public HttpClientOptions setMaxChunkSize(int maxChunkSize) {\n    http1Config.setMaxChunkSize(maxChunkSize);\n    return this;\n  }\n\n  /**\n   * Returns the maximum HTTP chunk size\n   * @return the maximum HTTP chunk size","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpClientOptions.java#L741-L777","documentation":"Null guard in HttpClientOptions.setProtocolVersion: the HttpVersion argument is null. The client needs a concrete default version (HTTP_1_1, HTTP_2, H2C, HTTP_3) to build requests, so a null value is rejected immediately rather than silently defaulted.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpClientOptions.java:759 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null HttpVersion (HTTP_1_1 is the conventional default)","Treat null in external configuration as 'unset' and skip calling the setter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}