You can just write this as return keychain.getLookaheadThreshold() inside the lock. No need for an additional variable. Finally blocks execute on return statements.