I'm working on upgrading to Checker Frameowrk 3.47.0 from 3.42.0.
I cam across the error below.
/home/jpschewe/projects/fll-sw/working-dir/src/main/java/fll/documents/writers/SubjectivePdfWriter.java:405: error: [methodref.receiver] Incompatible receiver type
.anyMatch(Goal::isRequired);
^
found : @Initialized @NonNull Goal
required: @Initialized @PolyNull Goal
Consequence: method in @Initialized @NonNull Goal
@Initialized @NonNull boolean isRequired(@Initialized @NonNull Goal this)
is not a valid method reference for method in @Initialized @NonNull Predicate<@Initialized @PolyNull Goal>
@Initialized @NonNull boolean test(@Initialized @NonNull Predicate<@Initialized @PolyNull Goal> this, @Initialized @PolyNull Goal p0)
The method signature on isRequire is below:
public boolean isRequired() {
Changing the method signature to this removes the error:
public boolean isRequired(@PolyNull Goal this) {
I read about PolyNull and I'm not sure how "this" being able to be null makes sense. Is this really the right way to correct this error? Is this a bug? Am I missing something else?
Jon