{"record":{"id":"832cc1ed6df37d85","repo":"languagetool-org/languagetool","slug":"replacement-has-more-than-1-modern-form-line","errorCode":null,"errorMessage":"Replacement has more than 1 modern form:\" + line","messagePattern":"Replacement has more than 1 modern form:\" \\+ line","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/DativePluralsData.java","lineNumber":71,"sourceCode":"        if (parts.length != 4) {\n          throw new RuntimeException(\"Incorrect number of fields: \" + line);\n        }\n        String form = parts[0];\n        String formModern = null;\n        if (form.contains(\":\")) {\n          String[] forms = form.split(\":\");\n          if (forms.length != 2) {\n            throw new RuntimeException(\"Form has more than 1 modern form:\" + line);\n          }\n          form = forms[0];\n          formModern = forms[1];\n        }\n        String repl = parts[3];\n        String replModern = null;\n        if (repl.contains(\":\")) {\n          String[] repls = repl.split(\":\");\n          if (repls.length != 2) {\n            throw new RuntimeException(\"Replacement has more than 1 modern form:\" + line);\n          }\n          repl = repls[0];\n          replModern = repls[1];\n        }\n        String lemma = parts[1];\n        String lemmaModern = null;\n        if (lemma.contains(\":\")) {\n          String[] lemmata = lemma.split(\":\");\n          if (lemmata.length != 2) {\n            throw new RuntimeException(\"Lemma has more than 1 modern form:\" + line);\n          }\n          lemma = lemmata[0];\n          lemmaModern = lemmata[1];\n        }\n        DativePluralsEntry entry = new DativePluralsEntry(form, lemma, parts[2], repl);\n        if (formModern != null) {\n          entry.setModernised(formModern);\n        }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/DativePluralsData.java#L53-L89","documentation":"Same convention as the form field: in DativePluralsData.loadWords the fourth field (the replacement) may encode one modern variant as repl:replModern. More than one colon in that field yields more than two parts and throws this RuntimeException with the offending line.","triggerScenarios":"A data-file line whose fourth (replacement) field contains two or more ':' characters, so repls.length != 2.","commonSituations":"Manual data entry adding multiple replacement variants; stray colon typos; misunderstanding of the single-modern-form convention.","solutions":["Fix the line so the replacement field has at most one colon (original:modern).","Split multiple replacement variants into separate lines.","Grep the resource file for lines with two+ colons in the last field to fix all occurrences at once.","Extend the parser explicitly if multiple modern replacements are genuinely required, with a corresponding format change to all lines."],"exampleFix":"// before\n...; ...; ...; breis:breise:breisí\n// after\n...; ...; ...; breis:breise","handlingStrategy":"validation","validationCode":"String repl = line.split(\";\")[3];\nif (repl.chars().filter(c -> c == ':').count() > 1)\n  throw new IllegalStateException(\"multiple modern replacements in: \" + line);","typeGuard":null,"tryCatchPattern":"try { loadWords(reader); } catch (RuntimeException e) { log.error(\"Fix replacement field: \" + e.getMessage()); }","preventionTips":["Validate all four fields' colon counts together in a pre-commit lint script","Split multiple replacement variants across lines","Review data-file diffs line by line"],"tags":["java","languagetool","data-file","irish"],"backgroundTag":"invalid-argument-format","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}