Source:
private static Set<DativePluralsEntry> loadWords(String path) { Set<DativePluralsEntry> set = new HashSet<>(); InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path); try (Scanner scanner = new Scanner(stream, "utf-8")) { while (scanner.hasNextLine()) { String line = scanner.nextLine().trim(); if (line.isEmpty() || line.charAt(0) == '#') { continue; } String parts[] = line.split(";"); if(parts.length != 4) { System.err.println("Skipping entry (Incorrect number of fields): " + line); continue; } String form = parts[0]; String form_modern = null; if(form.contains(":")) { String forms[] = form.split(":"); if(forms.length != 2) { System.err.println("Skipping entry (form has more than 1 modern form): " + line); continue; } form = forms[0]; form_modern = forms[1]; } String repl = parts[3]; String repl_modern = null; if(repl.contains(":")) { String repls[] = repl.split(":"); if(repls.length != 2) { System.err.println("Skipping entry (replacement has more than 1 modern form): " + line); continue; } repl = repls[0]; repl_modern = repls[1]; } String lemma = parts[1]; String lemma_modern = null; if(lemma.contains(":")) { String lemmata[] = lemma.split(":"); if(lemmata.length != 2) { System.err.println("Skipping entry (lemma has more than 1 modern form): " + line); continue; } lemma = lemmata[0]; lemma_modern = lemmata[1]; } DativePluralsEntry entry = new DativePluralsEntry(form, lemma, parts[2], repl); if(form_modern != null) { entry.setModernised(form_modern); } if(repl_modern != null) { entry.setEquivalent(repl_modern); } if(lemma_modern != null) { entry.setModernLemma(lemma_modern); } set.add(entry); } } return Collections.unmodifiableSet(set); }

Target:
private static Set<DativePluralsEntry> loadWords(String path) { Set<DativePluralsEntry> set = new HashSet<>(); InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path); try (Scanner scanner = new Scanner(stream, "utf-8")) { while (scanner.hasNextLine()) { String line = scanner.nextLine().trim(); if (line.isEmpty() || line.charAt(0) == '#') { continue; } String[] parts = line.split(";"); if(parts.length != 4) { throw new RuntimeException("Incorrect number of fields: " + line); } String form = parts[0]; String formModern = null; if(form.contains(":")) { String[] forms = form.split(":"); if(forms.length != 2) { throw new RuntimeException("Form has more than 1 modern form:" + line); } form = forms[0]; formModern = forms[1]; } String repl = parts[3]; String replModern = null; if(repl.contains(":")) { String[] repls = repl.split(":"); if(repls.length != 2) { throw new RuntimeException("Replacement has more than 1 modern form:" + line); } repl = repls[0]; replModern = repls[1]; } String lemma = parts[1]; String lemmaModern = null; if(lemma.contains(":")) { String[] lemmata = lemma.split(":"); if(lemmata.length != 2) { throw new RuntimeException("Lemma has more than 1 modern form:" + line); } lemma = lemmata[0]; lemmaModern = lemmata[1]; } DativePluralsEntry entry = new DativePluralsEntry(form, lemma, parts[2], repl); if(formModern != null) { entry.setModernised(formModern); } if(replModern != null) { entry.setEquivalent(replModern); } if(lemmaModern != null) { entry.setModernLemma(lemmaModern); } set.add(entry); } } return Collections.unmodifiableSet(set); }