[PATCH] remove redundant initialization of volatile fields with default values
sergei.tsypanov at yandex.ru
Thu Aug 13 11:04:23 UTC 2020
previously I've sent an email regarding removal of redundant assignments if default values to volatile fields, see
There was a concern whether it's completely safe to remove those assignments from JMM point of view, see
Recently I've found a thread in concurrency-interest mailing list where Aleksey Shiplive tried to find a constraint
agians such removal: http://cs.oswego.edu/pipermail/concurrency-interest/2015-December/014767.html
It appears that there are no constraitns and Doug Lea mentions in
that "there is never any reason to explicitly initialize fields to 0/0.0/false/null"
Also there we similar code changes in java.base before:
So I think now we can accept the patch as the changes appear to be safe.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6253 bytes
Desc: not available
More information about the security-dev