Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

Introduce AbstractImageHeapList as a super type for HostedImageHeapList and RuntimeImageHeapList. This allows declaring a more restricted type for fields initialized with ImageHeapList#create(Class) to aid open-world analysis. When such a field is analysed in an open-world it gets injected all possible subtypes of its declared type. Declaring the type as AbstractImageHeapList allows us to only inject RuntimeImageHeapList.This enables a more precise analysis and avoids for example triggering false-positive violations of @RestrictHeapAccess: if the field was declared as List then implementations of List for which simple access operations can allocate, such as ArrayList#get(int), could become reachable from code annotated with @RestrictHeapAccess.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 9, 2025
@graalvmbot graalvmbot merged commit 831b011 into master Sep 9, 2025
13 checks passed
@graalvmbot graalvmbot deleted the cs/GR-69102-class-cast-exception branch September 9, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants