{"record":{"id":"8fe4f0dce3470c92","repo":"skylot/jadx","slug":"load-method-exception","errorCode":null,"errorMessage":"Load method exception: {}: {}","messagePattern":"Load method exception: (.+?): (.+?)","errorType":"exception","errorClass":"DecodeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java","lineNumber":185,"sourceCode":"\t\t\tthis.argsStartReg = codeReader.getArgsStartReg();\n\t\t\tinitArguments(this.argTypes);\n\n\t\t\tif (contains(AType.JADX_ERROR)) {\n\t\t\t\t// don't load instructions for method with errors\n\t\t\t\tthis.instructions = EMPTY_INSN_ARRAY;\n\t\t\t} else {\n\t\t\t\tInsnDecoder decoder = new InsnDecoder(this);\n\t\t\t\tthis.instructions = decoder.process(codeReader);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tif (!noCode) {\n\t\t\t\tunload();\n\t\t\t\tnoCode = true;\n\t\t\t\t// load without code\n\t\t\t\tload();\n\t\t\t\tnoCode = false;\n\t\t\t}\n\t\t\tthrow new DecodeException(this, \"Load method exception: \"\n\t\t\t\t\t+ e.getClass().getSimpleName() + \": \" + e.getMessage(), e);\n\t\t}\n\t}\n\n\tpublic void reload() {\n\t\tunload();\n\t\ttry {\n\t\t\tload();\n\t\t} catch (DecodeException e) {\n\t\t\tthrow new JadxRuntimeException(\"Failed to reload method \" + getClass().getName() + \".\" + getName());\n\t\t}\n\t}\n\n\tprivate void initArguments(List<ArgType> args) {\n\t\tint pos = getArgsStartPos(args);\n\t\tTypeUtils typeUtils = root().getTypeUtils();\n\t\tif (accFlags.isStatic()) {\n\t\t\tthisArg = null;","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java#L167-L203","documentation":"MethodNode.load() wraps the method code-loading body (register counts, argument init, InsnDecoder processing) in a try/catch. On ANY exception it reloads the method without code (so the method still appears with a decompile-error comment) and then throws DecodeException with the original cause chained.","triggerScenarios":"Any exception during instruction decoding (e.g. errors 100-106, 108-110), register-count mismatches, or argument initialization failures. The method is automatically degraded to a no-code stub before the exception is re-thrown.","commonSituations":"Corrupt method bytecode, unsupported instructions, or obfuscation. The method's signature is still usable; only the body fails.","solutions":["Upgrade JADX.","Rely on the automatic no-code fallback — the method will still appear in output as a stub.","Use --show-bad-code to maximize recovered methods.","Report the method and chained cause upstream."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// MethodNode already auto-falls-back to a no-code stub; catch the DecodeException\n// to keep the method's signature in output.\ntry {\n    String code = cls.decompile();\n} catch (DecodeException e) {\n    log.warn(\"Method body decode failed; method shown as stub: {}\", e.getMessage());\n}","preventionTips":["Rely on JADX's built-in no-code fallback — the method signature is preserved.","Use --show-bad-code to maximize recovered method bodies.","Examine the chained cause to locate the failing instruction."],"tags":["method-decode","fallback","malformed-input"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}