Similar to #52, sometimes programmers write @NonNull on Optional types. Unlike AutoValue, Lombok has no built-in support for this, so there's no equivalent thing to do for Lombok.
However, we still get false positives like this:
@lombok.Builder
public class Foo {
@lombok.NonNull Optional<String> bar;
public static class FooBuilder {
private Optional<String> foo = Optional.empty();
}
}
That is, the builder defaults the optional to being empty, and Lombok generates the rest - making the @NonNull annotation redundant.
This problem, however, is more general: a programmer could set a default in this manner even for non-optional fields, and we would issue a false positive expecting that field to be set.
Similar to #52, sometimes programmers write
@NonNullonOptionaltypes. Unlike AutoValue, Lombok has no built-in support for this, so there's no equivalent thing to do for Lombok.However, we still get false positives like this:
That is, the builder defaults the optional to being empty, and Lombok generates the rest - making the
@NonNullannotation redundant.This problem, however, is more general: a programmer could set a default in this manner even for non-optional fields, and we would issue a false positive expecting that field to be set.