Aias00 opened a new issue, #6580:
URL: https://github.com/apache/shenyu/issues/6580

   ## Description
   `ObjectMapper` construction is expensive (builds 
TypeFactory/serializers/mixins) and is constructed per request. The project 
already has `org.apache.shenyu.common.utils.JsonUtils.MAPPER`.
   
   ## Location
   ```
   shenyu-plugin-mcp-server/.../McpServerPlugin.java:710 (new 
ObjectMapper().writeValueAsString(errorBody))
   shenyu-plugin-mcp-server/.../transport/MessageHandlingResult.java:93 (new 
ObjectMapper().writeValueAsString(responseBody))
   ```
   
   ## Impact
   Per-MCP-request ObjectMapper allocation on top of the serialization itself.
   
   ## Suggested fix
   Reuse a static `ObjectMapper` (or `JsonUtils`). Line 710 also uses 
`errorResponse.getBytes()` (default charset) — use `StandardCharsets.UTF_8`.
   
   ## Related existing issue(s)
   None
   
   _Identified during the 2026-08-02 audit; full list in 
[`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._


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

Reply via email to