[hyddd的FindBugs分析记录][M V EI] May expose internal representation by returning reference to mutable object
2009-02-16 09:15 hyddd 阅读(7238) 评论(0) 编辑 收藏 举报[M V EI] May expose internal representation by returning reference to mutable object [EI_EXPOSE_REP]
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
这个问题的解决方案和[M V EI2] May expose internal representation by incorporating reference to mutable object很类似,可以参考:http://www.cnblogs.com/hyddd/articles/1391118.html
作者:hyddd
出处:http://www.cnblogs.com/hyddd/
本文版权归作者所有,欢迎转载,演绎或用于商业目的,但是必须说明本文出处(包含链接)。