public boolean sendDeviceEvent() {
boolean status = false;
try {
device.sendEvent("blah...blah");
status = true;
} catch (Exception e) {
log.error("Failed to send NodeLowBattery Event - {} {}", createNodeLowBatteryNotification(), e.getCause());
} finally {
return status;
}
}
I would like to know how the above code can be considered bad practise since it returns from finally. Based on the byte code information, finally doesn't return abruptly and no values are set in finally. How can this be considered bad ?