Withdrawn: 8344246: Unnecessary Hashtable usage in EventSupport.notifiers
duke
duke at openjdk.org
Mon Feb 3 11:57:54 UTC 2025
On Tue, 5 Nov 2024 08:28:10 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
> The field `com.sun.jndi.ldap.EventSupport#notifiers` is always accessed under `lock`. It means extra synchronization from `Hashtable` is not needed.
> Subtle difference in Hashtable vs Hashmap behavior is that Hashtable doesn't allow `null` keys and `null` values. I've checked all usages of it - only non-null keys and values are put into it. So, replacement is safe.
>
> One thing which was suspicous for me is `null` check of value in the `com.sun.jndi.ldap.EventSupport#removeNamingListener` method:
> https://github.com/openjdk/jdk/blob/b54bd824b59b6b5dff9278ddebab4e9e2dfaf57b/src/java.naming/share/classes/com/sun/jndi/ldap/EventSupport.java#L230-L235
> The condition `notifier != null` is always `true`.
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/21894
More information about the core-libs-dev
mailing list