private static Function<PsiElement, ExceptionLineRefiner.RefinerMatchResult> getJep358Extractor(@NonNls String message) {
    if (!message.startsWith("Cannot ")) return null;
    Matcher matcher = NPE_MESSAGE.matcher(message);
    if (!matcher.matches()) return null;
    if (matcher.group("athrow") != null) {
      return NullPointerExceptionInfo::fromThrow;
    }
    if (matcher.group("monitor") != null) {
      return NullPointerExceptionInfo::fromSynchronized;
    }
    if (matcher.group("arraylength") != null) {
      return e -> {
        PsiExpression qualifier = getFieldReferenceQualifier(e, "length");
        return qualifier != null && qualifier.getType() instanceof PsiArrayType
               ? onTheSameLineFor(e, qualifier, false)
               : null;
      };
    }
    String getField = matcher.group("getfield");
    String putField = matcher.group("putfield");
    String field = getField == null ? putField : getField;
    if (field != null) {
      return e -> {
        PsiExpression qualifier = getFieldReferenceQualifier(e, field);
        return qualifier != null && !(qualifier.getType() instanceof PsiArrayType) &&
               storeMatches(qualifier.getParent(), getField == null) ? onTheSameLineFor(e, qualifier, false) : null;
      };
    }
    boolean arrayLoad = matcher.group("xaload") != null;
    boolean arrayStore = matcher.group("xastore") != null;
    if (arrayLoad || arrayStore) {
      return current -> {
        PsiElement e = PsiTreeUtil.nextVisibleLeaf(current);
        if (!(e instanceof PsiJavaToken) || !e.textMatches("[")) return null;
        PsiElement parent = e.getParent();
        if (!(parent instanceof PsiArrayAccessExpression)) return null;
        return storeMatches(parent, arrayStore) ?
               onTheSameLineFor(current, ((PsiArrayAccessExpression)parent).getArrayExpression(), false) :
               null;
      };
    }
    String method = matcher.group("invoke");
    if (method != null) {
      int dotPos = method.lastIndexOf('.');
      if (dotPos != -1) {
        @NonNls String methodName = method.substring(dotPos + 1);
        PsiPrimitiveType type = UNBOXING_METHODS.get(methodName);
        return e -> {
          if (methodName.equals("getClass") || methodName.equals("ordinal")) {
            // x.getClass() was generated as a null-check by javac until Java 9
            // it's still possible that such a code is executed under Java 14+
            ExceptionLineRefiner.RefinerMatchResult result = matchCompilerGeneratedNullCheck(e);
            if (result != null) return result;
          }
          if (type != null) {
            ExceptionLineRefiner.RefinerMatchResult result = fromUnboxing(e, type);
            if (result != null) return result;
          }
          //method call
          PsiElement point = PsiTreeUtil.prevVisibleLeaf(e);
          if (!(point instanceof PsiJavaToken token) || !(token.getTokenType().equals(JavaTokenType.DOT))) return null;
          PsiElement parent = point.getParent();
          if (!(parent instanceof PsiReferenceExpression)) return null;
          if (!(parent.getParent() instanceof PsiMethodCallExpression)) return null;
          if (!methodName.equals(((PsiReferenceExpression)parent).getReferenceName())) return null;
          PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(((PsiReferenceExpression)parent).getQualifierExpression());
          return mayBeNull(qualifier) ? onTheSameLineFor(e, qualifier, false) : null;
        };
      }
    }
    return null;
  }
private static Function<PsiElement, ExceptionLineRefiner.RefinerMatchResult> getJep358Extractor(@NonNls String message)