{"record":{"id":"5266b954c41101f9","repo":"languagetool-org/languagetool","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java","lineNumber":712,"sourceCode":"\n    GrammalecteInternalRule(String id, String desc) {\n      this.id = id;\n      this.desc = desc;\n    }\n\n    @Override\n    public String getId() {\n      return id;\n    }\n\n    @Override\n    public String getDescription() {\n      return desc;\n    }\n\n    @Override\n    public RuleMatch[] match(AnalyzedSentence sentence) {\n      throw new RuntimeException(\"Not implemented\");\n    }\n  }\n\n}\n","sourceCodeStart":694,"sourceCodeEnd":717,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java#L694-L717","documentation":"The inner rule object in GrammalecteRule only carries metadata (id, description) fetched from the remote Grammalecte server; actual matching is delegated to remote calls elsewhere. Its local match(AnalyzedSentence) method is intentionally unimplemented and always throws this RuntimeException if called directly.","triggerScenarios":"Any code path invokes match(AnalyzedSentence) on the Grammalecte inner rule instance — e.g. registering the rule in a normal (local) rule set where the engine runs every rule's match() instead of the remote-detection code path.","commonSituations":"Developers adding the Grammalecte rule to a JLanguageTool instance directly; tests invoking match(); custom pipelines that iterate all rules locally, unaware this rule is remote-only.","solutions":["Do not call match() on this rule; rely on GrammalecteRule's remote fetching (ruleMatches) instead.","If you need local execution, remove the Grammalecte rule from the local rule list or guard it behind remote-rule activation settings.","In tests, stub the remote call rather than invoking the inner rule's match()."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (rule instanceof GrammalecteRule.InnerRule) {\n    throw new UnsupportedOperationException(\"This rule only matches remotely; do not call match()\");\n}","typeGuard":"boolean isRemoteOnly = rule.getClass().getName().contains(\"GrammalecteRule\");\nif (isRemoteOnly) { /* skip local match(); use remote path */ }","tryCatchPattern":"try { return rule.match(sentence); } catch (RuntimeException e) { if (e.getMessage().equals(\"Not implemented\")) return new RuleMatch[0]; throw e; }","preventionTips":["Never add the Grammalecte inner rule to a local rule list iterated via match().","Use GrammalecteRule's remote fetching path for these matches.","Guard tests and custom pipelines against remote-only rules."],"tags":["java","languagetool","unsupported-operation","remote-rules"],"backgroundTag":"method-not-implemented","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"}