RFR: 8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta

Lance Andersen lancea at openjdk.java.net
Fri Jun 10 10:09:05 UTC 2022


On Sat, 28 May 2022 12:00:00 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> Hashtable doesn't allow `null` values. So, instead of pair `containsKey`/`remove` calls, we can directly call `remove` and then compare result with `null`.
> https://github.com/openjdk/jdk/blob/2c461acfebd28fe5ef62805cbb004f91a3b18f08/src/java.base/share/classes/java/util/jar/JarVerifier.java#L433-L436

The changes to doneWithMeta() seem reasonable and the other changes remove unused code so look OK to me

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

Marked as reviewed by lancea (Reviewer).

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


More information about the security-dev mailing list