{"record":{"id":"476da049f33aa0c3","repo":"eclipse-vertx/vert.x","slug":"no-null-value-accepted","errorCode":null,"errorMessage":"No null value accepted","messagePattern":"No null value accepted","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpSettings.java","lineNumber":53,"sourceCode":"  }\n\n  public abstract HttpSettings copy();\n\n  /**\n   * @return the HTTP version defining the settings (which defines the implicit schema).\n   */\n  abstract HttpVersion version();\n\n  /**\n   * Set the {@code setting } value with {@code <T>}.\n   *\n   * @param setting the setting\n   * @param value the java value\n   * @return a reference to this, so the API can be used fluently\n   */\n  public <T> HttpSettings set(HttpSetting<T> setting, T value) {\n    if (value == null) {\n      throw new NullPointerException(\"No null value accepted\");\n    }\n    return setLong(setting, setting.to.convert(value));\n  }\n\n  /**\n   * Get the {@code setting } value as {@code <T>}.\n   *\n   * @param setting the setting\n   * @return the value or {@code null} if the value is not present\n   */\n  public <T> T get(HttpSetting<T> setting) {\n    HttpVersion version = version();\n    if (!setting.versions.contains(version)) {\n      throw new IllegalArgumentException(\"Invalid setting\");\n    }\n    Long value = getLong(setting);\n    return value != null ? setting.from.convert(value) : null;\n  }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpSettings.java#L35-L71","documentation":"Null guard in HttpSettings.set: the typed setting value being written into the HTTP settings object is null. Settings carry concrete values, so nulls are rejected with this generic NullPointerException sentinel; the input at fault is the value passed for the given HttpSetting key.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpSettings.java:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null value for the setting","Remove the setting instead of setting it to null if the intent is to clear it"],"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-14T05:17:10.506Z"}