You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MapPropertySource.containsProperty() method is not currently implemented directly, instead the EnumerablePropertySource implementation is used. This means for each containsProperty() call map keys are converted to an array then iterated.
We can improve performance by looking in the map directly.
This change unfortunately has a side effect for SystemEnvironmentPropertySource (which extends MapPropertySource): When used with an active JVM SecurityManager, it may fail when checking the availability of property naming variants. Our EnvironmentSecurityManagerIntegrationTests does fail on Windows for that reason.
Modifying SystemEnvironmentPropertySource to not call super.containsProperty anymore but rather to perform the default check against getPropertyNames() as we used to do before makes the problem go away. This should be a fine compromise, with the regular MapPropertySource still being able to perform an optimized containsProperty lookup.
Phil Webb opened SPR-12224 and commented
The
MapPropertySource.containsProperty()
method is not currently implemented directly, instead theEnumerablePropertySource
implementation is used. This means for eachcontainsProperty()
call map keys are converted to an array then iterated.We can improve performance by looking in the map directly.
Affects: 4.1 GA
Referenced from: commits 587a816, e71fbb9, 752574d, 65cc57d
The text was updated successfully, but these errors were encountered: