code: @SuppressWarnings("resource")
    protected synchronized List<AbstractPatternRule> getPatternRules() throws IOException {
      // use lazy loading to speed up server use case and start of stand-alone LT, where all the languages get initialized:
      if (patternRules == null) {
        List<AbstractPatternRule> rules = new ArrayList<>();
        PatternRuleLoader ruleLoader = new PatternRuleLoader();
        for (String fileName : getRuleFileNames()) {
          InputStream is = null;
          try {
            is = this.getClass().getResourceAsStream(fileName);
            boolean ignore = false;
            if (is == null) {                     // files loaded via the dialog
              try {
                is = new FileInputStream(fileName);
              } catch (FileNotFoundException e) {
                if (fileName.contains("-test-")) {
                  // ignore, used for testing
                  ignore = true;
                } else {
                  throw e;
                }
              }
            }
            if (!ignore) {
              rules.addAll(ruleLoader.getRules(is, fileName));
              patternRules = Collections.unmodifiableList(rules);
            }
          } finally {
            if (is != null) {
              is.close();
            }
          }
        }
      }
      return patternRules;
    }
docs: Get the pattern rules as defined in the files returned by {@link #getRuleFileNames()}.
  @since 2.7