This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 2516df402 [ISSUE #4215] Correct typos and Remove redundant keyword for
AdminWebHookConfigOperationManager (#4216)
2516df402 is described below
commit 2516df402a242a02f40f23f529c19bef58fd474d
Author: Pil0tXia <[email protected]>
AuthorDate: Fri Jul 14 14:25:35 2023 +0800
[ISSUE #4215] Correct typos and Remove redundant keyword for
AdminWebHookConfigOperationManager (#4216)
* Optimize: Correct oldAccesssible typos to oldAccessible and add comments
* Optimize: Remove redundant transient keyword
---
.../webhook/admin/AdminWebHookConfigOperationManager.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/eventmesh-webhook/eventmesh-webhook-admin/src/main/java/org/apache/eventmesh/webhook/admin/AdminWebHookConfigOperationManager.java
b/eventmesh-webhook/eventmesh-webhook-admin/src/main/java/org/apache/eventmesh/webhook/admin/AdminWebHookConfigOperationManager.java
index 5b4ad167b..5c2899947 100644
---
a/eventmesh-webhook/eventmesh-webhook-admin/src/main/java/org/apache/eventmesh/webhook/admin/AdminWebHookConfigOperationManager.java
+++
b/eventmesh-webhook/eventmesh-webhook-admin/src/main/java/org/apache/eventmesh/webhook/admin/AdminWebHookConfigOperationManager.java
@@ -36,7 +36,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class AdminWebHookConfigOperationManager {
- private static final transient Map<String, Class<? extends
WebHookConfigOperation>> WEBHOOK_CONFIG_OPERATION_MAP
+ private static final Map<String, Class<? extends WebHookConfigOperation>>
WEBHOOK_CONFIG_OPERATION_MAP
= new HashMap<>();
static {
@@ -67,16 +67,19 @@ public class AdminWebHookConfigOperationManager {
final Constructor<? extends WebHookConfigOperation> constructor =
WEBHOOK_CONFIG_OPERATION_MAP.get(operationMode).getDeclaredConstructor(Properties.class);
- final boolean oldAccesssible = constructor.isAccessible();
+ // Save the original accessibility of constructor
+ final boolean oldAccessible = constructor.isAccessible();
try {
constructor.setAccessible(true);
final Properties operationProperties =
adminConfiguration.getOperationProperties();
if (log.isInfoEnabled()) {
log.info("operationMode is {} properties is {} ",
operationMode, operationProperties);
}
+ // Affects which implementation of the WebHookConfigOperation
interface is used.
this.webHookConfigOperation =
constructor.newInstance(operationProperties);
} finally {
- constructor.setAccessible(oldAccesssible);
+ // Restore the original accessibility of constructor
+ constructor.setAccessible(oldAccessible);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]