{"record":{"id":"7656c4658cf03679","repo":"projectlombok/lombok","slug":"legal-values-for-emptylines-are-scan-indent","errorCode":null,"errorMessage":"Legal values for 'emptyLines' are 'scan', 'indent', or 'blank'.","messagePattern":"Legal values for 'emptyLines' are 'scan', 'indent', or 'blank'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/delombok/lombok/delombok/FormatPreferences.java","lineNumber":78,"sourceCode":"\t\tif (preferences == null) preferences = Collections.emptyMap();\n\t\t\n\t\tString indent_ = preferences.get(\"indent\");\n\t\tif (indent_ != null && !\"scan\".equalsIgnoreCase(indent_)) {\n\t\t\ttry {\n\t\t\t\tint id = Integer.parseInt(indent_);\n\t\t\t\tif (id > 0 && id < 32) {\n\t\t\t\t\tchar[] c = new char[id];\n\t\t\t\t\tArrays.fill(c, ' ');\n\t\t\t\t\tindent_ = new String(c);\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException ignore) {}\n\t\t\tindent = indent_.replace(\"\\\\t\", \"\\t\").replace(\"tab\", \"\\t\");\n\t\t}\n\t\tString empties_ = preferences.get(\"emptyLines\".toLowerCase());\n\t\tif (\"indent\".equalsIgnoreCase(empties_)) filledEmpties = true;\n\t\telse if (\"blank\".equalsIgnoreCase(empties_)) filledEmpties = false;\n\t\telse if (empties_ != null && !\"scan\".equalsIgnoreCase(empties_)) {\n\t\t\tthrow new IllegalArgumentException(\"Legal values for 'emptyLines' are 'scan', 'indent', or 'blank'.\");\n\t\t}\n\t\t\n\t\tthis.indent = indent;\n\t\tthis.filledEmpties = filledEmpties;\n\t\t\n\t\tthis.generateFinalParams = unrollBoolean(preferences, \"finalParams\", \"generate\", \"skip\", true);\n\t\tthis.generateConstructorProperties = unrollBoolean(preferences, \"constructorProperties\", \"generate\", \"skip\", true);\n\t\tthis.generateSuppressWarnings = unrollBoolean(preferences, \"suppressWarnings\", \"generate\", \"skip\", true);\n\t\tthis.generateGenerated = unrollBoolean(preferences, \"generated\", \"generate\", \"skip\", true);\n\t\tthis.danceAroundIdeChecks = unrollBoolean(preferences, \"danceAroundIdeChecks\", \"generate\", \"skip\", true);\n\t\tthis.generateDelombokComment = unrollBoolean(preferences, \"generateDelombokComment\", \"generate\", \"skip\", true);\n\t\tthis.javaLangAsFqn = unrollBoolean(preferences, \"javaLangAsFQN\", \"generate\", \"skip\", true);\n\t}\n\t\n\tprivate static boolean unrollBoolean(Map<String, String> preferences, String name, String trueStr, String falseStr, boolean defaultVal) {\n\t\tString v_ = preferences.get(name.toLowerCase());\n\t\tif (v_ == null) return defaultVal;\n\t\tif (trueStr.equalsIgnoreCase(v_)) return true;","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/delombok/lombok/delombok/FormatPreferences.java#L60-L96","documentation":"FormatPreferences validates the `emptyLines` format option. Only three values are accepted: 'scan' (default, mimic input), 'indent' (fill blank lines with indentation), and 'blank' (fully empty lines). Any other non-null value throws IllegalArgumentException during `setFormatPreferences`.","triggerScenarios":"Passing a format option `emptyLines=<something>` other than scan/indent/blank (case-insensitive), e.g. via CLI `--format emptyLines:tabs`, an Ant `<format name=\"emptyLines\" value=\"...\">`, or a Map entry in `setFormatPreferences`.","commonSituations":"Typos like `emptyline`, `empty-lines:keep`, or copying values from other options such as `indent`; passing an empty-string value instead of omitting the key.","solutions":["Set emptyLines to one of: 'scan', 'indent', or 'blank'","Remove the emptyLines key entirely to use the default 'scan' behavior","Check spelling/case — matching is case-insensitive, so 'INDENT' is fine but 'indents' is not"],"exampleFix":"// before\nMap<String,String> opts = new HashMap<>();\nopts.put(\"emptylines\", \"preserve\");\n// after\nopts.put(\"emptylines\", \"indent\"); // or \"scan\" / \"blank\"","handlingStrategy":"validation","validationCode":"String v = opts.get(\"emptyLines\");\nif (v != null && !(v.equalsIgnoreCase(\"scan\") || v.equalsIgnoreCase(\"indent\") || v.equalsIgnoreCase(\"blank\")))\n    throw new IllegalArgumentException(\"emptyLines must be scan|indent|blank\");","typeGuard":null,"tryCatchPattern":"try { delombok.setFormatPreferences(opts); } catch (IllegalArgumentException e) { /* fix option value from message */ throw e; }","preventionTips":["Only use documented values: scan, indent, blank","Consult `--format-help` before adding options","Keep format options in one reviewed config location"],"tags":["configuration","format-options","illegal-argument","delombok"],"backgroundTag":"invalid-enum-value","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"}