timob / jnigi

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

Redesign API #9

Closed timob closed 5 years ago

timob commented 7 years ago

For the next version. I think that the CallMethod/Field methods currently on ObjectRef which take an Env as a paramter should be methods of Env rather thant ObjectRef.

This is so that state, like errors for example can be tracked in the Env struct. This would allow for:

hashCode := env.CallMethod(obj, "hashCode", jnigi.Int).(int)
if env.ErrorOccurred() != nil {
   // deal with error
}
// use hashCode
timob commented 5 years ago

not really any reason to do this.