Findbugs triggers NP_NULL_PARAM_DEREF_NONVIRTUAL in the below statement
I can't figure out why findbugs recognize registerationdate as nonnull parameter. I can see the second constructor checks nullness of registerationdate. Therefore, null deref is not probable.
Is this bug, false positive or findbugs has another mechanism to check the nonnull of a parameter?
Many thanks in advance, Zahra
Participant seppl = new Participant( "Mayer", "Seppel", null);
Participant has two constructors:
public Participant() {
surname = "";
forename = "";
registrationDate = new Date();
}
public Participant (String surname, String forename, Date registrationDate) {
setSurname(surname);
setForename(forename);
setRegistrationDate(registrationDate);
}
public void setRegistrationDate (Date registrationDate) {
if (registrationDate != null
&& !registrationDate.equals(this.registrationDate)) {
this.registrationDate = registrationDate;
}
}