zrlw commented on code in PR #15987:
URL: https://github.com/apache/dubbo/pull/15987#discussion_r2681007158
##########
dubbo-metadata/dubbo-metadata-api/src/test/java/org/apache/dubbo/metadata/report/identifier/MetadataIdentifierTest.java:
##########
@@ -55,4 +57,13 @@ void testGetUniqueKey() {
+ MetadataConstants.KEY_SEPARATOR
+ application);
}
+
+ @Test
+ void testPutDuplicateIdentifier() {
+ ConcurrentHashMap<MetadataIdentifier, Object> map = new
ConcurrentHashMap<>();
+ map.put(new MetadataIdentifier("com.ServiceInterface", "1.0.0",
"gray", "consumer", "testApp"), null);
Review Comment:
Could not put null value to ConcurrentHashMap since
```
public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
implements ConcurrentMap<K,V>, Serializable {
...
final V putVal(K key, V value, boolean onlyIfAbsent) {
if (key == null || value == null) throw new NullPointerException();
...
```
--
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]