funky-eyes commented on code in PR #7705:
URL: https://github.com/apache/incubator-seata/pull/7705#discussion_r2438433998
##########
seata-spring-autoconfigure/seata-spring-autoconfigure-core/src/main/java/org/apache/seata/spring/boot/autoconfigure/loader/SeataPropertiesLoader.java:
##########
@@ -60,10 +60,7 @@ public class SeataPropertiesLoader implements
ApplicationContextInitializer<Conf
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
ConfigurableEnvironment environment =
applicationContext.getEnvironment();
- if
(ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT) ==
null) {
- ObjectHolder.INSTANCE.setObject(
- OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT,
applicationContext.getEnvironment());
- }
+
ObjectHolder.INSTANCE.setObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT,
environment);
Review Comment:
Can you explain why this change was made?
What's the difference between setting the environment only when it's empty
and setting it unconditionally (without checking for emptiness)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]