Class ErrorMessages
java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ErrorMessages
public class ErrorMessages extends Object
Error messages used by
CheckReturnValue
.-
Method Summary
Modifier and Type Method Description static String
annotationOnVoid(String annotation, String elementType)
Error message for when an annotation used byRules.mapAnnotationSimpleName(java.lang.String, com.google.errorprone.bugpatterns.checkreturnvalue.ResultUsePolicy)
is applied to a void-returning method.static String
conflictingAnnotations(List<String> annotations, String elementType)
Error message for when annotations mapped to conflictingResultUsePolicy
s are applied to the same element.static String
invocationResultIgnored(String shortCall, String assignmentToUnused, String apiTrailer)
Error message for when the result of a method or constructor invocation is ignored, and theResultUsePolicy
of the invoked method or constructor evaluates toResultUsePolicy.EXPECTED
.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 theResultUsePolicy
of the referenced method or constructor evaluates toResultUsePolicy.EXPECTED
.
-
Method Details
-
annotationOnVoid
Error message for when an annotation used byRules.mapAnnotationSimpleName(java.lang.String, com.google.errorprone.bugpatterns.checkreturnvalue.ResultUsePolicy)
is applied to a void-returning method.- Parameters:
elementType
- the plural of theElementType
of the annotated element (e.g., "methods").
-
conflictingAnnotations
Error message for when annotations mapped to conflictingResultUsePolicy
s are applied to the same element.- Parameters:
elementType
- theElementType
of 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
ResultUsePolicy
of 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
ResultUsePolicy
of the referenced method or constructor evaluates toResultUsePolicy.EXPECTED
.
-