On Mon, 29 Jun 2026 22:19:39 GMT, April Ivy <[email protected]> wrote:

> As noted in https://bugs.openjdk.org/browse/JDK-8386802, `Util.entryList` and 
> `Util.moduleEntryList` copy their input lists using indexed access. This is 
> fine for `RandomAccess` lists but can be inefficient for 
> sequentially-accessed implementations.
> 
> This patch keeps the existing indexed path for `RandomAccess` lists and falls 
> back to iteration otherwise. Regression coverage is added for 
> non-`RandomAccess` inputs.
> 
> Testing:
> - `make CONF_CHECK=ignore java.base-java images`
> - `make CONF_CHECK=ignore test-only 
> TEST="test/jdk/jdk/classfile/UtilTest.java"`
> - `make CONF_CHECK=ignore test-only TEST="test/jdk/jdk/classfile"`
> - `make CONF_CHECK=ignore test-only TEST="test/jdk:tier1" 
> JTREG="VERBOSE=summary"`
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 92b0565b
Author:    April Ivy <[email protected]>
Committer: Chen Liang <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/92b0565b00fcdae354bd101c762974b47e075f40
Stats:     7 lines in 1 file changed: 2 ins; 0 del; 5 mod

8386802: ClassFile Util.entryList should consider non-RandomAccess lists

Reviewed-by: liach

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

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

Reply via email to