On the 5th line of below code spotted as a bug by the findbugs:
Possible null pointer dereference in com.xyz.common.CommonUtils.FolderNotEmpty(String) due to return value of called method [Troubling(13), Normal confidence]
public static boolean FolderNotEmpty(String path) {
boolean flag = false;
File f = new File(path);
if (f.isDirectory()) {
if (f.listFiles().length > 0) {
flag = true;
LOGGER.info("Folder - " + path + " is not empty.");
} else {
LOGGER.info("Folder - " + path + " is empty.");
}
} else {
LOGGER.warn("The given path is not a directory - " + path);
}
return flag;
}