Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ConcurrentHashMap.newKeySet where feasible #32294

Closed

Conversation

kilink
Copy link
Contributor

@kilink kilink commented Feb 19, 2024

In places where a ConcurrentHashMap was used as a set by wrapping it with Collections.newSetFromMap, switch to just using the set returned by ConcurrentHashMap.newKeySet directly.

In places where a ConcurrentHashMap was used as a set by wrapping it with Collections.newSetFromMap,
switch to just using the set returned by ConcurrentHashMap.newKeySet directly.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 19, 2024
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Feb 19, 2024
@jhoeller jhoeller added this to the 6.2.0-M1 milestone Feb 19, 2024
@snicoll snicoll removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 20, 2024
@@ -16,7 +16,6 @@

package org.springframework.beans.factory.support;

import java.util.Collections;
Copy link
Member

Choose a reason for hiding this comment

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

Surprise: I just noticed that 902e570 introduced additional usage of java.util.Collections, so the code no longer compiles when merged into main.

Though fret not: I'll add the import back locally. 😉

@sbrannen sbrannen closed this in f9fe8ef Feb 21, 2024
sbrannen added a commit that referenced this pull request Feb 21, 2024
@sbrannen
Copy link
Member

This has been merged into main.

Thanks

@sbrannen sbrannen changed the title Use ConcurrentHashMap.newKeySet Use ConcurrentHashMap.newKeySet where feasible Mar 10, 2024
@kilink kilink deleted the concurrent-hash-map-key-set branch March 15, 2024 20:01
izeye added a commit to izeye/spring-boot that referenced this pull request Apr 29, 2024
izeye added a commit to izeye/spring-boot that referenced this pull request Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants