{"record":{"id":"c0d94775f51ef623","repo":"skylot/jadx","slug":"decompilation-batches-build-failed","errorCode":null,"errorMessage":"Decompilation batches build failed","messagePattern":"Decompilation batches build failed","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/api/JadxDecompiler.java","lineNumber":404,"sourceCode":"\t\t\t\tint endIdx = inputFileName.lastIndexOf(':');\n\t\t\t\tif (endIdx != -1) {\n\t\t\t\t\tint startIdx = inputFileName.lastIndexOf(':', endIdx - 1) + 1;\n\t\t\t\t\tinputFileName = inputFileName.substring(startIdx, endIdx);\n\t\t\t\t}\n\t\t\t}\n\t\t\tset.add(inputFileName);\n\t\t}\n\t\treturn set;\n\t}\n\n\tprivate void appendSourcesSave(ITaskExecutor executor, File outDir) {\n\t\tList<JavaClass> classes = getClasses();\n\t\tList<JavaClass> processQueue = filterClasses(classes);\n\t\tList<List<JavaClass>> batches;\n\t\ttry {\n\t\t\tbatches = decompileScheduler.buildBatches(processQueue);\n\t\t} catch (Exception e) {\n\t\t\tthrow new JadxRuntimeException(\"Decompilation batches build failed\", e);\n\t\t}\n\t\tList<Runnable> decompileTasks = new ArrayList<>(batches.size());\n\t\tfor (List<JavaClass> decompileBatch : batches) {\n\t\t\tdecompileTasks.add(() -> {\n\t\t\t\tfor (JavaClass cls : decompileBatch) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tClassNode clsNode = cls.getClassNode();\n\t\t\t\t\t\tICodeInfo code = clsNode.getCode();\n\t\t\t\t\t\tSaveCode.save(outDir, clsNode, code);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tLOG.error(\"Error saving class: {}\", cls, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\t\texecutor.addParallelTasks(decompileTasks);\n\t}","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/api/JadxDecompiler.java#L386-L422","documentation":"Thrown in appendSourcesSave() when decompileScheduler.buildBatches(processQueue) raises any exception while grouping the filtered class list into decompilation batches. Batching depends on resolving inter-class dependencies, so a failure here is structural (cyclic or unresolvable dependencies, a null class node, scheduler misconfiguration). The original exception is chained on a JadxRuntimeException.","triggerScenarios":"Calling save() (which internally calls appendSourcesSave) on a loaded project where the decompile scheduler cannot partition the class graph into batches. Reached only after load() succeeded.","commonSituations":"A class graph containing unusual cyclic dependencies that the scheduler's batcher cannot handle; a custom/buggy IDecompileScheduler implementation; a corrupted class node introduced by a plugin; very large codebases that expose an edge case in batching.","solutions":["Inspect getCause() on the JadxRuntimeException to find the scheduler's original error.","If using a custom IDecompileScheduler, verify its buildBatches contract and that it never throws on cyclic deps.","Try reducing the input (decompile a subset) to isolate the offending class/dependency.","Report with the cause stack trace if it reproduces on stock jadx, as this usually indicates an internal bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    decompiler.save();\n} catch (JadxRuntimeException e) {\n    if (\"Decompilation batches build failed\".equals(e.getMessage())) {\n        LOG.error(\"Scheduler failed to build batches\", e.getCause());\n        // fall back to decompiling classes individually without batching\n    } else throw e;\n}","preventionTips":["Inspect getCause() to find the scheduler's underlying error.","If using a custom IDecompileScheduler, ensure buildBatches never throws on cyclic deps.","Isolate the failing class by decompiling subsets when reproducing."],"tags":["decompilation","scheduler","internal","save"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}