RFR(10) 8176192: Incorrect usage of Iterator in Java 8 In com.sun.jndi.ldap.EventSupport.removeNamingListener

Paul Sandoz paul.sandoz at oracle.com
Tue Jun 13 17:17:24 UTC 2017


Hi Vyom,

EventSupport
—

You can achieve the same using an Iterator over the values of the map, thereby simplifying the code.


RemoveNamingListenerTest
—

  50     private static Exception exception;

This should be marked volatile.


Paul.

> On 13 Jun 2017, at 01:30, Vyom Tewari <vyom.tewari at oracle.com> wrote:
> 
> Hi All,
> 
> Please find the code change for below issue.
> 
> BugId      : https://bugs.openjdk.java.net/browse/JDK-8176192
> 
> Webrev   : http://cr.openjdk.java.net/~vtewari/8176192/webrev0.0/index.html
> 
> If the hashtable is structurally modified while enumerating over the values then the results of enumerating are undefined. I used explicit iterator to remove the item from HashTable,  which is clearly specified.
> 
> Thanks,
> 
> Vyom
> 



More information about the core-libs-dev mailing list