Class ErrorMessages

java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ErrorMessages

public class ErrorMessages extends Object
Error messages used by CheckReturnValue.
  • Method Details

    • annotationOnVoid

      public static String annotationOnVoid(String annotation, String elementType)
      Error message for when an annotation used by Rules.mapAnnotationSimpleName(String, ResultUsePolicy) is applied to a void-returning method.
      Parameters:
      elementType - the plural of the ElementType of the annotated element (e.g., "methods").
    • conflictingAnnotations

      public static String conflictingAnnotations(List<String> annotations, String elementType)
      Error message for when annotations mapped to conflicting ResultUsePolicys are applied to the same element.
      Parameters:
      elementType - the ElementType of the annotated element (e.g., "method" or "class").
    • invocationResultIgnored

      public static String invocationResultIgnored(String shortCall, String assignmentToUnused, String apiTrailer)
      Error message for when
      1. the result of a method or constructor invocation is ignored, and
      2. the ResultUsePolicy of the invoked method or constructor evaluates to ResultUsePolicy.EXPECTED.
    • methodReferenceIgnoresResult

      public static String methodReferenceIgnoresResult(String shortCall, String methodReference, String implementedMethod, String assignmentLambda, String apiTrailer)
      Error message for when
      1. a method or constructor is referenced in such a way that its return value would be ignored if invoked through the reference, and
      2. the ResultUsePolicy of the referenced method or constructor evaluates to ResultUsePolicy.EXPECTED.