Skip to content

Update listeners generation to manage original class #393

Closed

Description

@masesdevelopers

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.

Activity

  1. masesdevelopers commented on May 14, 2024

    @masesdevelopers
    ContributorAuthor

    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.

  2. masesdevelopers commented on May 14, 2024

    @masesdevelopers
    ContributorAuthor

    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)

  3. masesdevelopers commented on May 14, 2024

    @masesdevelopers
    ContributorAuthor

    , 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.

  4. masesdevelopers commented on Jun 2, 2024

    @masesdevelopers
    ContributorAuthor

    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

Metadata

Metadata

Labels

JNetReflectorJNetReflector related issueenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions