def _final_is_inside_doc(line, index_of_final, doc_start_symbol):
    """Checks whether the `final` modifier is inside a doc defined by starting symbol.

    Doc starting symbols can be, for example, `//` for the ordinary comment and `*` for the Javadoc.

    Args:
        line: the line to check.
        index_of_final: the index where the `final` keyword is located in the line.
        doc_start_symbol: the symbol defining where the code ends and the doc starts.

    Returns:
        bool: `True` if the `final` modifier is inside a doc and `False` otherwise.
    """
    if doc_start_symbol not in line:
        return False

    doc_start = line.find(doc_start_symbol)
    final_is_part_of_doc = index_of_final > doc_start
    return final_is_part_of_doc