Copilot commented on code in PR #16267:
URL: https://github.com/apache/dubbo/pull/16267#discussion_r3224806249


##########
dubbo-plugin/dubbo-mcp/src/main/java/org/apache/dubbo/mcp/transport/DubboMcpStreamableTransportProvider.java:
##########
@@ -88,7 +88,7 @@ public DubboMcpStreamableTransportProvider(ObjectMapper 
objectMapper, Integer ex
             expireSeconds = 60;
         }
         sessions = new ExpiringMap<>(expireSeconds, 30);
-        this.objectMapper = objectMapper;
+        this.mcpJsonMapper = mcpJsonMapper;
         sessions.getExpireThread().startExpiryIfNotStarted();

Review Comment:
   `mcpJsonMapper` is assigned without a null-check in the constructor, unlike 
`DubboMcpSseTransportProvider` which enforces non-null via 
`Objects.requireNonNull(...)`. Since `mcpJsonMapper` is used for JSON 
serialization/deserialization throughout the provider, passing null would defer 
failure until runtime and be harder to diagnose. Please enforce non-null in the 
constructor (and ideally add a clear message) for consistency and fail-fast 
behavior.



-- 
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]

Reply via email to