RFR: 8303832: Use enhanced-for cycle instead of Enumeration in JceKeyStore

Sean Mullan mullan at openjdk.org
Thu Mar 9 16:19:27 UTC 2023


On Thu, 9 Mar 2023 00:14:33 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> java.util.Enumeration is a legacy interface from java 1.0.
>> There is couple of places with cycles which use it to iterate over collections. We can replace this manual cycle with enchanced-for, which is shorter and easier to read.
>
> `Enumeration` is legacy because `Hashtable` behind it is legacy. But is it worth modifying `Hashtable` to `ConcurrentHashMap`? IMHO no.

To add to @wangweij comment, I'll point out that "JCEKS" is a legacy keystore type that is no longer recommended [1]. At this point, putting any additional work into this code (other than fixing bugs) is probably not worth it. I suggest closing this issue as "Won't Fix".

[1] https://bugs.openjdk.org/browse/JDK-8182879

-------------

PR: https://git.openjdk.org/jdk/pull/12930


More information about the security-dev mailing list