{"record":{"id":"bc5833ded3a6cc75","repo":"projectlombok/lombok","slug":"unclosed-in-file","errorCode":null,"errorMessage":"Unclosed \" in @ file","messagePattern":"Unclosed \" in @ file","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/delombok/lombok/delombok/Delombok.java","lineNumber":445,"sourceCode":"\t\t\t}\n\t\t\tif (state == 3) {\n\t\t\t\tif (c == '\\'') {\n\t\t\t\t\tstate = 1;\n\t\t\t\t\tx.add(a.toString());\n\t\t\t\t\ta.setLength(0);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ta.append(c);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (state == 1) {\n\t\t\tString aa = a.toString();\n\t\t\tif (!aa.isEmpty()) x.add(aa);\n\t\t} else if (state < 0) {\n\t\t\tthrow new IOException(\"Unclosed backslash escape in @ file\");\n\t\t} else if (state == 2) {\n\t\t\tthrow new IOException(\"Unclosed \\\" in @ file\");\n\t\t} else if (state == 3) {\n\t\t\tthrow new IOException(\"Unclosed ' in @ file\");\n\t\t}\n\t\t\n\t\treturn x.toArray(new String[0]);\n\t}\n\t\n\tpublic static class InvalidFormatOptionException extends Exception {\n\t\tpublic InvalidFormatOptionException(String msg) {\n\t\t\tsuper(msg);\n\t\t}\n\t}\n\t\n\tpublic static Map<String, String> formatOptionsToMap(List<String> formatOptions) throws InvalidFormatOptionException {\n\t\tboolean prettyEnabled = false;\n\t\tMap<String, String> formatPrefs = new HashMap<String, String>();\n\t\tfor (String format : formatOptions) {\n\t\t\tint idx = format.indexOf(':');","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/delombok/lombok/delombok/Delombok.java#L427-L463","documentation":"Delombok's @argfile parser tracks whether a double-quoted section opened on a line is closed before end of input. If the state machine ends in state 2, the closing quote is missing and it throws IOException(\"Unclosed \\\" in @ file\").","triggerScenarios":"An @argfile line contains an opening \" that is never closed on that logical line, e.g. an argument like --print-stack-modes \"verbose or an odd number of quotes, so parsing hits end of input while inside a quoted token.","commonSituations":"Copy-pasting shell command lines where quotes were consumed or half-pasted; quoting arguments with spaces and losing the closing quote in an editor; smart-quote corruption from rich-text editors.","solutions":["Ensure every opening double quote in the argfile has a matching closing quote on the same line","Quote the whole argument only when it contains spaces: -d \"C:\\my output\"","Avoid smart/curly quotes (“ ”) — use plain ASCII \" and ' in argfiles"],"exampleFix":"// before (@args.txt)\n--charset \"utf-8\n// after (@args.txt)\n--charset \"utf-8\"","handlingStrategy":"validation","validationCode":"long c = line.chars().filter(ch -> ch == '\"').count();\nif (c % 2 != 0) throw new IllegalArgumentException(\"Unbalanced double quotes in argfile line: \" + line);","typeGuard":null,"tryCatchPattern":"try { return delombok.parts(new String[]{\"@args.txt\"}); } catch (IOException e) { if (e.getMessage().contains(\"Unclosed \\\"\")) { /* repair quotes and retry */ } throw e; }","preventionTips":["Count quotes per line before saving the argfile","Quote whole arguments containing spaces, not parts","Disable smart-quote substitution in editors"],"tags":["delombok","argfile","parsing","io"],"backgroundTag":"invalid-argument-format","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"}