{"record":{"id":"62b90b4d50a7366b","repo":"quarkusio/quarkus","slug":"param-was-null-62b90b","errorCode":null,"errorMessage":"param was null","messagePattern":"param was null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/LinkBuilderImpl.java","lineNumber":61,"sourceCode":"    public Link.Builder uri(URI uri) {\n        if (uri == null)\n            throw new IllegalArgumentException(\"URI was null\");\n        uriBuilder = UriBuilder.fromUri(uri);\n        return this;\n    }\n\n    @Override\n    public Link.Builder uri(String uri) throws IllegalArgumentException {\n        if (uri == null)\n            throw new IllegalArgumentException(\"URI was null\");\n        uriBuilder = UriBuilder.fromUri(uri);\n        return this;\n    }\n\n    @Override\n    public Link.Builder rel(String rel) {\n        if (rel == null)\n            throw new IllegalArgumentException(\"param was null\");\n        final String rels = this.map.get(Link.REL);\n        param(Link.REL, rels == null ? rel : rels + \" \" + rel);\n        return this;\n    }\n\n    @Override\n    public Link.Builder title(String title) {\n        if (title == null)\n            throw new IllegalArgumentException(\"param was null\");\n        param(Link.TITLE, title);\n        return this;\n\n    }\n\n    @Override\n    public Link.Builder type(String type) {\n        if (type == null)\n            throw new IllegalArgumentException(\"param was null\");","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/LinkBuilderImpl.java#L43-L79","documentation":"LinkBuilderImpl.rel() throws IllegalArgumentException when the rel parameter is null. Per JAX-RS, a link relation cannot be null, so the builder rejects it eagerly instead of producing an invalid Link.","triggerScenarios":"Calling Link.fromUri(...).rel(null) or a builder variable holding a null relation computed at runtime.","commonSituations":"Relation type read from config, a map, or an annotation attribute that was never populated; refactoring that made a constant nullable.","solutions":["Ensure the rel value is non-null before calling rel(); substitute a default like \"self\" if absent.","Check the source of the relation string (config/annotations/headers) for missing values.","Wrap in an explicit null check and skip rel() when absent."],"exampleFix":"// before\nLink link = Link.fromUri(uri).rel(unknownRel).build();\n// after\nLink.Builder b = Link.fromUri(uri);\nif (unknownRel != null) b.rel(unknownRel);\nLink link = b.build();","handlingStrategy":"validation","validationCode":"if (rel == null || rel.isBlank()) throw new IllegalArgumentException(\"rel must be non-null\");","typeGuard":"boolean isValidRel(String rel) { return rel != null && !rel.isBlank(); }","tryCatchPattern":"try { builder.rel(rel); } catch (IllegalArgumentException e) { log.warn(\"null rel\", e); }","preventionTips":["Null-check strings derived from config or maps before calling builder methods","Prefer typed rel constants over dynamic values","Use Objects.requireNonNullElse(rel, \"self\") defaults"],"tags":["jax-rs","null-argument","link-builder"],"backgroundTag":"null-argument-illegal-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}