mxsm commented on code in PR #3073:
URL: 
https://github.com/apache/incubator-eventmesh/pull/3073#discussion_r1102376299


##########
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:
   > The value of the property before the object was modified cannot be 
obtained here;Also, the value of the previous property is not necessarily 
false;What do you think?
   
   Hi @eight-nines Here is the Java method description
   
   
![image](https://user-images.githubusercontent.com/15797831/218028626-250a9280-71ec-48bb-aed8-00b3a566cac1.png)
   if there is a security manager, its checkPermission method is called with a 
ReflectPermission("suppressAccessChecks") permission. Instead of saying that 
the property becomes public when it's private.
   



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