Skip to content

Java: Test generator fixes#12242

Merged
joefarebrother merged 1 commit into
github:mainfrom
joefarebrother:testgen-improvements
Feb 20, 2023
Merged

Java: Test generator fixes#12242
joefarebrother merged 1 commit into
github:mainfrom
joefarebrother:testgen-improvements

Conversation

@joefarebrother
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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