We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ea4d44 commit fba919bCopy full SHA for fba919b
core/src/main/java/com/google/errorprone/bugpatterns/CheckReturnValue.java
@@ -110,7 +110,9 @@ private static Optional<MethodSymbol> methodSymbol(ExpressionTree tree) {
110
111
@Override
112
public boolean isCovered(ExpressionTree tree, VisitorState state) {
113
- return methodSymbol(tree).flatMap(CheckReturnValue::firstAnnotation).isPresent();
+ return methodSymbol(tree)
114
+ .map(m -> (checkAllConstructors && m.isConstructor()) || firstAnnotation(m).isPresent())
115
+ .orElse(false);
116
}
117
118
0 commit comments