timob / jnigi

Golang Java JNI library
BSD 2-Clause "Simplified" License
163 stars 44 forks source link

Error is not being returned when arguments to a method call can not be converted. #39

Closed timob closed 4 years ago

timob commented 4 years ago

This happens when you use CallMethod/StaticMethod and pass for example a Go string, or any other non built in type.

See https://github.com/timob/jnigi/issues/38

In lieu of actual documentation 😲 , probably should mention that JNIGI converts Java primitive types between Java and Go, but not things like String objects.

timob commented 4 years ago

Actually I think it's just for strings, but for other types these functions correctly return an unknown type error.

A string is interpreted as specifying object with class type being the value of string. The reason this behavior is there as a shortcut to specify the return type when doing a Call etc...

timob commented 4 years ago

Fix ^^^ for the type errors.

Probably should update README example to show how to pass a string to a Java method. A couple of people have run into this issue.

timob commented 4 years ago

Donezo