I am getting a DeadStore warning with Findbugs on int i below. I prefer not to write one-liners due to readability. Is there a better way to write this so that there is not DeadStore to i, but as readable?
if (aqForm.getId() != null) {
try {
int i = Integer.parseInt(aqForm.getId());
aqForm.setId(aqForm.getId().trim());
} catch (NumberFormatException nfe) {
result.rejectValue("id", "error.id", "Please enter an integer.");
foundError = true;
}
}