You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by my...@apache.org on 2023/02/16 12:17:41 UTC

[incubator-eventmesh] branch master updated: [ISSUE #3094] Discard redundant defensive NPE

This is an automated email from the ASF dual-hosted git repository.

mytang0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new d506b29f3 [ISSUE #3094] Discard redundant defensive NPE
     new 959d2b0a0 Merge pull request #3172 from Bannirui/fix-3094
d506b29f3 is described below

commit d506b29f363fdde88e9842faf7d4017bfa2141e0
Author: dingrui <ba...@outlook.com>
AuthorDate: Thu Feb 16 16:46:15 2023 +0800

    [ISSUE #3094] Discard redundant defensive NPE
---
 .../client/tcp/impl/cloudevent/CloudEventTCPClient.java       | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/cloudevent/CloudEventTCPClient.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/cloudevent/CloudEventTCPClient.java
index e792fadd5..dce45bf24 100644
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/cloudevent/CloudEventTCPClient.java
+++ b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/cloudevent/CloudEventTCPClient.java
@@ -74,7 +74,7 @@ public class CloudEventTCPClient implements EventMeshTCPClient<CloudEvent> {
 
     @Override
     public void subscribe(String topic, SubscriptionMode subscriptionMode, SubscriptionType subscriptionType)
-            throws EventMeshException {
+        throws EventMeshException {
         cloudEventTCPSubClient.subscribe(topic, subscriptionMode, subscriptionType);
     }
 
@@ -95,13 +95,8 @@ public class CloudEventTCPClient implements EventMeshTCPClient<CloudEvent> {
 
     @Override
     public void close() throws EventMeshException {
-        if (this.cloudEventTCPPubClient != null) {
-            this.cloudEventTCPPubClient.close();
-        }
-
-        if (this.cloudEventTCPSubClient != null) {
-            this.cloudEventTCPSubClient.close();
-        }
+        this.cloudEventTCPPubClient.close();
+        this.cloudEventTCPSubClient.close();
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org