{"record":{"id":"b73e7d6b40a31ac4","repo":"languagetool-org/languagetool","slug":"could-not-load-data-from-path","errorCode":null,"errorMessage":"Could not load data from ${path}","messagePattern":"Could not load data from (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-core/src/main/java/org/languagetool/tools/StringTools.java","lineNumber":747,"sourceCode":"   * @since 4.6\n   * @deprecated use DataBroker#getFromResourceDirAsLines(java.lang.String) instead (NOTE: it won't handle comments)\n   */\n  public static List<String> loadLines(String path) {\n    InputStream stream = JLanguageTool.getDataBroker().getFromResourceDirAsStream(path);\n    List<String> l = new ArrayList<>();\n    try (\n      InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8);\n      BufferedReader br = new BufferedReader(reader)\n    ) {\n      String line;\n      while ((line = br.readLine()) != null) {\n        if (line.isEmpty() || line.charAt(0) == '#') {   // ignore comments\n          continue;\n        }\n        l.add(line);\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(\"Could not load data from \" + path, e);\n    }\n    return Collections.unmodifiableList(l);\n  }\n\n  /**\n   * Will turn a string into a typical rule ID, i.e. uppercase and\n   * \"_\" instead of spaces.\n   *\n   * All non-ASCII characters are replaced with \"_\", EXCEPT for\n   * Latin-1 ranges U+00C0-U+00D6 and U+00D8-U+00DE.\n   *\n   * \"de\" locales have a special implementation (ä =&gt; ae, etc.).\n   *\n   * @param language LT language object, used to apply language-specific normalisation rules.\n   *\n   * @since 5.1\n   */\n  public static String toId(String input, Language language) {","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-core/src/main/java/org/languagetool/tools/StringTools.java#L729-L765","documentation":"Generic I/O guard in StringTools.loadLines: reading the resource at the given path as UTF-8 lines failed. The input at fault is the classpath/resource path; the method is deprecated in favor of DataBroker#getFromResourceDirAsLines.","triggerScenarios":"Thrown at languagetool-core/src/main/java/org/languagetool/tools/StringTools.java:747 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the resource exists at the given path in the resource dir","Check the file is readable and not corrupted","Migrate to DataBroker#getFromResourceDirAsLines, which is the supported loader"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}