To me SecurityContextChangedEvent.getCurrentContext() is not clear which context it is without seeing getPreviousContext(). Is current referring to what is just before it fired or is it just after the event fired. I wonder if we could update it so it is clear on its own.

A few ideas:

We could change getCurrentContext to getNextContext This is more clear on its own and aligns with the getPreviousContext name.

Alternatively (I prefer), we could rename getPreviousContext to getOldContext and rename getCurrentContext to getNewContext.

There are likely other options we could consider, but the goal would be to make the name of the method clear on its own which context is which.

Related gh-10226