diff options
Diffstat (limited to 'value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java')
-rw-r--r-- | value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java b/value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java index b0872009..591b0cc8 100644 --- a/value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java +++ b/value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java @@ -403,6 +403,13 @@ abstract class BuilderMethodClassifier<E extends Element> { TypeMirror returnType = methodMirror.getReturnType(); if (typeUtils.isSubtype(builderType.asType(), returnType) && !MoreTypes.isTypeOf(Object.class, returnType)) { + if (nullableAnnotationFor(method, returnType).isPresent()) { + errorReporter. + reportWarning( + method, + "[%sBuilderSetterNullable] Setter methods always return the Builder so @Nullable" + + " is not appropriate", autoWhat()); + } // We allow the return type to be a supertype (other than Object), to support step builders. TypeMirror parameterType = Iterables.getOnlyElement(methodMirror.getParameterTypes()); propertyNameToSetters.put( |