You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/04/22 05:12:25 UTC

[GitHub] [rocketmq] dugenkui03 commented on pull request #4195: Dledger controller

dugenkui03 commented on PR #4195:
URL: https://github.com/apache/rocketmq/pull/4195#issuecomment-1106017550

   Some suggestion, details in review:
   1. remove unnessary setter;
   2. return copy or unmodified view for getter;
   3. use defensive copy in constructor;
   
   ## Describe in Chinese
   评论中提交了三个建议、适用所有实体定义。请评估。
   1. 移除不必要的 setter、用 final+constroctor 或者 final + builder 替代;
   2. getter中返回保护性拷贝或者 不可修改视图;
   3. 构造函数对于列表使用保护性拷贝。
   
   这些建议的目的均为使得对象安全的创建或者发布,避免可以获取到对象引用或者对象集合字段引用的不可信代码、不恰当的使用导致对象状态被破坏。


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org