Copilot commented on code in PR #10977:
URL: https://github.com/apache/rocketmq/pull/10977#discussion_r3870571664
##########
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/producer/SendMessageActivity.java:
##########
@@ -311,6 +310,35 @@ protected Map<String, String>
buildMessageProperty(ProxyContext context, apache.
return messageWithHeader.getProperties();
}
+ /**
+ * Length of the UTF-8 encoding of {@code str} without materializing the
byte array.
+ * Matches {@code str.getBytes(StandardCharsets.UTF_8).length}, including
the
+ * single-byte replacement for unpaired surrogates.
+ */
+ protected static int utf8Length(String str) {
Review Comment:
The helper is introduced as `protected static`, which expands the class API
surface largely to support the test. Since the test is in the same package,
consider making this package-private (no modifier) or `private` (and test
indirectly) to avoid exposing it to subclasses/other packages unnecessarily.
--
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]