Skip to content

jnimarshalmethod-gen.exe sometime generates duplicate marshal methods #384

@radekdoulik

Description

@radekdoulik

In case a class has interface method implementation with different return type, we generate duplicate marshal method.

An example:

[JniAddNativeMethodRegistration]
public static void __RegisterNativeMembers (JniNativeMethodRegistrationArguments args)
{
	args.AddRegistrations (new JniNativeMethodRegistration[35] {
...
		new JniNativeMethodRegistration ("n_append", "(Ljava/lang/CharSequence;)Ljava/nio/CharBuffer;", new Func<IntPtr, IntPtr, IntPtr, IntPtr> (__<$>_jni_marshal_methods.n_append_Ljava_lang_CharSequence_)),
...
		new JniNativeMethodRegistration ("n_append", "(Ljava/lang/CharSequence;)Ljava/lang/Appendable;", new Func<IntPtr, IntPtr, IntPtr, IntPtr> (__<$>_jni_marshal_methods.n_append_Ljava_lang_CharSequence_)),
	});
}

The return types are CharBuffer and IAppendable here. One derived from the other.

We should generate just one marshal method in this case, for the actual implementation method.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions