I have below piece of code:
if (null != result[1]) {
mySearchTO.setDt(dateFormat2.parse(result[1].toString()));
} else {
mySearchTO.setDt(null);
}
Where result is a object array and dateFormat2 is a SimpleDateFormat.
Findbugs is giving the following:
A possibly-null value is passed at a call site where all known target methods will unconditionally dereference it. This is very likely to result in a null pointer exception.
What does this message tell ? How to solve this error ?
I am checking the result for null so that my Parse method does not break. But if the result is null, I want to set the Dt field in SearchTO to some default which here I am taking as null.
Is there a better default option for date ?
Thanks for reading!
dataFormat2.parseormySearchTO.setDt? - Gabe