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 09094b8fe [ISSUE #4018] Code optimization.[ProducerManager]
09094b8fe is described below
commit 09094b8fe45a4a81d42ac1dabf7baa7950c8d9f2
Author: Harshitha Sudhakar
<[email protected]>
AuthorDate: Thu Jul 20 07:09:39 2023 +0530
[ISSUE #4018] Code optimization.[ProducerManager]
Added `final` in lines 31,33.
Removed the redundant `null` initialization at lines 48 and 69.
---
.../runtime/core/protocol/http/producer/ProducerManager.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/producer/ProducerManager.java
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/producer/ProducerManager.java
index 2e21ec2c2..b10e7136e 100644
---
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/producer/ProducerManager.java
+++
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/producer/ProducerManager.java
@@ -28,9 +28,9 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ProducerManager {
- private EventMeshHTTPServer eventMeshHTTPServer;
+ private final EventMeshHTTPServer eventMeshHTTPServer;
- private ConcurrentHashMap<String /** groupName*/, EventMeshProducer>
producerTable = new ConcurrentHashMap<String, EventMeshProducer>();
+ private final ConcurrentHashMap<String /** groupName*/, EventMeshProducer>
producerTable = new ConcurrentHashMap<String, EventMeshProducer>();
public ProducerManager(EventMeshHTTPServer eventMeshHTTPServer) {
this.eventMeshHTTPServer = eventMeshHTTPServer;
@@ -45,7 +45,7 @@ public class ProducerManager {
}
public EventMeshProducer getEventMeshProducer(String producerGroup) throws
Exception {
- EventMeshProducer eventMeshProducer = null;
+ EventMeshProducer eventMeshProducer;
if (!producerTable.containsKey(producerGroup)) {
synchronized (producerTable) {
if (!producerTable.containsKey(producerGroup)) {
@@ -66,7 +66,7 @@ public class ProducerManager {
}
public EventMeshProducer getEventMeshProducer(String producerGroup, String
token) throws Exception {
- EventMeshProducer eventMeshProducer = null;
+ EventMeshProducer eventMeshProducer;
if (!producerTable.containsKey(producerGroup)) {
synchronized (producerTable) {
if (!producerTable.containsKey(producerGroup)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]