Note that there are some explanatory texts on larger screens.

plurals
  1. POPerpetuation of boolean value while passed inside multiple function calls
    primarykey
    data
    text
    <p>In the below code, will the cahnges made to the Boolean value modifyPerson within the function be maintained or will it change to its initial value each time a new function is called.</p> <p>Also i would like to know what difference is there if i use primitive boolean modifyPerson instead of Boolean .</p> <pre><code>public void validatePersonDTO(PersonDTO personDTO, TransactionLogDTO logDTO,ArrayList regionIdList,Boolean modifyPerson) { try { validateEffectiveIn(personDTO, logDTO,modifyPerson); validateCdsId(personDTO, logDTO,regionIdList,modifyPerson); validateEmpFirstName(personDTO, logDTO); validateEmpLastName(personDTO, logDTO); validateFinDept(personDTO, logDTO,modifyPerson); validateEmployeeClass(personDTO, logDTO,modifyPerson); validateWorkLoadandBudgetFTE(personDTO, logDTO,modifyPerson); validateStatusandDescription(personDTO, logDTO,modifyPerson); validateSalGrade(personDTO, logDTO); validateCostRate(personDTO, logDTO); validateJobCode(personDTO, logDTO,modifyPerson); validateRateCardCharged(personDTO, logDTO); validateSupervisorId(personDTO, logDTO); }catch (Exception e) { logDTO.setGyr("R"); logDTO.setMessage(logDTO.getMessage()+";"+"PersonDTO could not be validated"); //LOGGER.error("personDTO could not be validated: " + personDTO, e); } } protected void validateEffectiveIn(PersonDTO personDTO, TransactionLogDTO logDTO,boolean modifyPerson) throws Exception{ todaysDate=convStringToDate(now(),Constants.DATE_PATTERN_LONG); if(effIn.after(todaysDate)){ modifyPerson=true; logDTO.setGyr("R"); logDTO.setMessage(logDTO.getMessage()+";"+"Error in Effective In date "+effIn.toString()+"cannot be greater than today’s date"); throw new Exception ("Error in Effective In date "+effIn.toString()+"cannot be greater than today’s date"); } else{ modifyPerson=false; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload