{"record":{"id":"d63ab2a690e26556","repo":"quarkusio/quarkus","slug":"failed-to-locate-c-in-s","errorCode":null,"errorMessage":"Failed to locate '${c}' in '${s}'","messagePattern":"Failed to locate '(.+?)' in '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PlatformImportsImpl.java","lineNumber":32,"sourceCode":"import java.util.Map;\nimport java.util.Properties;\n\nimport io.quarkus.bootstrap.BootstrapConstants;\nimport io.quarkus.bootstrap.resolver.AppModelResolverException;\nimport io.quarkus.maven.dependency.ArtifactCoords;\n\npublic class PlatformImportsImpl implements PlatformImports, Serializable {\n\n    private static final long serialVersionUID = -1722573527738064746L;\n    public static final String PROPERTY_PREFIX = \"platform.release-info@\";\n\n    public static final char PLATFORM_KEY_STREAM_SEPARATOR = '$';\n    public static final char STREAM_VERSION_SEPARATOR = '#';\n\n    private static int requiredIndex(String s, char c, int fromIndex) {\n        final int i = s.indexOf(c, fromIndex);\n        if (i < 0) {\n            throw new IllegalArgumentException(\"Failed to locate '\" + c + \"' in '\" + s + \"'\");\n        }\n        return i;\n    }\n\n    public static boolean isPlatformReleaseInfo(String s) {\n        return s != null && s.startsWith(PROPERTY_PREFIX);\n    }\n\n    // metadata for each found platform release by platform key\n    private final Map<String, PlatformInfo> allPlatformInfo = new HashMap<>();\n    // imported platform BOMs by platform keys (groupId)\n    private final Map<String, Collection<ArtifactCoords>> importedPlatformBoms = new HashMap<>();\n\n    private final Map<ArtifactCoords, PlatformImport> platformImports = new HashMap<>();\n\n    private final Map<String, String> collectedProps;\n    private final Collection<ArtifactCoords> platformBoms;\n    private final Collection<PlatformReleaseInfo> platformReleaseInfo;","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PlatformImportsImpl.java#L14-L50","documentation":"PlatformImportsImpl.requiredIndex() parses encoded platform property names that embed the platform key, stream, and version using '$' and '#' separators (e.g. for platform release info properties). If the expected separator character is not found from the given index, it throws an IllegalArgumentException. The property name therefore does not follow Quarkus' internal platform property naming convention.","triggerScenarios":"Passing a property name to addPlatformRelease/platform-key parsing that lacks the '$' (PLATFORM_KEY_STREAM_SEPARATOR) or '#' (STREAM_VERSION_SEPARATOR) character where required.","commonSituations":"Hand-crafted or renamed quarkus.platform.* properties in a BOM-derived properties file; importing a properties file whose platform property keys don't use the canonical 'key$stream#version' encoding; version changes where the property naming convention changed.","solutions":["Ensure the platform property name uses the canonical format with '$' between key and stream and '#' between stream and version","Check where the property came from (BOM properties file) and fix its key spelling","Use Quarkus' own property generation (codestart / platform tooling) instead of hand-writing these keys"],"exampleFix":"// before\nprops.setProperty(\"io.quarkus.platform.version\", \"3.2.0.Final\");\n// after\nprops.setProperty(\"io.quarkus.platform.my-platform$3.2#999-SNAPSHOT.version\", \"3.2.0.Final\");","handlingStrategy":"validation","validationCode":"boolean isWellFormedPlatformProperty(String name) {\n    return name != null && name.indexOf('$') >= 0 && name.indexOf('#') > name.indexOf('$');\n}\n// run before addPlatformRelease","typeGuard":"boolean containsSeparators(String s) { return s != null && s.indexOf('$') >= 0 && s.indexOf('#') >= 0; }","tryCatchPattern":"try {\n    imports.addPlatformRelease(name, value);\n} catch (IllegalArgumentException e) {\n    log.errorf(\"Malformed platform property '%s': %s\", name, e.getMessage());\n}","preventionTips":["Generate platform property keys with Quarkus tooling, not by hand","Keep the 'key$stream#version' separator convention intact when renaming keys","Only feed properties whose names start with the platform property prefix into these APIs"],"tags":["platform-imports","parsing","property-format"],"backgroundTag":"property-name-format-invalid","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"}