{"record":{"id":"2a8bd252d4800aa4","repo":"quarkusio/quarkus","slug":"scheme-was-null","errorCode":null,"errorMessage":"Scheme was null","messagePattern":"Scheme 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/UriBuilderImpl.java","lineNumber":310,"sourceCode":"\n        if (uri.getRawPath() != null && uri.getRawPath().length() > 0) {\n            path = uri.getRawPath();\n        }\n        if (uri.getRawQuery() != null && uri.getRawQuery().length() > 0) {\n            query = uri.getRawQuery();\n        }\n\n        return this;\n    }\n\n    public UriBuilder scheme(String scheme) throws IllegalArgumentException {\n        this.scheme = scheme;\n        return this;\n    }\n\n    public UriBuilder schemeSpecificPart(String ssp) throws IllegalArgumentException {\n        if (ssp == null)\n            throw new IllegalArgumentException(\"Scheme was null\");\n\n        StringBuilder sb = new StringBuilder();\n        if (scheme != null)\n            sb.append(scheme).append(':');\n        if (ssp != null)\n            sb.append(ssp);\n        if (fragment != null && fragment.length() > 0)\n            sb.append('#').append(fragment);\n        URI uri = URI.create(sb.toString());\n\n        if (uri.getRawSchemeSpecificPart() != null && uri.getRawPath() == null) {\n            this.ssp = uri.getRawSchemeSpecificPart();\n        } else {\n            this.ssp = null;\n            userInfo = uri.getRawUserInfo();\n            host = uri.getHost();\n            port = uri.getPort();\n            path = uri.getRawPath();","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/UriBuilderImpl.java#L292-L328","documentation":"UriBuilderImpl.schemeSpecificPart(String ssp) throws 'Scheme was null' when the ssp argument itself is null. The message is misleading: it mentions the scheme but actually guards the scheme-specific-part parameter. The JAX-RS contract mandates IllegalArgumentException for null arguments; the method cannot parse null into authority/path/query/fragment components.","triggerScenarios":"Calling schemeSpecificPart(null) directly, or passing a String variable that was never initialized or that a lookup returned as null.","commonSituations":"Generated or reflective code calling schemeSpecificPart with an absent field; deserialized objects with null ssp; copy-paste of the uri(URI) null-check pattern where the guard was expected elsewhere.","solutions":["Do not pass null: check the string before calling or skip the call when null","Fail fast with Objects.requireNonNull(ssp, 'ssp') at your call site","If optional, skip: if (ssp != null) builder.schemeSpecificPart(ssp);","Remember the message text is misleading - validate the ssp argument, not the builder scheme"],"exampleFix":"// before: builder.schemeSpecificPart(ssp); // throws if ssp null // after: if (ssp != null) { builder.schemeSpecificPart(ssp); }","handlingStrategy":"type-guard","validationCode":"if (ssp == null) {\n    throw new IllegalArgumentException('scheme-specific part must not be null');\n}","typeGuard":"static boolean hasSsp(String ssp) {\n    return ssp != null && !ssp.isEmpty();\n}","tryCatchPattern":"try {\n    builder.schemeSpecificPart(ssp);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException('schemeSpecificPart argument was null (message text is misleading)', e);\n}","preventionTips":["Never pass null; skip the call or pass an empty string","Remember the message says Scheme was null but the ssp argument is the real problem","Guard generated/deserialized strings before passing them in"],"tags":["resteasy-reactive","jaxrs","uri","null-check","illegal-argument"],"backgroundTag":"null-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"}