RFR: 8303690: Prefer ArrayList to LinkedList in com.sun.jmx.mbeanserver.Introspector

Serguei Spitsyn sspitsyn at openjdk.org
Wed Mar 8 04:18:12 UTC 2023


On Thu, 2 Mar 2023 20:16:35 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> `LinkedList` is used as value in `com.sun.jmx.mbeanserver.Introspector.SimpleIntrospector#cache`
> It's created, filled (with `add`) and then iterated. No removes from the head or something like this. `ArrayList` should be preferred as more efficient and widely used collection.
> Also I've done some related code cleaned:
> 1. removed redundand `if` from `SoftReference` value check
> 2. fixed a typo in javadoc

Good fix.
Thanks,
Serguei

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

Marked as reviewed by sspitsyn (Reviewer).

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


More information about the serviceability-dev mailing list