> public synchronized void finalize() {
Whilst probably harmless, I can't think of a reason to make finalize()
synchronized in this case.
Normally it is called by the VM when the object is unreachable so there
can't
be contention.
If app. code calls it directly then you already synchronized the clear()
method
which is what it calls.
Still, as I say, probably harmless so not a stopper .. so approved.
-phil.
On 01/21/2016 03:30 AM, Jayathirth D V wrote:
Hi,
_Please review the following fix in JDK9:_
__
Bug : https://bugs.openjdk.java.net/browse/JDK-8022640
Webrev : http://cr.openjdk.java.net/~jdv/8022640/webrev.00/
<http://cr.openjdk.java.net/%7Ejdv/8022640/webrev.00/>
Issue : ServiceRegistry (used by ImageIO) lack synchronization.
Root cause : Service Provider API's are not synchronized and
concurrent access to its API's result in ConcurrentModificationException.
Solution : Both ServiceRegistry and IIORegistry use SubRegistry class
for Service Provider API's. Making methods present in SubRegistry
synchronized will help us in achieving synchronization.
Thanks,
Jay