eight-nines commented on code in PR #3073:
URL: 
https://github.com/apache/incubator-eventmesh/pull/3073#discussion_r1102882690


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigMonitorService.java:
##########
@@ -52,20 +52,16 @@ public void load() {
                 if (configInfo.getObject().equals(object)) {
                     continue;
                 }
-
                 Field field = configInfo.getObjectField();
-                boolean isAccessible = field.isAccessible();
-                try {
-                    field.setAccessible(true);
-                    field.set(configInfo.getInstance(), object);
-                } finally {
-                    field.setAccessible(isAccessible);
-                }
+                field.setAccessible(true);
+                field.set(configInfo.getInstance(), object);
 
                 configInfo.setObject(object);
                 log.info("config reload success: {}", object);
             } catch (Exception e) {
                 log.error("config reload failed", e);
+            } finally {
+                configInfo.getObjectField().setAccessible(false);

Review Comment:
   What I mean is here should save the last accessible status and recovery it 
after custom operation. But you uniformly set it to false. So I don't quite 
understand your intention of this modification, can you elaborate?



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