WJL3333 commented on a change in pull request #3965:
URL: https://github.com/apache/rocketmq/pull/3965#discussion_r826577553
##########
File path:
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java
##########
@@ -292,15 +289,20 @@ public CommandCustomHeader decodeCommandCustomHeader(
}
private Field[] getClazzFields(Class<? extends CommandCustomHeader>
classHeader) {
- Field[] field = CLASS_HASH_MAP.get(classHeader);
+ Field[] fields = CLASS_HASH_MAP.get(classHeader);
- if (field == null) {
- field = classHeader.getDeclaredFields();
+ if (fields == null) {
+ fields = classHeader.getDeclaredFields();
+
+ fields = Arrays.stream(fields)
Review comment:
fixed. and this remind me to avoid create new Field[] here which improve
the performance! thank you~
--
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]