{"record":{"id":"fc62ec849b87baaf","repo":"skylot/jadx","slug":"arguments-count-limit-reached","errorCode":null,"errorMessage":"Arguments count limit reached: {}","messagePattern":"Arguments count limit reached: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java","lineNumber":342,"sourceCode":"\t\treturn types;\n\t}\n\n\tpublic List<ArgType> consumeMethodArgs(int argsCount) {\n\t\tconsume('(');\n\t\tif (lookAhead(')')) {\n\t\t\tconsume(')');\n\t\t\treturn Collections.emptyList();\n\t\t}\n\t\tList<ArgType> args = new ArrayList<>(argsCount);\n\t\tint limit = argsCount + 10; // just prevent endless loop, args count can be different for synthetic methods\n\t\tdo {\n\t\t\tArgType type = consumeType();\n\t\t\tif (type == null) {\n\t\t\t\tthrow new JadxRuntimeException(\"Unexpected end of signature\");\n\t\t\t}\n\t\t\targs.add(type);\n\t\t\tif (args.size() > limit) {\n\t\t\t\tthrow new JadxRuntimeException(\"Arguments count limit reached: \" + args.size());\n\t\t\t}\n\t\t} while (!lookAhead(')'));\n\t\tconsume(')');\n\t\treturn args;\n\t}\n\n\tprivate static String mergeSignature(List<String> list) {\n\t\tif (list.size() == 1) {\n\t\t\treturn list.get(0);\n\t\t}\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String s : list) {\n\t\t\tsb.append(s);\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tpublic String getSignature() {","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java#L324-L360","documentation":"Thrown by consumeMethodArgs() as an endless-loop guard. The method expects to parse approximately argsCount argument types, but allows a margin of +10 for synthetic methods. If the parsed argument count exceeds argsCount + 10 without hitting the closing ')', the parser assumes the signature is malformed and aborts rather than looping forever.","triggerScenarios":"consumeMethodArgs() is called with an argsCount value, the do-while loop keeps calling consumeType() and adding to args, and args.size() exceeds argsCount + 10 while lookAhead(')') remains false. This happens when the signature's argument list is far longer than the declared argsCount, or when the closing ')' is missing so the parser never terminates.","commonSituations":"A method Signature attribute whose argument list does not match the method descriptor's argument count by more than 10 — typically from obfuscators that rewrite method signatures, or from DEX files where the Signature and the actual parameter count diverge significantly.","solutions":["Upgrade jadx — the limit heuristic and argument-count reconciliation improve over time.","Catch JadxRuntimeException per class/method and skip the offender.","Report the issue with the method name, declared argsCount, and the full signature.","Strip the method's Signature attribute before decompiling as a workaround."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    javaClass.decompile();\n} catch (JadxRuntimeException e) {\n    LOG.warn(\"Method arg-count limit hit in {}: {}\", javaClass.getName(), e.getMessage());\n}","preventionTips":["Upgrade jadx — argument-count reconciliation improves.","Catch per class to continue the batch.","Report methods where Signature arg count diverges from the descriptor.","Strip Signature attributes from synthetic/obfuscated methods."],"tags":["jadx","decompiler","signature-parser","method-signature","infinite-loop-guard","obfuscation"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}