You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ch...@apache.org on 2022/10/13 01:26:00 UTC
[incubator-eventmesh] branch master updated: [#1518][Brindha] Refactor. replace containsKey() with get() and checking null
This is an automated email from the ASF dual-hosted git repository.
chenguangsheng 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 409697cc [#1518][Brindha] Refactor. replace containsKey() with get() and checking null
new fc6dea96 Merge pull request #1550 from BrindhaEaswaramurthy/Issue-1518
409697cc is described below
commit 409697ccba936cae279af54d210316f088008431
Author: @brindha.e <br...@thoughtworkworks.com>
AuthorDate: Wed Oct 12 21:56:15 2022 +0530
[#1518][Brindha] Refactor. replace containsKey() with get() and checking null
---
.../eventmesh/common/protocol/grpc/protos/BatchMessage.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/BatchMessage.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/BatchMessage.java
index 9b638fc5..b526d064 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/BatchMessage.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/BatchMessage.java
@@ -578,7 +578,11 @@ private static final long serialVersionUID = 0L;
if (key == null) { throw new NullPointerException(); }
java.util.Map<String, String> map =
internalGetProperties().getMap();
- return map.containsKey(key) ? map.get(key) : defaultValue;
+ String value = map.get(key);
+ if(value != null)
+ return map.get(key);
+ else
+ return defaultValue;
}
/**
* <code>map<string, string> properties = 6;</code>
@@ -1403,7 +1407,11 @@ private static final long serialVersionUID = 0L;
if (key == null) { throw new NullPointerException(); }
java.util.Map<String, String> map =
internalGetProperties().getMap();
- return map.containsKey(key) ? map.get(key) : defaultValue;
+ String value = map.get(key);
+ if(value != null)
+ return map.get(key);
+ else
+ return defaultValue;
}
/**
* <code>map<string, string> properties = 6;</code>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org