[英]Java: calling super.clone() method, volatile int value not copied in cloned object
I faced one production bug (it happened only once at least in last 1 year). 我遇到了一个生产错误(至少在过去1年中仅发生过一次)。 After investigation I can conclude that super.clone() method was unable to copy an "volatile int" value to the new cloned object . 经过调查,我可以得出结论, super.clone()方法无法将“ volatile int”值复制到新的克隆对象 。
Does anyone faced this problem ever? 有人遇到过这个问题吗?
clone() method is widely used in jdk libraries and this is a basic thing that clone method guarantees. clone()方法在jdk库中广泛使用,这是clone方法保证的基本功能。 Can this happen? 这会发生吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.