Skip to content

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

Open
aprilivy wants to merge 1 commit into
openjdk:masterfrom
aprilivy:8386802-classfile-non-random-access-lists
Open

8386802: ClassFile Util.entryList should consider non-RandomAccess lists#31719
aprilivy wants to merge 1 commit into
openjdk:masterfrom
aprilivy:8386802-classfile-non-random-access-lists

Conversation

@aprilivy

@aprilivy aprilivy commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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"


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8386802: ClassFile Util.entryList should consider non-RandomAccess lists (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31719/head:pull/31719
$ git checkout pull/31719

Update a local copy of the PR:
$ git checkout pull/31719
$ git pull https://git.openjdk.org/jdk.git pull/31719/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31719

View PR using the GUI difftool:
$ git pr show -t 31719

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31719.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 29, 2026

Copy link
Copy Markdown

👋 Welcome back aprilivy! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 29, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the core-libs core-libs-dev@openjdk.org label Jun 29, 2026
@openjdk

openjdk Bot commented Jun 29, 2026

Copy link
Copy Markdown

@aprilivy The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 29, 2026
@aprilivy

Copy link
Copy Markdown
Contributor Author

@liach could you take a look? Thanks!

@mlbridge

mlbridge Bot commented Jun 29, 2026

Copy link
Copy Markdown

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant