Is it necessary to return something when using return inside changeCompany

I need to add a control inside changeCompany()to an existing class.

I believe that the code below is OK, but I have doubts: does “return” mean returning to the original company? Or do I need to add an expression unknown to me, something like revertToPreviousCompany()?

try
{
    changeCompany(companyId)
    {
        // the method will produce a message and return false if an error
        if (!this.doSomeChecks()) {               
           return;
        }          
        // much more code below 
+4
source share
1 answer

, , , .
-, try - catch , , , , , , , , changeCompany

+6

Source: https://habr.com/ru/post/1653310/


All Articles