Skip to content

Java: Type based summary models. #10628

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 43 commits into from
Nov 10, 2022

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Sep 29, 2022

In this PR we introduce the a query for generating type based models for Java.
This is the Java version of #10238.

It is worth mentioning the following differences.

  • Java does not have a Func or delegate like type, but instead relies on functional interfaces (ie. interfaces with a single abstract method) as these can be perceived as functions, which complicated the implementation compared to C#.
  • Java has different way of providing accesspaths into collections depending on the collection type.
  • As a reference example java.util.stream.Stream is used (an approximate equivalent to the System.Linq.Enumerable extension methods for C#).

@github-actions github-actions bot added the Java label Sep 29, 2022
@michaelnebel michaelnebel force-pushed the java/typebasedmodels branch 2 times, most recently from 85f21ca to 4668c55 Compare October 3, 2022 14:18
@github-actions github-actions bot added the C# label Oct 7, 2022
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Oct 10, 2022
@michaelnebel michaelnebel marked this pull request as ready for review October 10, 2022 11:22
@michaelnebel michaelnebel requested review from a team as code owners October 10, 2022 11:22

/**
* Holds if `t` is a container like type of `tv` (eg. `List<T>`).
* Note that collections are covariant in their element type.
Copy link
Contributor

Choose a reason for hiding this comment

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

No? In Java they aren't. Or is this something that you assume for some heuristic purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that claim is to strong.
At least the idea is that, if we have "relevant" type variable that serves as an upper bound for a given type, then we use that to eg. decide if the method reads from an implicit field or the implicit collection.
I will delete the comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha - no - you are right! I will try once more :-)

michaelnebel and others added 26 commits November 10, 2022 13:57
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
@michaelnebel michaelnebel merged commit 2a26c8f into github:main Nov 10, 2022
@michaelnebel michaelnebel deleted the java/typebasedmodels branch November 10, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# 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