Here is Some Code written by some of my Senior team member.
private void getYourObjectByID(final long someId) {
TypedQuery<LoanBusinessIndustry> v_objQuery;
try {
//Some Code JPA Read Write To Database
} catch (final Exception ex) { //is final here makes any sense ?
System.err.println("exception get at query getLoanBusinessIndustry=>" + ex.getMessage());
this.logger.error("No Data found for getLoanBusinessIndustry=>" + ex.toString());
}
}
In Parameter of Method getYourObjectByID(final long someId)
making Id as a Final make sense. someId
Value should not change because Data Objects
are fetched from db
according to someId
But........
//Complete Catch Block Implemented Code.
catch (final Exception ex) { //is final here makes any sense ?
System.err.println("exception get at query =>" + ex.getMessage());
this.logger.error("No Data found for =>" + ex.toString());
}
In catch()
Block making Exception
Class Object ex
as final
. Is it really make sense because we are handling this exception with in this Catch
Block Itself not trying to Rethrow
.
Question: Does Final Keyword used in
catch
make any Sense or not ?????