funky-eyes commented on code in PR #7705:
URL: https://github.com/apache/incubator-seata/pull/7705#discussion_r2442412187


##########
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:
   So, in Spring Cloud there can be multiple Environment instances, which is 
why the environment may be incomplete. Otherwise, as I understand it, the same 
instance shouldn't have this problem, right?



-- 
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]

Reply via email to