How does the classes Match.java and MatchState.java works ?

Hello,
I am still trying to fix issue #7773, after using the git grep command, I managed to navigate and locate the potential problem. Indeed, I found where the error message is assembled then returned to be displayed, it is located in language-tool-core/src/java/.../rules/patterns/PatternRuleMatcher.java after a few tests, I could locate the problem in this fonction :

/**
   * Concatenates the matches, and takes care of phrases (including inflection
   * using synthesis).
   * @param start Position of the element as referenced by match element in the rule.
   * @param index The index of the element found in the matching sentence.
   * @param tokenIndex The position of the token in the AnalyzedTokenReadings array.
   * @param tokens Array of AnalyzedTokenReadings
   * @return @String[] Array of concatenated strings
   */
  private String[] concatMatches(int start, int index,
      int tokenIndex, AnalyzedTokenReadings[] tokens,
      int nextTokenPos, List<Match> suggestionMatches)
          throws IOException {
    String[] finalMatch;
    int len = phraseLen(index);
    Language language = rule.language;
    if (len == 1) {
      int skippedTokens = nextTokenPos - tokenIndex;
      MatchState matchState = suggestionMatches.get(start).createState(language.getSynthesizer(), tokens, tokenIndex - 1, skippedTokens);
      finalMatch = matchState.toFinalString(language);
      //System.out.println("concat\n" + finalMatch[0]);
    } else {
      List<String[]> matchList = new ArrayList<>();
      for (int i = 0; i < len; i++) {
        int skippedTokens = nextTokenPos - (tokenIndex + i);
        MatchState matchState = suggestionMatches.get(start).createState(language.getSynthesizer(), tokens, tokenIndex - 1 + i, skippedTokens);
        matchList.add(matchState.toFinalString(language));
      }
      return combineLists(matchList.toArray(new String[matchList.size()][]),
          new String[matchList.size()], 0, language);
    }
    return finalMatch;
  }

More particularly in these lines :

int skippedTokens = nextTokenPos - tokenIndex;
MatchState matchState = suggestionMatches.get(start).createState(language.getSynthesizer(), tokens, tokenIndex - 1, skippedTokens);
finalMatch = matchState.toFinalString(language);

From what I managed to test, everything is fine until we get there, and that’s when difficulties arise. After creating an object MatchState by using the function createState() from Match.java and/or calling toFinalString() from MatchState.java, is when the error message is created incorrectly. So in order to resolve this, I need to investigate these leads but these two classes are quite dense and I am not sure I understand how they process data and then use it to do their jobs properly. Could anyone with experience with these classes help me ?