The go_seq_to_refnum function handles its argument object as a Java object if it doesn't implement Seq.Proxy. Java classes implemented in Go does not implement Seq.Proxy, but when passing "this" references to Go, instances must be treated as a Go object. Use go_seq_to_refnum_go everywhere "this" is passed to Go, which fixes field accessors and simplifies the method call case. Change-Id: I3d01c63d7b2081e6344ece431f5e5021a9dd7662 Reviewed-on: https://go-review.googlesource.com/31171 Reviewed-by: David Crawshaw <crawshaw@golang.org>
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
// JNI functions for the Go <=> Java bridge.
|
|
// gobind -lang=java issue12328
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
#include <android/log.h>
|
|
#include <stdint.h>
|
|
#include "seq.h"
|
|
#include "_cgo_export.h"
|
|
#include "issue12328.h"
|
|
|
|
jclass proxy_class_issue12328_T;
|
|
jmethodID proxy_class_issue12328_T_cons;
|
|
|
|
JNIEXPORT void JNICALL
|
|
Java_go_issue12328_Issue12328__1init(JNIEnv *env, jclass _unused) {
|
|
jclass clazz;
|
|
clazz = (*env)->FindClass(env, "go/issue12328/T");
|
|
proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz);
|
|
proxy_class_issue12328_T_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
|
}
|
|
|
|
JNIEXPORT jobject JNICALL
|
|
Java_go_issue12328_T__1_1New(JNIEnv *env, jclass clazz) {
|
|
int32_t refnum = new_issue12328_T();
|
|
return go_seq_from_refnum(env, refnum, NULL, NULL);
|
|
}
|
|
|
|
JNIEXPORT void JNICALL
|
|
Java_go_issue12328_T_setErr(JNIEnv *env, jobject this, jobject v) {
|
|
int32_t o = go_seq_to_refnum_go(env, this);
|
|
int32_t _v = go_seq_to_refnum(env, v);
|
|
proxyissue12328_T_Err_Set(o, _v);
|
|
}
|
|
|
|
JNIEXPORT jobject JNICALL
|
|
Java_go_issue12328_T_getErr(JNIEnv *env, jobject this) {
|
|
int32_t o = go_seq_to_refnum_go(env, this);
|
|
int32_t r0 = proxyissue12328_T_Err_Get(o);
|
|
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
|
|
return _r0;
|
|
}
|
|
|