Skip to content

Java: Test generator fixes #12242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

joefarebrother
Copy link
Contributor

  • Revert previous change (in Java: Test generator improvements #12195) to constructor return types; as constructors are supposed to be modeled using Argument[-1] rather than ReturnValue
  • Fix generation of ambiguous calls when one of the conflicting methods is overridden

- Revert previous change to constructor return values; as constructors are supposed to be modeled using Argument[-1] rather than ReturnValue
- Fix generation of ambiguous calls when one of the conflicting methods is overridden
@joefarebrother joefarebrother added the no-change-note-required This PR does not need a change note label Feb 17, 2023
@joefarebrother joefarebrother requested a review from a team as a code owner February 17, 2023 15:32
@github-actions github-actions bot added the Java label Feb 17, 2023
exists(Callable other, string package, string type, string name |
c.hasQualifiedName(package, type, name) and
exists(Callable other, Callable override, string package, string type, string name |
override = [c, c.(Method).getASourceOverriddenMethod*()] and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're using the reflexive transitive closure here, I think you don't need to add c, it should be included by c.(Method).getASourceOverriddenMethod*() already:

Suggested change
override = [c, c.(Method).getASourceOverriddenMethod*()] and
override = c.(Method).getASourceOverriddenMethod*() and

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c can also be a Constructor, which diesn't have getASourceOverridenMethod, so I think c is still necassary for that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point! 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Maybe using the non-reflexive transitive closure would be a bit clearer then, but anyway)

@joefarebrother joefarebrother merged commit 1fb2735 into github:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants