Class NamedParameterComment
java.lang.Object
com.google.errorprone.bugpatterns.argumentselectiondefects.NamedParameterComment
Helper methods for checking if a commented argument matches a formal parameter and for generating
comments in the right format.
We look for a NamedParameterComment: this is the last block comment before the argument which ends with an equals sign.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA parsed/* name= */or/* name...= */parameter comment. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsSyntheticParameterName(com.sun.tools.javac.code.Symbol.MethodSymbol sym) Returns true if the method has synthetic parameter names, indicating the real names are not available.Parses the text of a block comment (without the surrounding/*and*/) as a named parameter comment of the form `\s*(identifier)(\Q...\E)?
-
Method Details
-
parseParameterComment
public static Optional<NamedParameterComment.ParsedParameterComment> parseParameterComment(String s) Parses the text of a block comment (without the surrounding/*and*/) as a named parameter comment of the form\s*(identifier)(\Q...\E)?\s*=\s*. -
containsSyntheticParameterName
public static boolean containsSyntheticParameterName(com.sun.tools.javac.code.Symbol.MethodSymbol sym) Returns true if the method has synthetic parameter names, indicating the real names are not available.
-