languagetool-org/languagetool · error

Not found:

Error message

Not found: 

What it means

RuleActivityOverview.getActivityFor iterates the XML rule files for a language and throws a RuntimeException if a listed file does not exist (unless it is a test file). This guards against computing git history for rules that are no longer checked out at the expected location.

Source

Thrown at languagetool-dev/src/main/java/org/languagetool/dev/RuleActivityOverview.java:76

    for (String langName : sortedLanguages) {
      Language lang = Languages.getLanguageForName(langName);
      int commits = getActivityFor(lang, PAST_DAYS);
      System.out.println(commits + "\t" + lang.getName() + (lang.isVariant() ? " (including the parent language)" : ""));
    }
  }

  int getActivityFor(Language lang, int pastDays) {
    try {
      Calendar past = GregorianCalendar.getInstance();
      past.add(Calendar.DAY_OF_MONTH, -pastDays);
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      String pastString = dateFormat.format(past.getTime());
      String langCode = lang.getShortCode();
      List<File> xmlFiles = getAllXmlFiles(lang, langCode);
      int commits = 0;
      for (File file : xmlFiles) {
        if (!file.getName().contains("-test-") && !file.exists()) {
          throw new RuntimeException("Not found: " + file);
        }
        String command = "git log --after=" + pastString + " " + file;
        Runtime runtime = Runtime.getRuntime();
        Process process = runtime.exec(command);
        InputStream inputStream = process.getInputStream();
        String output = StringTools.readStream(inputStream, "utf-8");
        process.waitFor();
        commits += getCommits(output);
      }
      return commits;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  private List<File> getAllXmlFiles(Language lang, String langCode) {
    List<File> files = new ArrayList<>();
    List<String> ruleFileNames = lang.getRuleFileNames();

View on GitHub (pinned to 2e990059ce)

Solutions

  1. git checkout / restore the missing XML file or re-clone the repository
  2. Run the tool from a complete languagetool repository checkout (full clone, not sparse)
  3. Update the file list generation if rules were renamed on your branch
Defensive patterns

Strategy: validation

Validate before calling

List<File> xmlFiles = Files.walk(Paths.get("languagetool-language-modules"))
    .map(Path::toFile).filter(f -> f.getName().endsWith(".xml")).collect(Collectors.toList());
xmlFiles.stream().filter(f -> !f.getName().contains("-test-") && !f.exists()).forEach(f -> System.err.println("missing " + f));

Try / catch

try { overview.printActivity(lang); } catch (RuntimeException e) { if (e.getMessage().startsWith("Not found:")) { System.err.println("Incomplete checkout — run a full git clone/checkout"); } }

Prevention

When it happens

Trigger: Running the RuleActivityOverview script when a rule XML file for the given language is missing from the working tree — e.g. after an incomplete checkout, renamed rules, or running from the wrong directory.

Common situations: Sparse or partial git checkouts; running the tool against a branch where rule files were moved/renamed; stale generated file lists.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/2701a16dee66e17f. Report an issue: GitHub.