Skip to content

Guard against ConcurrentModificationExceptions in the systemProperties PropertySource #23063

@philwebb

Description

@philwebb

The StandardEnvironment currently adds a MapPropertySource containing System.getProperties() to allow them to be used from the Environment. Since the underlying Properties can be changed in other threads, it's possible that calls to propertySource.getPropertyNames() will throw a ConcurrentModificationException.

This can be seen in the following Spring Boot issue. Although we can add guards in the Spring Boot code, It might be useful if these exceptions could be handled transparently by the property source.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions