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

Update listeners generation to manage original class #393

Closed
masesdevelopers opened this issue May 11, 2024 · 4 comments · Fixed by #395, #398 or #409
Closed

Update listeners generation to manage original class #393

masesdevelopers opened this issue May 11, 2024 · 4 comments · Fixed by #395, #398 or #409
Assignees
Labels
enhancement New feature or request JNetReflector JNetReflector related issue

Comments

@masesdevelopers
Copy link
Contributor

masesdevelopers commented May 11, 2024

The problem is strictly related to listeners and comes from many things:

To avoid the problem the code shall be updated to:

Originally posted by @masesdevelopers in masesgroup/KNet#448 (comment)

The idea is to update JNetReflector to create a new class, beside each listener, which:

In case the listener interface is returned back from a method, create an extra method. beside the original one, which uses the new generated class to wrap the JVM reference.

@masesdevelopers
Copy link
Contributor Author

Latest version of JCOBridge introduced a limitation on method CastTo which raises in

return entry.CastTo<ParameterizedType>().GetGenerics(genArguments, genClause, prefix, reportNative, usedInGenerics, camel, out mustBeAvoided);
the following exception System.InvalidOperationException: java/lang/reflect/Type cannot be converted to java/lang/reflect/ParameterizedType even if the previous test in
else if (entry.IsInstanceOf<ParameterizedType>())
passed.

@masesdevelopers
Copy link
Contributor Author

The direct class e.g.

public partial class ActionListenerDirect : ActionListener
misses all members like IsBridgeInterface and so on, plus IsBridgeListener shall becomes false.

Meanwhile add the missing developed classes (see https://github.com/masesgroup/JNet/actions/runs/9080784354/job/24953109309)

@masesdevelopers
Copy link
Contributor Author

, plus IsBridgeListener shall becomes false.

On IsBridgeListener cannot be done an override, however the side-by-side Direct class shall be used only as wrapper and never can be instantiated from CLR.

@masesdevelopers
Copy link
Contributor Author

All developed classes under Java.Util.Function namespace shall have the Direct counterpart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment