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
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: