{"record":{"id":"31aef58302590676","repo":"HMCL-dev/HMCL","slug":"theme-id-must-follow-package-id-format","errorCode":null,"errorMessage":"Theme ID must follow package ID format: ","messagePattern":"Theme ID must follow package ID format: ","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java","lineNumber":98,"sourceCode":"        overrides = List.copyOf(overrides);\n    }\n\n    /// Parses a theme from JSON.\n    ///\n    /// @param object          the theme JSON object\n    /// @param requireIdentity whether the theme must declare an explicit ID and name\n    /// @return the parsed theme\n    /// @throws JsonParseException if required identity fields are missing or malformed\n    static Theme fromJson(JsonObject object, boolean requireIdentity) throws JsonParseException {\n        Objects.requireNonNull(object);\n\n        @Nullable String id = JsonUtils.getString(object, \"id\");\n        if (id != null) {\n            try {\n                id = ThemePackManifest.requireThemeId(id);\n            } catch (IllegalArgumentException e) {\n                if (requireIdentity) {\n                    throw new JsonParseException(e);\n                }\n                LOG.warning(\"Ignored invalid theme id: \" + id, e);\n                id = null;\n            }\n        }\n        if (id == null && requireIdentity) {\n            throw new JsonParseException(\"Theme is missing the id\");\n        }\n        @Nullable LocalizedText name;\n        try {\n            name = LocalizedText.fromJson(object.get(\"name\"));\n            if (name != null && name.mayBeEmpty()) {\n                throw new JsonParseException(\"Theme name is empty: \" + name);\n            }\n        } catch (JsonParseException | IllegalArgumentException e) {\n            if (requireIdentity) {\n                throw e;\n            }","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java#L80-L116","documentation":"Thrown in Theme.fromJson() when the theme declares an 'id' that does not conform to the theme-pack ID format enforced by ThemePackManifest.requireThemeId(). The ID is used for stable references and overrides between themes, so a malformed identifier (wrong characters or structure) fails parsing. The input at fault is the theme's 'id' JSON string.","triggerScenarios":"Thrown at HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the theme 'id' in the manifest to match the package ID format (typically lowercase letters, digits, hyphens/underscores, no spaces).","Regenerate or correct the theme pack manifest so the id satisfies ThemePackManifest.requireThemeId.","Remove the id field if the pack is a single unnamed theme and identity is not required."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}