{"record":{"id":"fc1346d1ab676539","repo":"quarkusio/quarkus","slug":"platform-platformkey-does-not-include-any-strea","errorCode":null,"errorMessage":"Platform ${platformKey} does not include any stream","messagePattern":"Platform (.+?) does not include any stream","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/catalog/Platform.java","lineNumber":26,"sourceCode":"import io.quarkus.registry.json.JsonBuilder;\n\npublic interface Platform {\n\n    String getPlatformKey();\n\n    String getName();\n\n    Collection<PlatformStream> getStreams();\n\n    Map<String, Object> getMetadata();\n\n    PlatformStream getStream(String id);\n\n    @JsonIgnore\n    default PlatformStream getRecommendedStream() {\n        final Collection<PlatformStream> streams = getStreams();\n        if (streams.isEmpty()) {\n            throw new RuntimeException(\"Platform \" + getPlatformKey() + \" does not include any stream\");\n        }\n        return streams.iterator().next();\n    }\n\n    default Mutable mutable() {\n        return new PlatformImpl.Builder(this);\n    }\n\n    interface Mutable extends Platform, JsonBuilder<Platform> {\n        Mutable setMetadata(Map<String, Object> metadata);\n\n        Mutable setPlatformKey(String platformKey);\n\n        Mutable setName(String name);\n\n        Mutable setStreams(Collection<PlatformStream> streams);\n\n        Mutable addStream(PlatformStream stream);","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/catalog/Platform.java#L8-L44","documentation":"Platform.getRecommendedStream() is a convenience that returns the first stream of the platform. If the platform's streams collection is empty there is nothing to recommend, so it throws RuntimeException identifying the platform key. It indicates an incomplete or degenerate platform catalog entry.","triggerScenarios":"Calling getRecommendedStream() on a Platform deserialized from a platform catalog JSON whose streams array is empty — e.g. a registry returning a platform entry with no published streams for the requested version.","commonSituations":"A newly created/partially published platform in a registry; an internal registry with a placeholder platform entry; filtered-out streams leaving an empty list after upstream filtering.","solutions":["Check streams.isEmpty()/getStreams() before calling getRecommendedStream() and pick a platform with streams.","Use a different platformKey whose catalog actually contains streams.","Fix the platform catalog JSON on the registry side to include at least one stream.","Guard with try-catch and fall back to a known-good platform."],"exampleFix":"// before\nPlatformStream s = platform.getRecommendedStream(); // throws if empty\n// after\nif (!platform.getStreams().isEmpty()) {\n    PlatformStream s = platform.getRecommendedStream();\n} else {\n    // pick another platform or skip\n}","handlingStrategy":"type-guard","validationCode":"// Java\nif (platform == null || platform.getStreams() == null || platform.getStreams().isEmpty()) {\n    // skip or choose another platform\n}","typeGuard":"// Java\nstatic Optional<PlatformStream> recommendedStreamOrNull(Platform p) {\n    return (p == null || p.getStreams().isEmpty())\n            ? Optional.empty()\n            : Optional.of(p.getStreams().iterator().next());\n}","tryCatchPattern":"// Java\ntry {\n    PlatformStream s = platform.getRecommendedStream();\n} catch (RuntimeException e) {\n    if (e.getMessage().endsWith(\"does not include any stream\")) {\n        // fall back to another platformKey\n    }\n    throw e;\n}","preventionTips":["Check getStreams().isEmpty() before getRecommendedStream() when catalogs may be partial.","Prefer explicit getStream(id) with a known stream id for critical tooling.","Validate platform catalog completeness when mirroring registries.","Skip platforms without streams instead of assuming one exists."],"tags":["catalog","platform","empty-collection"],"backgroundTag":"empty-platform-streams","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}