Skip to content

Rename SecurityContextChangedEvent.getCurrentContext() for better clarity #10249

@rwinch

Description

@rwinch

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

Metadata

Metadata

Assignees

Labels

in: coreAn issue in spring-security-coretype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions