Skip to content

Commit 5da5544

Browse files
committed
Polish SecurityContextChangedEvent
- Changed methods to getOldContext and getNewContext Closes gh-10249
1 parent 3e87ef8 commit 5da5544

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

core/src/main/java/org/springframework/security/core/context/SecurityContextChangedEvent.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,37 @@
2626
*/
2727
public class SecurityContextChangedEvent extends ApplicationEvent {
2828

29-
private final SecurityContext previous;
29+
private final SecurityContext oldContext;
3030

31-
private final SecurityContext current;
31+
private final SecurityContext newContext;
3232

3333
/**
3434
* Construct an event
35-
* @param previous the old security context
36-
* @param current the new security context
35+
* @param oldContext the old security context
36+
* @param newContext the new security context
3737
*/
38-
public SecurityContextChangedEvent(SecurityContext previous, SecurityContext current) {
38+
public SecurityContextChangedEvent(SecurityContext oldContext, SecurityContext newContext) {
3939
super(SecurityContextHolder.class);
40-
this.previous = previous;
41-
this.current = current;
40+
this.oldContext = oldContext;
41+
this.newContext = newContext;
4242
}
4343

4444
/**
4545
* Get the {@link SecurityContext} set on the {@link SecurityContextHolder}
4646
* immediately previous to this event
4747
* @return the previous {@link SecurityContext}
4848
*/
49-
public SecurityContext getPreviousContext() {
50-
return this.previous;
49+
public SecurityContext getOldContext() {
50+
return this.oldContext;
5151
}
5252

5353
/**
5454
* Get the {@link SecurityContext} set on the {@link SecurityContextHolder} as of this
5555
* event
5656
* @return the current {@link SecurityContext}
5757
*/
58-
public SecurityContext getCurrentContext() {
59-
return this.current;
58+
public SecurityContext getNewContext() {
59+
return this.newContext;
6060
}
6161

6262
}

0 commit comments

Comments
 (0)