I have the code as below:
object a = getObjectFromBlahBlah(); //'a' may possibly be null
try{
a.beginTransaction();
.
.
.
} catch (Exception e) {
logger.debug(e.getMessage());
}
After I run JTest, it will warn me 'a' may possibly be null
. I don't want to do one more checking like if (a == null) return;
since I already cover the NullPointerException
in the try/catch block. Can anyone explain what happen to this? How I can get rid of this warning from JTest by alter the code?