Repository navigation
Resolve packages through realm imports and parent in ClassRealm - #161
Open
slachiewicz wants to merge 3 commits into
Open
slachiewicz wants to merge 3 commits into
slachiewicz wants to merge 3 commits into
Conversation
getPackage and getPackages now follow the same import and parent-import rules as loadClass, so Package.getPackage sees imported packages. Do not widen this past those rules: a package must never be visible where a class in it is not.
slachiewicz
marked this pull request as ready for review
November 8, 2026 23:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overrides
getPackageandgetPackagesinClassRealmso a package is visible exactly where a class in it would load: own class path, imports (package and exact class), then the parent where parent imports allow it. This is #159 carried onto current master: its two commits are cherry-picked as authored, with one commit on top that also exposes the unnamed package through an exact class import, the last open review finding there.Merge with "Rebase and merge": a squash would drop the original commits and their author from the history.
Closes #126
Verified:
mvn -B -ntp verify→ BUILD SUCCESS, 221 tests, 0 failures, 1 skipped; the unnamed-package test fails without the last commit (macOS, JDK 17)