As a matter of style, I try to always write this bit of boilerplate the same. I like to take every chance not to have to make up names. So it's always "saved".
```
val saved = extractUndetparams()
try body
finally undetparams = saved
```
As a separate matter of style, I think curly braces are really ugly and that a finally with one statement isn't improved.