Class CommentCountValidator
java.lang.Object
com.google.gerrit.server.git.validators.CommentCountValidator
- All Implemented Interfaces:
CommentValidator
Limits number of comments to prevent space/time complexity issues.
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<CommentValidationFailure>
validateComments
(CommentValidationContext ctx, com.google.common.collect.ImmutableList<CommentForValidation> comments) Validate the specified comments.
-
Method Details
-
validateComments
public com.google.common.collect.ImmutableList<CommentValidationFailure> validateComments(CommentValidationContext ctx, com.google.common.collect.ImmutableList<CommentForValidation> comments) Description copied from interface:CommentValidator
Validate the specified comments. This method will be called once with thecomments
argument containing all new comments that need to be validated and (if applicable) the new change message. This allows validators to statelessly count the new comments. Note that after this one call the method may be called again one or more times for texts that are not comments, but similar in nature.NOTE: Autogenerated change messages are not subject to validation.
- Specified by:
validateComments
in interfaceCommentValidator
- Returns:
- An empty list if all comments are valid, or else a list of validation failures.
-