{"record":{"id":"3a875c9d03cefe81","repo":"skylot/jadx","slug":"expect-format-got","errorCode":null,"errorMessage":"Expect format: {}, got: {}","messagePattern":"Expect format: (.+?), got: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/plugins/versions/VerifyRequiredVersion.java","lineNumber":63,"sourceCode":"\t\t\t// keep version str parsing for verification\n\t\t\treturn true;\n\t\t}\n\t\tif (unstable) {\n\t\t\treturn VersionComparator.checkAndCompare(jadxVersion, reqVer.getUnstableRev()) >= 0;\n\t\t}\n\t\treturn VersionComparator.checkAndCompare(jadxVersion, reqVer.getReleaseVer()) >= 0;\n\t}\n\n\tpublic String getJadxVersion() {\n\t\treturn jadxVersion;\n\t}\n\n\tprivate static final Pattern REQ_VER_FORMAT = Pattern.compile(\"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+),\\\\s+(r\\\\d+)\");\n\n\tprivate static RequiredVersionData parse(String reqVersionStr) {\n\t\tMatcher matcher = REQ_VER_FORMAT.matcher(reqVersionStr);\n\t\tif (!matcher.matches()) {\n\t\t\tthrow new RuntimeException(\"Expect format: \" + REQ_VER_FORMAT + \", got: \" + reqVersionStr);\n\t\t}\n\t\treturn new RequiredVersionData(matcher.group(1), matcher.group(2));\n\t}\n\n\tprivate static final class RequiredVersionData {\n\t\tprivate final String releaseVer;\n\t\tprivate final String unstableRev;\n\n\t\tprivate RequiredVersionData(String releaseVer, String unstableRev) {\n\t\t\tthis.releaseVer = releaseVer;\n\t\t\tthis.unstableRev = unstableRev;\n\t\t}\n\n\t\tpublic String getReleaseVer() {\n\t\t\treturn releaseVer;\n\t\t}\n\n\t\tpublic String getUnstableRev() {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/plugins/versions/VerifyRequiredVersion.java#L45-L81","documentation":"Thrown by VerifyRequiredVersion.parse when the requiredJadxVersion string does not match the regex (\\d+\\.\\d+\\.\\d+),\\s+(r\\d+) - i.e. it must be a three-part numeric semver, a comma, and an 'rNNN' unstable revision. This is the inner exception that 192 wraps; it is a plain RuntimeException.","triggerScenarios":"parse() is called with anything other than the exact '<digits>.<digits>.<digits>, r<digits>' shape: missing comma, missing 'r', two-part version, or extra text. The matcher.matches() call returns false and the method throws, reporting the expected pattern and the offending string.","commonSituations":"Same as 192: malformed plugin descriptor metadata. Also reachable directly if user code calls VerifyRequiredVersion.isCompatible with a bad string (it calls parse internally), though isJadxCompatible tolerates null/empty.","solutions":["Reformat the version to match the regex exactly, e.g. '1.5.0, r1234'.","If you only need a yes/no compatibility answer, pass null or empty (isCompatible returns true) instead of a malformed string.","When building a plugin, copy the required version string from jadx's own release label to avoid format drift.","Catch IllegalArgumentException around plugin loading so one bad descriptor does not kill the whole plugin scan."],"exampleFix":"// before\nString v = \"1.5\";            // rejected\nString v = \"1.5.0-r1234\";   // rejected (missing ', ')\n// after\nString v = \"1.5.0, r1234\";  // accepted","handlingStrategy":"validation","validationCode":"private static final Pattern REQ_VER_FORMAT =\n    Pattern.compile(\"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+),\\\\s+(r\\\\d+)\");\nboolean ok(String v) { return v != null && REQ_VER_FORMAT.matcher(v).matches(); }","typeGuard":null,"tryCatchPattern":"try {\n    VerifyRequiredVersion.verify(v);\n} catch (RuntimeException e) {\n    LOG.warn(\"ignoring malformed requiredJadxVersion '{}': {}\", v, e.getMessage());\n}","preventionTips":["Use the exact regex (\\d+\\.\\d+\\.\\d+),\\s+(r\\d+) when generating the field.","Pass null/empty to isJadxCompatible if you do not have a well-formed version (it returns true).","Catch the parse failure during plugin scans so one bad descriptor does not abort loading."],"tags":["plugins","version","regex","metadata","validation"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}