chickenlj commented on a change in pull request #9382:
URL: https://github.com/apache/dubbo/pull/9382#discussion_r769286719
##########
File path:
dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/MetadataInfo.java
##########
@@ -379,34 +382,34 @@ private String getMethodSignaturesString() {
}
public void addParameter(String key, String value) {
- if (consumerParams != null) {
+ if (CollectionUtils.isNotEmptyMap(consumerParams)) {
this.consumerParams.put(key, value);
}
}
public void addParameterIfAbsent(String key, String value) {
- if (consumerParams != null) {
+ if (CollectionUtils.isNotEmptyMap(consumerParams)) {
this.consumerParams.putIfAbsent(key, value);
}
}
public void addConsumerParams(Map<String, String> params) {
// copy once for one service subscription
- if (consumerParams == null) {
+ if (CollectionUtils.isEmptyMap(consumerParams)) {
consumerParams = new HashMap<>(params);
}
}
public Map<String, Number> getNumbers() {
// concurrent initialization is tolerant
- if (numbers == null) {
+ if (CollectionUtils.isEmptyMap(numbers)) {
Review comment:
`isEmptyMap` and `==null` do not have the same meaning here.
--
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]