Mark SystemEnvironmentPropertySource as immutable
Update `SystemEnvironmentPropertySourceEnvironmentPostProcessor` so that our origin aware subclass is marked as immutable. This aligns with the behavior we had before introducing origin tracking, which assumes that environment variables changes made after the application starts are not re-bound. Closes gh-44859
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -121,6 +121,11 @@ public class SystemEnvironmentPropertySourceEnvironmentPostProcessor implements
|
||||
return this.prefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmutable() {
|
||||
return (Object) getSource() == System.getenv();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user