Skip to content
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

Added generics generation in JNetReflector #145

Conversation

masesdevelopers
Copy link
Contributor

Description

This PR contains:

  • improvements in JNetReflector to create generics, meanwhile there are some fixes from previous version
    • most methods becomes properties: this can introduce a breaking change from previous version
  • JNet introduces all classes, with generics too, generated using JNeReflector: still missing Listener and callbacks

Related Issue

Closed #142
Closed #143 with #38
Fix #130
Fix #132

Motivation and Context

How Has This Been Tested?

Tested locally

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…it is the alone in the interface list and class does not have any other super-class
…ethods which conforms to the patter expected
@masesdevelopers masesdevelopers added enhancement New feature or request JNet JNet related issue JNetCLI JNetCLI related issue JNetReflector JNetReflector related issue JNetPS JNetPS releated issue JNetPSCore JNetPSCore releated issue labels Apr 5, 2023
@masesdevelopers masesdevelopers self-assigned this Apr 5, 2023
Copy link

@mariomastrodicasa mariomastrodicasa left a comment

Choose a reason for hiding this comment

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

Too big to be managed: the limit is 3000 files

@masesdevelopers masesdevelopers merged commit 6c4c20b into masesgroup:master Apr 5, 2023
@masesdevelopers masesdevelopers deleted the 142-add-generics-generation-in-jnetreflector branch April 5, 2023 12:45
@mariomastrodicasa
Copy link

Looking into the code generated it is possible to highlight this:

public bool RemoveAll<Arg0Extendsobject>(Java.Util.Collection<Arg0Extendsobject> arg0)

the corresponding Java code is:

boolean removeAll​(Collection<?> c)

I pretty sure the above C# code works, anyway for native types like long there is something like this:

public void ForEachRemaining<Arg0objectSuperlong>(Java.Util.Function.Consumer<Arg0objectSuperlong> arg0)

the Java code is:

void forEachRemaining​(Consumer<? super Long> action)

but in C# a long is sealed so we can remove the generic otherwise there isn't a right constraint in the code.

I will open an issue to write better this kind of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request JNet JNet related issue JNetCLI JNetCLI related issue JNetPS JNetPS releated issue JNetPSCore JNetPSCore releated issue JNetReflector JNetReflector related issue
Projects
None yet
2 participants