Skip to content

Conversation

rmartinus
Copy link
Contributor

Fixes #5834
Improve code by using Java 8's computeIfAbsent()

}
}

Set<String> sessionsUsedByPrincipal = principals.computeIfAbsent(principal, key -> new CopyOnWriteArraySet<>());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Local variable is needed here for logger when trace is enabled

@rwinch rwinch changed the title gh-5834: Use computeIfAbsent SessionRegistryImpl uses computeIfAbsent Dec 4, 2018
@rwinch
Copy link
Member

rwinch commented Dec 4, 2018

Thanks for the PR @rmartinus!

Can you please update the commit message to align with the Spring Security conventions?

Something like:

SessionRegistryImpl uses computeIfAbsent

Fixes: gh-5834

@rmartinus
Copy link
Contributor Author

Not a problem @rwinch
I have amended the commit as requested

@rwinch rwinch self-assigned this Dec 5, 2018
@rwinch rwinch added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement labels Dec 5, 2018
@rwinch rwinch added this to the 5.2.0.M1 milestone Dec 5, 2018
@rwinch rwinch merged commit 090000c into spring-projects:master Dec 5, 2018
@rwinch rwinch added the status: duplicate A duplicate of another issue label Dec 5, 2018
@rwinch
Copy link
Member

rwinch commented Dec 5, 2018

Thanks @rmartinus! This is now merged into master and backported to 5.1.x and 5.0.x via #6232 #6233

@rmartinus rmartinus deleted the gh-5834 branch December 5, 2018 19:03
@rmartinus
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants