I am using PMD tool in eclipse for reviewing code.I am unable to find a solution for the warning message "There is log block surrounded by if " for the line of code - >log.error("exception "+e);
However the same warning message goes away for log.info when i write if(log.isInfoEnabled())
log.info("notification ");
How can we fix the issue for log.error? It doesn't accept below code :
if(log.isInfoEnabled())
log.error("exception "+e);
Anybody have come across same issue and found a solution please advice. Thanks