{"record":{"id":"2701a16dee66e17f","repo":"languagetool-org/languagetool","slug":"not-found","errorCode":null,"errorMessage":"Not found: ","messagePattern":"Not found: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"languagetool-dev/src/main/java/org/languagetool/dev/RuleActivityOverview.java","lineNumber":76,"sourceCode":"    for (String langName : sortedLanguages) {\n      Language lang = Languages.getLanguageForName(langName);\n      int commits = getActivityFor(lang, PAST_DAYS);\n      System.out.println(commits + \"\\t\" + lang.getName() + (lang.isVariant() ? \" (including the parent language)\" : \"\"));\n    }\n  }\n\n  int getActivityFor(Language lang, int pastDays) {\n    try {\n      Calendar past = GregorianCalendar.getInstance();\n      past.add(Calendar.DAY_OF_MONTH, -pastDays);\n      SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n      String pastString = dateFormat.format(past.getTime());\n      String langCode = lang.getShortCode();\n      List<File> xmlFiles = getAllXmlFiles(lang, langCode);\n      int commits = 0;\n      for (File file : xmlFiles) {\n        if (!file.getName().contains(\"-test-\") && !file.exists()) {\n          throw new RuntimeException(\"Not found: \" + file);\n        }\n        String command = \"git log --after=\" + pastString + \" \" + file;\n        Runtime runtime = Runtime.getRuntime();\n        Process process = runtime.exec(command);\n        InputStream inputStream = process.getInputStream();\n        String output = StringTools.readStream(inputStream, \"utf-8\");\n        process.waitFor();\n        commits += getCommits(output);\n      }\n      return commits;\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private List<File> getAllXmlFiles(Language lang, String langCode) {\n    List<File> files = new ArrayList<>();\n    List<String> ruleFileNames = lang.getRuleFileNames();","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-dev/src/main/java/org/languagetool/dev/RuleActivityOverview.java#L58-L94","documentation":"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.","triggerScenarios":"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.","commonSituations":"Sparse or partial git checkouts; running the tool against a branch where rule files were moved/renamed; stale generated file lists.","solutions":["git checkout / restore the missing XML file or re-clone the repository","Run the tool from a complete languagetool repository checkout (full clone, not sparse)","Update the file list generation if rules were renamed on your branch"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"List<File> xmlFiles = Files.walk(Paths.get(\"languagetool-language-modules\"))\n    .map(Path::toFile).filter(f -> f.getName().endsWith(\".xml\")).collect(Collectors.toList());\nxmlFiles.stream().filter(f -> !f.getName().contains(\"-test-\") && !f.exists()).forEach(f -> System.err.println(\"missing \" + f));","typeGuard":null,"tryCatchPattern":"try { overview.printActivity(lang); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Not found:\")) { System.err.println(\"Incomplete checkout — run a full git clone/checkout\"); } }","preventionTips":["Use full (non-sparse) checkouts before running rule-analysis scripts","Re-clone or git checkout -- . if rule XML files are missing","Run scripts from the repository root"],"tags":["git","missing-file","dev-tool"],"backgroundTag":"file-not-found","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"}