Class ErrorMessages
java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ErrorMessages
Error messages used by
CheckReturnValue.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringannotationOnVoid(String annotation, String elementType) Error message for when an annotation used byRules.mapAnnotationSimpleName(String, ResultUsePolicy)is applied to a void-returning method.static StringconflictingAnnotations(List<String> annotations, String elementType) Error message for when annotations mapped to conflictingResultUsePolicys are applied to the same element.static StringinvocationResultIgnored(String shortCall, String assignmentToUnused, String apiTrailer) Error message for when the result of a method or constructor invocation is ignored, and theResultUsePolicyof the invoked method or constructor evaluates toResultUsePolicy.EXPECTED.static StringmethodReferenceIgnoresResult(String shortCall, String methodReference, String implementedMethod, String assignmentLambda, String apiTrailer) Error message for when a method or constructor is referenced in such a way that its return value would be ignored if invoked through the reference, and theResultUsePolicyof the referenced method or constructor evaluates toResultUsePolicy.EXPECTED.
-
Method Details
-
annotationOnVoid
Error message for when an annotation used byRules.mapAnnotationSimpleName(String, ResultUsePolicy)is applied to a void-returning method.- Parameters:
elementType- the plural of theElementTypeof the annotated element (e.g., "methods").
-
conflictingAnnotations
Error message for when annotations mapped to conflictingResultUsePolicys are applied to the same element.- Parameters:
elementType- theElementTypeof the annotated element (e.g., "method" or "class").
-
invocationResultIgnored
public static String invocationResultIgnored(String shortCall, String assignmentToUnused, String apiTrailer) Error message for when- the result of a method or constructor invocation is ignored, and
- the
ResultUsePolicyof the invoked method or constructor evaluates toResultUsePolicy.EXPECTED.
-
methodReferenceIgnoresResult
public static String methodReferenceIgnoresResult(String shortCall, String methodReference, String implementedMethod, String assignmentLambda, String apiTrailer) Error message for when- a method or constructor is referenced in such a way that its return value would be ignored if invoked through the reference, and
- the
ResultUsePolicyof the referenced method or constructor evaluates toResultUsePolicy.EXPECTED.
-