{"record":{"id":"1f80a6c38d756037","repo":"HMCL-dev/HMCL","slug":"value","errorCode":null,"errorMessage":"{value}","messagePattern":"\\{value\\}","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/util/versioning/GameVersionNumber.java","lineNumber":241,"sourceCode":"                    return gaRelease;\n                }\n            }\n        }\n\n        return null;\n    }\n\n    public static final class Old extends GameVersionNumber {\n        static Old parse(String value) {\n            if (value.isEmpty())\n                throw new IllegalArgumentException(\"Empty old version number\");\n\n            Type type;\n            int prefixLength = 1;\n            switch (value.charAt(0)) {\n                case 'r':\n                    if (!value.startsWith(\"rd-\")) {\n                        throw new IllegalArgumentException(value);\n                    }\n\n                    type = Type.PRE_CLASSIC;\n                    prefixLength = \"rd-\".length();\n                    break;\n                case 'i':\n                    if (value.startsWith(\"inf-\")) {\n                        type = Type.INFDEV;\n                        prefixLength = \"inf-\".length();\n                    } else if (value.startsWith(\"in-\")) {\n                        type = Type.INDEV;\n                        prefixLength = \"in-\".length();\n                    } else {\n                        throw new IllegalArgumentException(value);\n                    }\n                    break;\n                case 'a':\n                    type = Type.ALPHA;","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/util/versioning/GameVersionNumber.java#L223-L259","documentation":"Old.parse throws IllegalArgumentException carrying the offending string when the value starts with 'r' but is not prefixed with 'rd-' (the pre-classic rd- prefix). Only 'rd-...' legacy versions starting with 'r' are recognized.","triggerScenarios":"Passing a legacy-style version like 'r1.0', 'release-1.0', or a typo like 'rd' / 'rd_' (trailing separator missing) to GameVersionNumber parsing.","commonSituations":"Hand-edited version identifiers in config; version strings from third-party launchers using different legacy naming; typos when constructing pre-classic version ids.","solutions":["Use the exact pre-classic format 'rd-<number>' (e.g. 'rd-132211')","Check for typos in the version string","If the version is not a legacy pre-classic one, parse it through the appropriate path (Release/LegacySnapshot) instead of Old.parse"],"exampleFix":"// before\nGameVersionNumber.asGameVersion(\"rd132211\");\n// after\nGameVersionNumber.asGameVersion(\"rd-132211\");","handlingStrategy":"validation","validationCode":"static boolean isPreClassic(String v) {\n    return v != null && v.startsWith(\"rd-\");\n}\n","typeGuard":null,"tryCatchPattern":"try {\n    GameVersionNumber v = GameVersionNumber.asGameVersion(raw);\n} catch (IllegalArgumentException e) {\n    log.warn(\"Not a valid legacy version: {}\", raw);\n}","preventionTips":["Use exact canonical prefixes: 'rd-' for pre-classic","Validate with v.startsWith(\"rd-\") before parsing r-prefixed values","Route unknown formats to the general asGameVersion dispatcher"],"tags":["java","version-parsing","invalid-format"],"backgroundTag":"invalid-argument-format","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"}