{"record":{"id":"dcbcb83e9c34c22e","repo":"projectlombok/lombok","slug":"i-o-problem-during-delombok","errorCode":null,"errorMessage":"I/O problem during delombok","messagePattern":"I/O problem during delombok","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"src/delombok/lombok/delombok/ant/DelombokTaskImpl.java","lineNumber":90,"sourceCode":"\t\tdelombok.setOutput(toDir);\n\t\ttry {\n\t\t\tif (fromDir != null) delombok.addDirectory(fromDir);\n\t\t\telse {\n\t\t\t\tIterator<?> it = path.iterator();\n\t\t\t\twhile (it.hasNext()) {\n\t\t\t\t\tFileResource fileResource = (FileResource) it.next();\n\t\t\t\t\tFile baseDir = fileResource.getBaseDir();\n\t\t\t\t\tif (baseDir == null) {\n\t\t\t\t\t\tFile file = fileResource.getFile();\n\t\t\t\t\t\tdelombok.addFile(file.getParentFile(), file.getName());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelombok.addFile(baseDir, fileResource.getName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelombok.delombok();\n\t\t} catch (IOException e) {\n\t\t\tthrow new BuildException(\"I/O problem during delombok\", e, location);\n\t\t}\n\t}\n}\n","sourceCodeStart":72,"sourceCodeEnd":94,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/delombok/lombok/delombok/ant/DelombokTaskImpl.java#L72-L94","documentation":"Lombok's Ant DelombokTaskImpl wraps any IOException thrown while running delombok() in an Ant BuildException with this message. It means file I/O (reading sources, writing output) failed during the delombok run.","triggerScenarios":"Running the 'delombok' Ant task when delombok.delombok() encounters an IOException: source files missing under baseDir, output directory not writable, or disk errors.","commonSituations":"Ant build with a bad source/output directory path, read-only output dir, files deleted between scan and delombok, permission problems in CI.","solutions":["Check the wrapped cause (BuildExceptiongetCause()) for the actual IOException","Verify the task's input (baseDir) and output (to/target) directories exist and are writable","Run Ant with -verbose to see the underlying IO error and offending file","Fix filesystem permissions or free disk space"],"exampleFix":"<!-- before -->\n<delombok to=\"build/delombok\"/>\n<!-- after: ensure dirs exist and are writable -->\n<mkdir dir=\"build/delombok\"/>\n<delombok from=\"src/main/java\" to=\"build/delombok\"/>","handlingStrategy":"try-catch","validationCode":"if (!new File(baseDir).canRead()) throw new IllegalStateException(\"unreadable source dir\");\nFile out = new File(toDir); if (!out.exists() && !out.mkdirs()) throw new IllegalStateException(\"cannot create output dir\");\nif (!out.canWrite()) throw new IllegalStateException(\"output dir not writable\");","typeGuard":null,"tryCatchPattern":"try { delombokTask.execute(); } catch (BuildException e) { if (e.getCause() instanceof IOException) { log(\"Delombok IO failure: \" + e.getCause().getMessage()); } throw e; }","preventionTips":["Always mkdir the delombok output directory before running the task","Run CI builds with a writable workspace user","Check BuildException.getCause() to diagnose the real IOException"],"tags":["java","ant","io","build"],"backgroundTag":"file-read-failed","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}