Repository navigation
Apply external contracts to inherited receiver methods - #387
Open
CatarinaGamboa wants to merge 1 commit into
Open
CatarinaGamboa wants to merge 1 commit into
CatarinaGamboa wants to merge 1 commit into
Conversation
rcosta358
approved these changes
Oct 9, 2026
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.
An external specification for
JFramecould not name inheritedpack()orsetUndecorated(boolean). Both declarations produced warnings, andpack(); setUndecorated(true);incorrectly passed verification.Validate external method signatures and overload suggestions against methods the target actually inherits. Exclude private ancestor methods, interface static methods, and package-private methods lost across package boundaries. Resolve invocation contracts against the receiver's static type first, using exact parameter types to prevent equal-arity overload collisions, then retain the existing declaring-type lookup. This applies to both library calls and resolved source method calls.
Add paired JFrame protocol, source inheritance, and JDK overload regressions, plus superclass fallback, subclass override, and inherited visibility coverage.
Validation:
mvn -pl liquidjava-verifier test— 394 tests, zero failures/errors. Targeted checks also verified the exact JFrame state error, both overload paths, and exactly three visibility warnings while accepting inherited protected and default-package methods.Adversarial and devil’s advocate review identified two implementation traps covered here: the existing typed context lookup falls back to arity, and Spoon’s complete method set includes non-inherited private/interface-static/package-private declarations. Receiver lookup uses a new exact API; inherited validation filters those declarations.
Closes #379.