Attempt to get around Go hating Java pointers.
Change-Id: Ie9ff58ebe0062d19c3099fedc78df165b6ecc401
diff --git a/impl/google/channel/jni.go b/impl/google/channel/jni.go
index 095fd39..9d10596 100644
--- a/impl/google/channel/jni.go
+++ b/impl/google/channel/jni.go
@@ -47,7 +47,7 @@
//export Java_io_v_impl_google_channel_ChannelIterable_nativeReadValue
func Java_io_v_impl_google_channel_ChannelIterable_nativeReadValue(jenv *C.JNIEnv, jChannelIterable C.jobject, goChanPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
ch := *(*chan jutil.Object)(jutil.NativePtr(goChanPtr))
jObj, ok := <-ch
if !ok {
@@ -67,18 +67,18 @@
//export Java_io_v_impl_google_channel_OutputChannelImpl_nativeWriteValue
func Java_io_v_impl_google_channel_OutputChannelImpl_nativeWriteValue(jenv *C.JNIEnv, jOutputChannelClass C.jclass, goChanPtr C.jlong, jObject C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
outCh := *(*outputChannel)(jutil.NativePtr(goChanPtr))
// The other side of the channel is responsible for deleting this
// global reference.
- if err := outCh.ReadFunc(jutil.NewGlobalRef(env, jutil.WrapObject(jObject))); err != nil {
+ if err := outCh.ReadFunc(jutil.NewGlobalRef(env, jutil.WrapObject(uintptr(unsafe.Pointer(jObject))))); err != nil {
jutil.JThrowV(env, fmt.Errorf("Exception while writing to OutputChannel: %+v", err))
}
}
//export Java_io_v_impl_google_channel_OutputChannelImpl_nativeClose
func Java_io_v_impl_google_channel_OutputChannelImpl_nativeClose(jenv *C.JNIEnv, jOutputChannelClass C.jclass, goChanPtr C.jlong) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
outCh := *(*outputChannel)(jutil.NativePtr(goChanPtr))
if err := outCh.CloseFunc(); err != nil {
diff --git a/impl/google/namespace/jni.go b/impl/google/namespace/jni.go
index 43e33df..36f1422 100644
--- a/impl/google/namespace/jni.go
+++ b/impl/google/namespace/jni.go
@@ -58,15 +58,15 @@
}
func globArgs(env jutil.Env, jContext C.jobject, jPattern C.jstring, jOptions C.jobject) (context *context.T, pattern string, opts []naming.NamespaceOpt, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- opts, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ opts, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
if err != nil {
return
}
- pattern = jutil.GoString(env, jutil.WrapObject(jPattern))
+ pattern = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPattern))))
return
}
@@ -102,7 +102,7 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeGlob
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeGlob(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jPattern C.jstring, jOptions C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, pattern, opts, err := globArgs(env, jContext, jPattern, jOptions)
if err != nil {
@@ -119,9 +119,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeGlobAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeGlobAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jPattern C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, pattern, opts, err := globArgs(env, jContext, jPattern, jOptions)
if err != nil {
jutil.JThrowV(env, err)
@@ -133,23 +133,23 @@
}
func mountArgs(env jutil.Env, jContext C.jobject, jName, jServer C.jstring, jDuration, jOptions C.jobject) (context *context.T, name, server string, duration time.Duration, options []naming.NamespaceOpt, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- name = jutil.GoString(env, jutil.WrapObject(jName))
- server = jutil.GoString(env, jutil.WrapObject(jServer))
- duration, err = jutil.GoDuration(env, jutil.WrapObject(jDuration))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ server = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jServer))))
+ duration, err = jutil.GoDuration(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDuration))))
if err != nil {
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
return
}
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeMount
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeMount(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName, jServer C.jstring, jDuration C.jobject, jOptions C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, name, server, duration, options, err := mountArgs(env, jContext, jName, jServer, jDuration, jOptions)
if err != nil {
@@ -163,9 +163,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeMountAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeMountAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jServer C.jstring, jDuration C.jobject, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, name, server, duration, options, err := mountArgs(env, jContext, jName, jServer, jDuration, jOptions)
if err != nil {
jutil.JThrowV(env, err)
@@ -177,19 +177,19 @@
}
func unmountArgs(env jutil.Env, jName, jServer C.jstring, jContext, jOptions C.jobject) (name, server string, context *context.T, options []naming.NamespaceOpt, err error) {
- name = jutil.GoString(env, jutil.WrapObject(jName))
- server = jutil.GoString(env, jutil.WrapObject(jServer))
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ server = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jServer))))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
return
}
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeUnmount
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeUnmount(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jServer C.jstring, jOptions C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
name, server, context, options, err := unmountArgs(env, jName, jServer, jContext, jOptions)
if err != nil {
@@ -203,9 +203,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeUnmountAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeUnmountAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jServer C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
name, server, context, options, err := unmountArgs(env, jName, jServer, jContext, jOptions)
if err != nil {
jutil.JThrowV(env, err)
@@ -217,22 +217,22 @@
}
func deleteArgs(env jutil.Env, jContext, jOptions C.jobject, jName C.jstring, jDeleteSubtree C.jboolean) (context *context.T, options []naming.NamespaceOpt, name string, deleteSubtree bool, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
if err != nil {
return
}
- name = jutil.GoString(env, jutil.WrapObject(jName))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
deleteSubtree = jDeleteSubtree == C.JNI_TRUE
return
}
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeDelete
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeDelete(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jDeleteSubtree C.jboolean, jOptions C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, options, name, deleteSubtree, err := deleteArgs(env, jContext, jOptions, jName, jDeleteSubtree)
if err != nil {
@@ -246,9 +246,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeDeleteAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeDeleteAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jDeleteSubtree C.jboolean, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, options, name, deleteSubtree, err := deleteArgs(env, jContext, jOptions, jName, jDeleteSubtree)
if err != nil {
jutil.JThrowV(env, err)
@@ -260,17 +260,17 @@
}
func resolveArgs(env jutil.Env, jName C.jstring, jContext, jOptions C.jobject) (context *context.T, name string, options []naming.NamespaceOpt, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- name = jutil.GoString(env, jutil.WrapObject(jName))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
return
}
@@ -284,7 +284,7 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolve
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolve(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, name, options, err := resolveArgs(env, jName, jContext, jOptions)
if err != nil {
@@ -301,9 +301,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, name, options, err := resolveArgs(env, jName, jContext, jOptions)
if err != nil {
jutil.JThrowV(env, err)
@@ -315,17 +315,17 @@
}
func resolveToMountTableArgs(env jutil.Env, jContext, jOptions C.jobject, jName C.jstring) (context *context.T, options []naming.NamespaceOpt, name string, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- name = jutil.GoString(env, jutil.WrapObject(jName))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
return
}
@@ -339,7 +339,7 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveToMountTable
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveToMountTable(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, options, name, err := resolveToMountTableArgs(env, jContext, jOptions, jName)
if err != nil {
@@ -356,9 +356,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveToMountTableAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeResolveToMountTableAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, options, name, err := resolveToMountTableArgs(env, jContext, jOptions, jName)
if err != nil {
jutil.JThrowV(env, err)
@@ -370,15 +370,15 @@
}
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeFlushCacheEntry
-func Java_io_v_impl_google_namespace_NamespaceImpl_nativeFlushCacheEntry(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName string) C.jboolean {
- env := jutil.WrapEnv(jenv)
+func Java_io_v_impl_google_namespace_NamespaceImpl_nativeFlushCacheEntry(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring) C.jboolean {
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- context, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return C.JNI_FALSE
}
- result := n.FlushCacheEntry(context, jutil.GoString(env, jutil.WrapObject(jName)))
+ result := n.FlushCacheEntry(context, jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName)))))
if result {
return C.JNI_TRUE
} else {
@@ -388,9 +388,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetRoots
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetRoots(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jNames C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- names, err := jutil.GoStringList(env, jutil.WrapObject(jNames))
+ names, err := jutil.GoStringList(env, jutil.WrapObject(uintptr(unsafe.Pointer(jNames))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -402,23 +402,23 @@
}
func setPermissionsArgs(env jutil.Env, jContext, jPermissions C.jobject, jName, jVersion C.jstring, jOptions C.jobject) (context *context.T, permissions access.Permissions, name, version string, options []naming.NamespaceOpt, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- err = jutil.GoVomCopy(env, jutil.WrapObject(jPermissions), jPermissionsClass, &permissions)
+ err = jutil.GoVomCopy(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPermissions))), jPermissionsClass, &permissions)
if err != nil {
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
- name = jutil.GoString(env, jutil.WrapObject(jName))
- version = jutil.GoString(env, jutil.WrapObject(jVersion))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ version = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jVersion))))
return
}
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetPermissions
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetPermissions(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jPermissions C.jobject, jVersion C.jstring, jOptions C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, permissions, name, version, options, err := setPermissionsArgs(env, jContext, jPermissions, jName, jVersion, jOptions)
if err != nil {
@@ -432,9 +432,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetPermissionsAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeSetPermissionsAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jPermissions C.jobject, jVersion C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, permissions, name, version, options, err := setPermissionsArgs(env, jContext, jPermissions, jName, jVersion, jOptions)
if err != nil {
jutil.JThrowV(env, err)
@@ -446,15 +446,15 @@
}
func getPermissionsArgs(env jutil.Env, jContext C.jobject, jName C.jstring, jOptions C.jobject) (context *context.T, name string, options []naming.NamespaceOpt, err error) {
- context, err = jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err = jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
return
}
- options, err = namespaceOptions(env, jutil.WrapObject(jOptions))
+ options, err = namespaceOptions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jOptions))))
if err != nil {
return
}
- name = jutil.GoString(env, jutil.WrapObject(jName))
+ name = jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
return
}
@@ -474,7 +474,7 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeGetPermissions
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeGetPermissions(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
context, name, options, err := getPermissionsArgs(env, jContext, jName, jOptions)
if err != nil {
@@ -491,9 +491,9 @@
//export Java_io_v_impl_google_namespace_NamespaceImpl_nativeGetPermissionsAsync
func Java_io_v_impl_google_namespace_NamespaceImpl_nativeGetPermissionsAsync(jenv *C.JNIEnv, jNamespaceClass C.jclass, goNamespacePtr C.jlong, jContext C.jobject, jName C.jstring, jOptions C.jobject, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
n := *(*namespace.T)(jutil.NativePtr(goNamespacePtr))
- callback := jutil.WrapObject(jCallback)
+ callback := jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))
context, name, options, err := getPermissionsArgs(env, jContext, jName, jOptions)
if err != nil {
jutil.JThrowV(env, err)
diff --git a/impl/google/rpc/jni.go b/impl/google/rpc/jni.go
index 89fc3d2..09badce 100644
--- a/impl/google/rpc/jni.go
+++ b/impl/google/rpc/jni.go
@@ -207,8 +207,8 @@
//export Java_io_v_impl_google_rpc_ServerImpl_nativeAddName
func Java_io_v_impl_google_rpc_ServerImpl_nativeAddName(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong, jName C.jstring) {
- env := jutil.WrapEnv(jenv)
- name := jutil.GoString(env, jutil.WrapObject(jName))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
if err := (*(*rpc.Server)(jutil.NativePtr(goPtr))).AddName(name); err != nil {
jutil.JThrowV(env, err)
return
@@ -217,14 +217,14 @@
//export Java_io_v_impl_google_rpc_ServerImpl_nativeRemoveName
func Java_io_v_impl_google_rpc_ServerImpl_nativeRemoveName(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong, jName C.jstring) {
- env := jutil.WrapEnv(jenv)
- name := jutil.GoString(env, jutil.WrapObject(jName))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
(*(*rpc.Server)(jutil.NativePtr(goPtr))).RemoveName(name)
}
//export Java_io_v_impl_google_rpc_ServerImpl_nativeGetStatus
func Java_io_v_impl_google_rpc_ServerImpl_nativeGetStatus(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
status := (*(*rpc.Server)(jutil.NativePtr(goPtr))).Status()
jStatus, err := JavaServerStatus(env, status)
if err != nil {
@@ -236,7 +236,7 @@
//export Java_io_v_impl_google_rpc_ServerImpl_nativeWatchNetwork
func Java_io_v_impl_google_rpc_ServerImpl_nativeWatchNetwork(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
networkChan := make(chan rpc.NetworkChange, 100)
(*(*rpc.Server)(jutil.NativePtr(goPtr))).WatchNetwork(networkChan)
retChan := make(chan jutil.Object, 100)
@@ -264,8 +264,8 @@
//export Java_io_v_impl_google_rpc_ServerImpl_nativeUnwatchNetwork
func Java_io_v_impl_google_rpc_ServerImpl_nativeUnwatchNetwork(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong, jChannelIterable C.jobject) {
- env := jutil.WrapEnv(jenv)
- goNetworkChanPtr, err := jutil.CallLongMethod(env, jutil.WrapObject(jChannelIterable), "getSourceNativePtr", nil)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ goNetworkChanPtr, err := jutil.CallLongMethod(env, jutil.WrapObject(uintptr(unsafe.Pointer(jChannelIterable))), "getSourceNativePtr", nil)
if err != nil {
jutil.JThrowV(env, err)
return
@@ -276,7 +276,7 @@
//export Java_io_v_impl_google_rpc_ServerImpl_nativeStop
func Java_io_v_impl_google_rpc_ServerImpl_nativeStop(jenv *C.JNIEnv, jServer C.jobject, goPtr C.jlong) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
s := (*rpc.Server)(jutil.NativePtr(goPtr))
if err := (*s).Stop(); err != nil {
jutil.JThrowV(env, err)
@@ -290,7 +290,7 @@
}
func decodeArgs(env jutil.Env, jVomArgs C.jobjectArray) ([]interface{}, error) {
- vomArgs, err := jutil.GoByteArrayArray(env, jutil.WrapObject(jVomArgs))
+ vomArgs, err := jutil.GoByteArrayArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jVomArgs))))
if err != nil {
return nil, err
}
@@ -326,10 +326,10 @@
//export Java_io_v_impl_google_rpc_ClientImpl_nativeStartCall
func Java_io_v_impl_google_rpc_ClientImpl_nativeStartCall(jenv *C.JNIEnv, jClient C.jobject, goPtr C.jlong, jContext C.jobject, jName C.jstring, jMethod C.jstring, jVomArgs C.jobjectArray, jSkipServerAuth C.jboolean) C.jobject {
- env := jutil.WrapEnv(jenv)
- name := jutil.GoString(env, jutil.WrapObject(jName))
- method := jutil.GoString(env, jutil.WrapObject(jMethod))
- context, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ method := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jMethod))))
+ context, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -360,11 +360,11 @@
//export Java_io_v_impl_google_rpc_ClientImpl_nativeStartCallAsync
func Java_io_v_impl_google_rpc_ClientImpl_nativeStartCallAsync(jenv *C.JNIEnv, jClient C.jobject, goPtr C.jlong, jContext C.jobject, jName C.jstring, jMethod C.jstring, jVomArgs C.jobjectArray, jSkipServerAuth C.jboolean, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
- name := jutil.GoString(env, jutil.WrapObject(jName))
- method := jutil.GoString(env, jutil.WrapObject(jMethod))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ method := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jMethod))))
- context, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ context, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -384,7 +384,7 @@
} else {
callOnSuccess(env, jCallback, jCall)
}
- }(jutil.NewGlobalRef(env, jutil.WrapObject(jCallback)))
+ }(jutil.NewGlobalRef(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))))
}
//export Java_io_v_impl_google_rpc_ClientImpl_nativeClose
@@ -399,8 +399,8 @@
//export Java_io_v_impl_google_rpc_StreamImpl_nativeSend
func Java_io_v_impl_google_rpc_StreamImpl_nativeSend(jenv *C.JNIEnv, jStream C.jobject, goPtr C.jlong, jVomItem C.jbyteArray) {
- env := jutil.WrapEnv(jenv)
- vomItem := jutil.GoByteArray(env, jutil.WrapObject(jVomItem))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ vomItem := jutil.GoByteArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jVomItem))))
item, err := jutil.VomDecodeToValue(vomItem)
if err != nil {
jutil.JThrowV(env, err)
@@ -414,7 +414,7 @@
//export Java_io_v_impl_google_rpc_StreamImpl_nativeRecv
func Java_io_v_impl_google_rpc_StreamImpl_nativeRecv(jenv *C.JNIEnv, jStream C.jobject, goPtr C.jlong) C.jbyteArray {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
result := new(vdl.Value)
if err := (*(*rpc.Stream)(jutil.NativePtr(goPtr))).Recv(&result); err != nil {
if err == io.EOF {
@@ -444,7 +444,7 @@
//export Java_io_v_impl_google_rpc_ClientCallImpl_nativeCloseSend
func Java_io_v_impl_google_rpc_ClientCallImpl_nativeCloseSend(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
if err := (*(*rpc.ClientCall)(jutil.NativePtr(goPtr))).CloseSend(); err != nil {
jutil.JThrowV(env, err)
return
@@ -482,7 +482,7 @@
//export Java_io_v_impl_google_rpc_ClientCallImpl_nativeFinish
func Java_io_v_impl_google_rpc_ClientCallImpl_nativeFinish(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong, jNumResults C.jint) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
numResults := int(jNumResults)
result, err := doFinish(env, goPtr, numResults)
if err != nil {
@@ -494,7 +494,7 @@
//export Java_io_v_impl_google_rpc_ClientCallImpl_nativeFinishAsync
func Java_io_v_impl_google_rpc_ClientCallImpl_nativeFinishAsync(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong, jNumResults C.jint, jCallback C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
numResults := int(jNumResults)
go func(jCallback jutil.Object) {
env, freeFunc := jutil.GetEnv()
@@ -505,7 +505,7 @@
} else {
callOnSuccess(env, jCallback, result)
}
- }(jutil.NewGlobalRef(env, jutil.WrapObject(jCallback)))
+ }(jutil.NewGlobalRef(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCallback)))))
}
//export Java_io_v_impl_google_rpc_ClientCallImpl_nativeFinalize
@@ -515,7 +515,7 @@
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeSecurity
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeSecurity(jenv *C.JNIEnv, jServerCallClass C.jclass, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
securityCall := (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).Security()
if securityCall == nil {
return nil
@@ -530,14 +530,14 @@
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeSuffix
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeSuffix(jenv *C.JNIEnv, jServerCall C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jSuffix := jutil.JString(env, (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).Suffix())
return C.jstring(unsafe.Pointer(jSuffix))
}
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeLocalEndpoint
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeLocalEndpoint(jenv *C.JNIEnv, jServerCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jEndpoint, err := jnaming.JavaEndpoint(env, (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).LocalEndpoint())
if err != nil {
jutil.JThrowV(env, err)
@@ -548,7 +548,7 @@
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeRemoteEndpoint
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeRemoteEndpoint(jenv *C.JNIEnv, jServerCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jEndpoint, err := jnaming.JavaEndpoint(env, (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).RemoteEndpoint())
if err != nil {
jutil.JThrowV(env, err)
@@ -559,7 +559,7 @@
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeGrantedBlessings
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeGrantedBlessings(jenv *C.JNIEnv, jServerCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessings := (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).GrantedBlessings()
jBlessings, err := jsecurity.JavaBlessings(env, blessings)
if err != nil {
@@ -571,7 +571,7 @@
//export Java_io_v_impl_google_rpc_ServerCallImpl_nativeServer
func Java_io_v_impl_google_rpc_ServerCallImpl_nativeServer(jenv *C.JNIEnv, jServerCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
server := (*(*rpc.ServerCall)(jutil.NativePtr(goPtr))).Server()
jServer, err := JavaServer(env, server)
if err != nil {
@@ -593,9 +593,9 @@
//export Java_io_v_impl_google_rpc_AddressChooserImpl_nativeChoose
func Java_io_v_impl_google_rpc_AddressChooserImpl_nativeChoose(jenv *C.JNIEnv, jAddressChooser C.jobject, goPtr C.jlong, jProtocol C.jstring, jCandidates C.jobjectArray) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
- protocol := jutil.GoString(env, jutil.WrapObject(jProtocol))
- candidates, err := GoNetworkAddressArray(env, jutil.WrapObject(jCandidates))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ protocol := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jProtocol))))
+ candidates, err := GoNetworkAddressArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCandidates))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -620,8 +620,8 @@
//export Java_io_v_impl_google_rpc_Util_nativeGoInvoker
func Java_io_v_impl_google_rpc_Util_nativeGoInvoker(jenv *C.JNIEnv, jUtil C.jclass, jServiceObject C.jobject) C.jlong {
- env := jutil.WrapEnv(jenv)
- invoker, err := goInvoker(env, jutil.WrapObject(jServiceObject))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ invoker, err := goInvoker(env, jutil.WrapObject(uintptr(unsafe.Pointer(jServiceObject))))
if err != nil {
jutil.JThrowV(env, err)
return C.jlong(0)
@@ -632,8 +632,8 @@
//export Java_io_v_impl_google_rpc_Util_nativeGoAuthorizer
func Java_io_v_impl_google_rpc_Util_nativeGoAuthorizer(jenv *C.JNIEnv, jUtil C.jclass, jAuthorizer C.jobject) C.jlong {
- env := jutil.WrapEnv(jenv)
- auth, err := jsecurity.GoAuthorizer(env, jutil.WrapObject(jAuthorizer))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ auth, err := jsecurity.GoAuthorizer(env, jutil.WrapObject(uintptr(unsafe.Pointer(jAuthorizer))))
if err != nil {
jutil.JThrowV(env, err)
return C.jlong(0)
diff --git a/impl/google/rpc/protocols/bt/bt_android.go b/impl/google/rpc/protocols/bt/bt_android.go
index 34a6c36..eb4a360 100644
--- a/impl/google/rpc/protocols/bt/bt_android.go
+++ b/impl/google/rpc/protocols/bt/bt_android.go
@@ -20,7 +20,7 @@
var (
connectionSign = jutil.ClassSign("io.v.android.impl.google.rpc.protocols.bt.Bluetooth$Connection")
- listenerSign = jutil.ClassSign("io.v.android.impl.google.rpc.protocols.bt.Bluetooth$Listener")
+ listenerSign = jutil.ClassSign("io.v.android.impl.google.rpc.protocols.bt.Bluetooth$Listener")
// Global reference for io.v.impl.google.rpc.protocols.bt.Bluetooth class.
jBluetoothClass jutil.Class
diff --git a/impl/google/rt/jni.go b/impl/google/rt/jni.go
index 1c4066e..97633d4 100644
--- a/impl/google/rt/jni.go
+++ b/impl/google/rt/jni.go
@@ -25,7 +25,7 @@
var (
contextSign = jutil.ClassSign("io.v.v23.context.VContext")
- serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
+ serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
jVRuntimeImplClass jutil.Class
)
@@ -46,7 +46,7 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeInit
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeInit(jenv *C.JNIEnv, jRuntime C.jclass) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
ctx, shutdownFunc := v23.Init()
ctx = context.WithValue(ctx, shutdownKey{}, shutdownFunc)
jCtx, err := jcontext.JavaContext(env, ctx)
@@ -59,8 +59,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeShutdown
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeShutdown(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
}
@@ -72,8 +72,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNewClient
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNewClient(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject, jOptions C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -94,8 +94,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetClient
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetClient(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -111,14 +111,14 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNewServer
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNewServer(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject, jName C.jstring, jDispatcher C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- name := jutil.GoString(env, jutil.WrapObject(jName))
- d, err := jrpc.GoDispatcher(env, jutil.WrapObject(jDispatcher))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ d, err := jrpc.GoDispatcher(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDispatcher))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -149,13 +149,13 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithPrincipal
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithPrincipal(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject, jPrincipal C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- principal, err := jsecurity.GoPrincipal(env, jutil.WrapObject(jPrincipal))
+ principal, err := jsecurity.GoPrincipal(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPrincipal))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -175,8 +175,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetPrincipal
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetPrincipal(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -192,13 +192,13 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNamespace
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithNamespace(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject, jRoots C.jobjectArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- roots, err := jutil.GoStringArray(env, jutil.WrapObject(jRoots))
+ roots, err := jutil.GoStringArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jRoots))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -219,8 +219,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetNamespace
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetNamespace(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -236,13 +236,13 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithListenSpec
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeWithListenSpec(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject, jSpec C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- spec, err := jrpc.GoListenSpec(env, jutil.WrapObject(jSpec))
+ spec, err := jrpc.GoListenSpec(env, jutil.WrapObject(uintptr(unsafe.Pointer(jSpec))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -258,8 +258,8 @@
//export Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetListenSpec
func Java_io_v_impl_google_rt_VRuntimeImpl_nativeGetListenSpec(jenv *C.JNIEnv, jRuntime C.jclass, jContext C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -271,4 +271,4 @@
return nil
}
return C.jobject(unsafe.Pointer(jSpec))
-}
\ No newline at end of file
+}
diff --git a/impl/google/services/groups/jni.go b/impl/google/services/groups/jni.go
index 9d564db..38f9834 100644
--- a/impl/google/services/groups/jni.go
+++ b/impl/google/services/groups/jni.go
@@ -23,9 +23,9 @@
import "C"
var (
- contextSign = jutil.ClassSign("io.v.v23.context.VContext")
- storageEngineSign = jutil.ClassSign("io.v.impl.google.services.groups.GroupServer$StorageEngine")
- serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
+ contextSign = jutil.ClassSign("io.v.v23.context.VContext")
+ storageEngineSign = jutil.ClassSign("io.v.impl.google.services.groups.GroupServer$StorageEngine")
+ serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
jVRuntimeImplClass jutil.Class
)
@@ -44,9 +44,9 @@
//export Java_io_v_impl_google_services_groups_GroupServer_nativeWithNewServer
func Java_io_v_impl_google_services_groups_GroupServer_nativeWithNewServer(jenv *C.JNIEnv, jGroupServerClass C.jclass, jContext C.jobject, jGroupServerParams C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- jCtx := jutil.WrapObject(jContext)
- jParams := jutil.WrapObject(jGroupServerParams)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ jCtx := jutil.WrapObject(uintptr(unsafe.Pointer(jContext)))
+ jParams := jutil.WrapObject(uintptr(unsafe.Pointer(jGroupServerParams)))
// Read and translate all of the server params.
name, err := jutil.CallStringMethod(env, jParams, "getName", nil)
diff --git a/impl/google/services/jni.go b/impl/google/services/jni.go
index 9fa0a48..c49304f 100644
--- a/impl/google/services/jni.go
+++ b/impl/google/services/jni.go
@@ -7,11 +7,10 @@
package services
import (
- jutil "v.io/x/jni/util"
jgroups "v.io/x/jni/impl/google/services/groups"
jmounttable "v.io/x/jni/impl/google/services/mounttable"
jsyncbase "v.io/x/jni/impl/google/services/syncbase"
-
+ jutil "v.io/x/jni/util"
)
// #include "jni.h"
@@ -32,4 +31,3 @@
}
return nil
}
-
diff --git a/impl/google/services/mounttable/jni.go b/impl/google/services/mounttable/jni.go
index fafb232..de3b978 100644
--- a/impl/google/services/mounttable/jni.go
+++ b/impl/google/services/mounttable/jni.go
@@ -19,20 +19,20 @@
"v.io/v23/security/access"
"v.io/x/ref/services/mounttable/mounttablelib"
+ "v.io/v23/options"
jrpc "v.io/x/jni/impl/google/rpc"
jutil "v.io/x/jni/util"
jcontext "v.io/x/jni/v23/context"
jaccess "v.io/x/jni/v23/security/access"
- "v.io/v23/options"
)
// #include "jni.h"
import "C"
var (
- permissionsSign = jutil.ClassSign("io.v.v23.security.access.Permissions")
- contextSign = jutil.ClassSign("io.v.v23.context.VContext")
- serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
+ permissionsSign = jutil.ClassSign("io.v.v23.security.access.Permissions")
+ contextSign = jutil.ClassSign("io.v.v23.context.VContext")
+ serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
jVRuntimeImplClass jutil.Class
)
@@ -51,9 +51,9 @@
//export Java_io_v_impl_google_services_mounttable_MountTableServer_nativeWithNewServer
func Java_io_v_impl_google_services_mounttable_MountTableServer_nativeWithNewServer(jenv *C.JNIEnv, jMountTableServerClass C.jclass, jContext C.jobject, jMountTableServerParams C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- jCtx := jutil.WrapObject(jContext)
- jParams := jutil.WrapObject(jMountTableServerParams)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ jCtx := jutil.WrapObject(uintptr(unsafe.Pointer(jContext)))
+ jParams := jutil.WrapObject(uintptr(unsafe.Pointer(jMountTableServerParams)))
// Read and translate all of the server params.
mountName, err := jutil.CallStringMethod(env, jParams, "getName", nil)
diff --git a/impl/google/services/syncbase/jni.go b/impl/google/services/syncbase/jni.go
index e85eccd..9f45603 100644
--- a/impl/google/services/syncbase/jni.go
+++ b/impl/google/services/syncbase/jni.go
@@ -24,10 +24,10 @@
import "C"
var (
- permissionsSign = jutil.ClassSign("io.v.v23.security.access.Permissions")
- contextSign = jutil.ClassSign("io.v.v23.context.VContext")
- storageEngineSign = jutil.ClassSign("io.v.impl.google.services.syncbase.SyncbaseServer$StorageEngine")
- serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
+ permissionsSign = jutil.ClassSign("io.v.v23.security.access.Permissions")
+ contextSign = jutil.ClassSign("io.v.v23.context.VContext")
+ storageEngineSign = jutil.ClassSign("io.v.impl.google.services.syncbase.SyncbaseServer$StorageEngine")
+ serverSign = jutil.ClassSign("io.v.v23.rpc.Server")
jVRuntimeImplClass jutil.Class
)
@@ -46,9 +46,9 @@
//export Java_io_v_impl_google_services_syncbase_SyncbaseServer_nativeWithNewServer
func Java_io_v_impl_google_services_syncbase_SyncbaseServer_nativeWithNewServer(jenv *C.JNIEnv, jSyncbaseServerClass C.jclass, jContext C.jobject, jSyncbaseServerParams C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- jCtx := jutil.WrapObject(jContext)
- jParams := jutil.WrapObject(jSyncbaseServerParams)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ jCtx := jutil.WrapObject(uintptr(unsafe.Pointer(jContext)))
+ jParams := jutil.WrapObject(uintptr(unsafe.Pointer(jSyncbaseServerParams)))
// Read and translate all of the server params.
jPerms, err := jutil.CallObjectMethod(env, jParams, "getPermissions", nil, permissionsSign)
diff --git a/jni.go b/jni.go
index dd324aa..0a9b250 100644
--- a/jni.go
+++ b/jni.go
@@ -8,6 +8,7 @@
import (
"os"
+ "unsafe"
"v.io/x/lib/vlog"
@@ -21,7 +22,7 @@
//export Java_io_v_v23_V_nativeInit
func Java_io_v_v23_V_nativeInit(jenv *C.JNIEnv, jVRuntimeClass C.jclass) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
// Ignore all args except for the first one.
// NOTE(spetrovic): in the future, we could accept all arguments that are
// actually defined in Go. We'd have to manually check.
diff --git a/util/call.go b/util/call.go
index 5423aa1..82b510a 100644
--- a/util/call.go
+++ b/util/call.go
@@ -60,7 +60,7 @@
defer freeFunc()
obj := C.NewObjectA(env.value(), class.value(), jcid, jArr)
err = JExceptionMsg(env)
- return WrapObject(obj), err
+ return WrapObject(uintptr(unsafe.Pointer(obj))), err
}
// jMethodID returns the Java method ID for the given instance (non-static)
@@ -133,7 +133,7 @@
}
defer freeFunc()
ret := C.CallObjectMethodA(env.value(), obj.value(), jmid, jArgArr)
- return WrapObject(ret), JExceptionMsg(env)
+ return WrapObject(uintptr(unsafe.Pointer(ret))), JExceptionMsg(env)
}
// CallStringMethod calls a Java method that returns a string.
@@ -243,7 +243,7 @@
}
defer freeFunc()
ret := C.CallStaticObjectMethodA(env.value(), class.value(), jmid, jArgArr)
- return WrapObject(ret), JExceptionMsg(env)
+ return WrapObject(uintptr(unsafe.Pointer(ret))), JExceptionMsg(env)
}
// CallStaticStringMethod calls a static Java method that returns a string.
diff --git a/util/coding.go b/util/coding.go
index 2eb53c5..f39fa22 100644
--- a/util/coding.go
+++ b/util/coding.go
@@ -7,6 +7,8 @@
package util
import (
+ "unsafe"
+
"v.io/v23/vdl"
"v.io/v23/vom"
)
@@ -46,14 +48,14 @@
// JVomDecode VOM-decodes the provided data into a Java object of the
// given class.
func JVomDecode(env Env, data []byte, class Class) (Object, error) {
- return JVomDecodeWithType(env, data, WrapObject(class.value()))
+ return JVomDecodeWithType(env, data, WrapObject(uintptr(unsafe.Pointer(class.value()))))
}
// JVomDecodeWithType VOM-decodes the provided data into a Java object
// of the given type.
func JVomDecodeWithType(env Env, data []byte, typeObj Object) (Object, error) {
if typeObj.IsNull() {
- typeObj = WrapObject(jObjectClass.value())
+ typeObj = WrapObject(uintptr(unsafe.Pointer(jObjectClass.value())))
}
return CallStaticObjectMethod(env, jVomUtilClass, "decode", []Sign{ByteArraySign, TypeSign}, ObjectSign, data, typeObj)
}
@@ -61,7 +63,7 @@
// JVomCopy copies the provided Go value into a Java object of the given class,
// by encoding/decoding it from VOM.
func JVomCopy(env Env, val interface{}, class Class) (Object, error) {
- return JVomCopyWithType(env, val, WrapObject(class.value()))
+ return JVomCopyWithType(env, val, WrapObject(uintptr(unsafe.Pointer(class.value()))))
}
// JVomCopyWithType copies the provided Go value into a Java object of the
@@ -77,7 +79,7 @@
// GoVomCopy copies the provided Java object into a provided Go value pointer by
// encoding/decoding it from VOM.
func GoVomCopy(env Env, obj Object, class Class, dstptr interface{}) error {
- data, err := JVomEncode(env, obj, WrapObject(class.value()))
+ data, err := JVomEncode(env, obj, WrapObject(uintptr(unsafe.Pointer(class.value()))))
if err != nil {
return err
}
diff --git a/util/ref.go b/util/ref.go
index e7e6445..43dfe3e 100644
--- a/util/ref.go
+++ b/util/ref.go
@@ -20,7 +20,7 @@
// obj argument. The obj argument may be a global or local reference. Global
// references must be explicitly disposed of by calling DeleteGlobalRef().
func NewGlobalRef(env Env, obj Object) Object {
- return WrapObject(C.NewGlobalRef(env.value(), obj.value()))
+ return WrapObject(uintptr(unsafe.Pointer(C.NewGlobalRef(env.value(), obj.value()))))
}
// DeleteGlobalRef deletes the global reference pointed to by obj.
@@ -32,7 +32,7 @@
// given obj may be a global or local reference. Returns null if ref refers
// to null.
func NewLocalRef(env Env, obj Object) Object {
- return WrapObject(C.NewLocalRef(env.value(), obj.value()))
+ return WrapObject(uintptr(unsafe.Pointer(C.NewLocalRef(env.value(), obj.value()))))
}
// GoRef creates a new reference to the value addressed by the provided pointer.
diff --git a/util/type.go b/util/type.go
index 7f490b2..d126e9b 100644
--- a/util/type.go
+++ b/util/type.go
@@ -43,8 +43,8 @@
// WrapEnv returns a new Env from a *C.JNIEnv value (possibly from
// another package).
-func WrapEnv(env interface{}) Env {
- return Env(PtrValue(env))
+func WrapEnv(env uintptr) Env {
+ return Env(env)
}
func (e Env) value() *C.JNIEnv {
@@ -53,8 +53,8 @@
// WrapObject returns a new Object from a C.jobject value (possibly from
// another package).
-func WrapObject(obj interface{}) Object {
- return Object(PtrValue(obj))
+func WrapObject(obj uintptr) Object {
+ return Object(obj)
}
// IsNull returns true iff the Object holds a null C.jobject value.
@@ -68,8 +68,8 @@
// WrapClass returns a new Class from a C.jclass value (possibly from
// another package).
-func WrapClass(class interface{}) Class {
- return Class(PtrValue(class))
+func WrapClass(class uintptr) Class {
+ return Class(class)
}
// IsNull returns true iff the Object holds a null C.jobject value.
diff --git a/util/util.go b/util/util.go
index 0481008..04dbe20 100644
--- a/util/util.go
+++ b/util/util.go
@@ -187,7 +187,7 @@
// GetClass returns the class of the given object.
func GetClass(env Env, obj Object) Class {
- return WrapClass(C.GetObjectClass(env.value(), obj.value()))
+ return WrapClass(uintptr(unsafe.Pointer(C.GetObjectClass(env.value(), obj.value()))))
}
var envRefs = newSafeRefCounter()
@@ -214,7 +214,7 @@
// the thread so the next call to GetEnv on this thread will succeed.
C.AttachCurrentThreadAsDaemon(jVM, &jenv, nil)
}
- env = WrapEnv(jenv)
+ env = WrapEnv(uintptr(unsafe.Pointer(jenv)))
//env := Env{jenv}
// GetEnv is called by Go code that wishes to call Java methods. In
// this case, JNI cannot automatically free unused local refererences.
@@ -255,7 +255,7 @@
func JString(env Env, str string) Object {
cString := C.CString(str)
defer C.free(unsafe.Pointer(cString))
- return WrapObject(C.NewStringUTF(env.value(), cString))
+ return WrapObject(uintptr(unsafe.Pointer(C.NewStringUTF(env.value(), cString))))
}
// JThrow throws a new Java exception of the provided type with the given message.
@@ -290,7 +290,7 @@
// JExceptionMsg returns the exception message as a Go error, if an exception
// occurred, or nil otherwise.
func JExceptionMsg(env Env) error {
- eObj := WrapObject(C.ExceptionOccurred(env.value()))
+ eObj := WrapObject(uintptr(unsafe.Pointer(C.ExceptionOccurred(env.value()))))
if eObj.IsNull() { // no exception
return nil
}
@@ -310,7 +310,7 @@
C.ExceptionClear(env.value())
return fmt.Errorf("error converting VException: exception during VomUtil.encode()")
}
- data := GoByteArray(env, WrapObject(dataObj))
+ data := GoByteArray(env, WrapObject(uintptr(unsafe.Pointer(dataObj))))
var verr error
if err := vom.Decode(data, &verr); err != nil {
return fmt.Errorf("error converting VException: " + err.Error())
@@ -330,7 +330,7 @@
C.ExceptionClear(env.value())
return fmt.Errorf("error converting exception: exception during Throwable.getMessage()")
}
- return errors.New(GoString(env, WrapObject(strObj)))
+ return errors.New(GoString(env, WrapObject(uintptr(unsafe.Pointer(strObj)))))
}
// JObjectField returns the value of the provided Java object's Object field, or
@@ -340,7 +340,7 @@
if err != nil {
return NullObject, err
}
- return WrapObject(C.GetObjectField(env.value(), obj.value(), fid)), nil
+ return WrapObject(uintptr(unsafe.Pointer(C.GetObjectField(env.value(), obj.value(), fid)))), nil
}
// JBoolField returns the value of the provided Java object's boolean field, or
@@ -408,7 +408,7 @@
if err != nil {
return NullObject, err
}
- return WrapObject(C.GetStaticObjectField(env.value(), class.value(), fid)), nil
+ return WrapObject(uintptr(unsafe.Pointer(C.GetStaticObjectField(env.value(), class.value(), fid)))), nil
}
// JStaticStringField returns the value of the static String field of the
@@ -431,7 +431,7 @@
return NullObject, err
}
}
- return WrapObject(arrObj), nil
+ return WrapObject(uintptr(unsafe.Pointer(arrObj))), nil
}
// GoObjectArray converts a Java object array to a Go slice of Java objects.
@@ -442,7 +442,7 @@
length := int(C.GetArrayLength(env.value(), C.jarray(arr.value())))
ret := make([]Object, length)
for i := 0; i < length; i++ {
- ret[i] = WrapObject(C.GetObjectArrayElement(env.value(), C.jobjectArray(arr.value()), C.jsize(i)))
+ ret[i] = WrapObject(uintptr(unsafe.Pointer(C.GetObjectArrayElement(env.value(), C.jobjectArray(arr.value()), C.jsize(i)))))
if err := JExceptionMsg(env); err != nil {
// Out-of-bounds index.
return nil, err
@@ -530,7 +530,7 @@
return NullObject, err
}
}
- return WrapObject(arr), nil
+ return WrapObject(uintptr(unsafe.Pointer(arr))), nil
}
// GoByteArray converts the provided Java byte array into a Go byte slice.
@@ -720,8 +720,8 @@
if err := JExceptionMsg(env); err != nil || class == nil {
return NullClass, fmt.Errorf("couldn't find class %s: %v", name, err)
}
- obj := NewGlobalRef(env, WrapObject(class))
- return WrapClass(C.jclass(obj.value())), nil
+ obj := NewGlobalRef(env, WrapObject(uintptr(unsafe.Pointer(class))))
+ return WrapClass(uintptr(unsafe.Pointer(C.jclass(obj.value())))), nil
}
// GoOptions converts a Java io.v.v23.Options instance into a slice of Go
@@ -811,9 +811,9 @@
// previous frame, you may pass nil for the jFramePtr parameter.
func PopLocalFrame(env Env, result Object) Object {
if result.IsNull() {
- return WrapObject(C.PopLocalFrame(env.value(), nil))
+ return WrapObject(uintptr(unsafe.Pointer(C.PopLocalFrame(env.value(), nil))))
}
- return WrapObject(C.PopLocalFrame(env.value(), result.value()))
+ return WrapObject(uintptr(unsafe.Pointer(C.PopLocalFrame(env.value(), result.value()))))
}
// jFieldID returns the Java field ID for the given object (i.e., non-static)
diff --git a/v23/context/jni.go b/v23/context/jni.go
index daa4c98..dc5d13b 100644
--- a/v23/context/jni.go
+++ b/v23/context/jni.go
@@ -51,7 +51,7 @@
//export Java_io_v_v23_context_VContext_nativeCreate
func Java_io_v_v23_context_VContext_nativeCreate(jenv *C.JNIEnv, jVContext C.jclass) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
ctx, _ := context.RootContext()
jContext, err := JavaContext(env, ctx)
if err != nil {
@@ -63,7 +63,7 @@
//export Java_io_v_v23_context_VContext_nativeDeadline
func Java_io_v_v23_context_VContext_nativeDeadline(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
d, ok := (*(*context.T)(jutil.NativePtr(goPtr))).Deadline()
if !ok {
return nil
@@ -78,7 +78,7 @@
//export Java_io_v_v23_context_VContext_nativeDone
func Java_io_v_v23_context_VContext_nativeDone(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
c := (*(*context.T)(jutil.NativePtr(goPtr))).Done()
jCounter, err := JavaCountDownLatch(env, c)
if err != nil {
@@ -90,8 +90,8 @@
//export Java_io_v_v23_context_VContext_nativeValue
func Java_io_v_v23_context_VContext_nativeValue(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong, jKey C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- key, err := GoContextKey(env, jutil.WrapObject(jKey))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ key, err := GoContextKey(env, jutil.WrapObject(uintptr(unsafe.Pointer(jKey))))
value := (*(*context.T)(jutil.NativePtr(goPtr))).Value(key)
jValue, err := JavaContextValue(env, value)
if err != nil {
@@ -103,7 +103,7 @@
//export Java_io_v_v23_context_VContext_nativeWithCancel
func Java_io_v_v23_context_VContext_nativeWithCancel(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
ctx, cancelFunc := context.WithCancel((*context.T)(jutil.NativePtr(goPtr)))
jCtx, err := JavaCancelableContext(env, ctx, cancelFunc)
if err != nil {
@@ -115,8 +115,8 @@
//export Java_io_v_v23_context_VContext_nativeWithDeadline
func Java_io_v_v23_context_VContext_nativeWithDeadline(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong, jDeadline C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- deadline, err := jutil.GoTime(env, jutil.WrapObject(jDeadline))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ deadline, err := jutil.GoTime(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDeadline))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -132,8 +132,8 @@
//export Java_io_v_v23_context_VContext_nativeWithTimeout
func Java_io_v_v23_context_VContext_nativeWithTimeout(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong, jTimeout C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- timeout, err := jutil.GoDuration(env, jutil.WrapObject(jTimeout))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ timeout, err := jutil.GoDuration(env, jutil.WrapObject(uintptr(unsafe.Pointer(jTimeout))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -149,13 +149,13 @@
//export Java_io_v_v23_context_VContext_nativeWithValue
func Java_io_v_v23_context_VContext_nativeWithValue(jenv *C.JNIEnv, jVContext C.jobject, goPtr C.jlong, jKey C.jobject, jValue C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- key, err := GoContextKey(env, jutil.WrapObject(jKey))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ key, err := GoContextKey(env, jutil.WrapObject(uintptr(unsafe.Pointer(jKey))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- value, err := GoContextValue(env, jutil.WrapObject(jValue))
+ value, err := GoContextValue(env, jutil.WrapObject(uintptr(unsafe.Pointer(jValue))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -184,4 +184,4 @@
//export Java_io_v_v23_context_CancelableVContext_nativeFinalize
func Java_io_v_v23_context_CancelableVContext_nativeFinalize(jenv *C.JNIEnv, jCancelableVContext C.jobject, goCancelPtr C.jlong) {
jutil.GoUnref(jutil.NativePtr(goCancelPtr))
-}
\ No newline at end of file
+}
diff --git a/v23/i18n/jni.go b/v23/i18n/jni.go
index cd7dbd9..6c68645 100644
--- a/v23/i18n/jni.go
+++ b/v23/i18n/jni.go
@@ -25,9 +25,9 @@
//export Java_io_v_v23_i18n_Catalog_nativeFormatParams
func Java_io_v_v23_i18n_Catalog_nativeFormatParams(jenv *C.JNIEnv, jCatalog C.jclass, jFormat C.jstring, jParams C.jobjectArray) C.jstring {
- env := jutil.WrapEnv(jenv)
- format := jutil.GoString(env, jutil.WrapObject(jFormat))
- strParams, err := jutil.GoStringArray(env, jutil.WrapObject(jParams))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ format := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jFormat))))
+ strParams, err := jutil.GoStringArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jParams))))
if err != nil {
jutil.JThrowV(env, err)
return nil
diff --git a/v23/security/access/jni.go b/v23/security/access/jni.go
index 00531f2..9c75f0b 100644
--- a/v23/security/access/jni.go
+++ b/v23/security/access/jni.go
@@ -42,8 +42,8 @@
//export Java_io_v_v23_security_access_AccessList_nativeCreate
func Java_io_v_v23_security_access_AccessList_nativeCreate(jenv *C.JNIEnv, jAccessList C.jobject) C.jlong {
- env := jutil.WrapEnv(jenv)
- acl, err := GoAccessList(env, jutil.WrapObject(jAccessList))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ acl, err := GoAccessList(env, jutil.WrapObject(uintptr(unsafe.Pointer(jAccessList))))
if err != nil {
jutil.JThrowV(env, err)
return C.jlong(0)
@@ -54,8 +54,8 @@
//export Java_io_v_v23_security_access_AccessList_nativeIncludes
func Java_io_v_v23_security_access_AccessList_nativeIncludes(jenv *C.JNIEnv, jAccessList C.jobject, goPtr C.jlong, jBlessings C.jobjectArray) C.jboolean {
- env := jutil.WrapEnv(jenv)
- blessings, err := jutil.GoStringArray(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := jutil.GoStringArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return C.JNI_FALSE
@@ -69,13 +69,13 @@
//export Java_io_v_v23_security_access_AccessList_nativeAuthorize
func Java_io_v_v23_security_access_AccessList_nativeAuthorize(jenv *C.JNIEnv, jAccessList C.jobject, goPtr C.jlong, jCtx C.jobject, jCall C.jobject) {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jCtx))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCtx))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- call, err := jsecurity.GoCall(env, jutil.WrapObject(jCall))
+ call, err := jsecurity.GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
}
@@ -92,13 +92,13 @@
//export Java_io_v_v23_security_access_PermissionsAuthorizer_nativeCreate
func Java_io_v_v23_security_access_PermissionsAuthorizer_nativeCreate(jenv *C.JNIEnv, jPermissionsAuthorizerClass C.jclass, jPermissions C.jobject, jTagType C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- perms, err := GoPermissions(env, jutil.WrapObject(jPermissions))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ perms, err := GoPermissions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPermissions))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- tagType, err := jutil.GoVdlType(env, jutil.WrapObject(jTagType))
+ tagType, err := jutil.GoVdlType(env, jutil.WrapObject(uintptr(unsafe.Pointer(jTagType))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -108,8 +108,8 @@
jutil.JThrowV(env, err)
return nil
}
- jutil.GoRef(&authorizer) // Un-refed when the Java PermissionsAuthorizer is finalized
- jAuthorizer, err := jutil.NewObject(env, jutil.WrapClass(jPermissionsAuthorizerClass), []jutil.Sign{jutil.LongSign}, int64(jutil.PtrValue(&authorizer)))
+ jutil.GoRef(&authorizer) // Un-refed when the Java PermissionsAuthorizer is finalized
+ jAuthorizer, err := jutil.NewObject(env, jutil.WrapClass(uintptr(unsafe.Pointer(jPermissionsAuthorizerClass))), []jutil.Sign{jutil.LongSign}, int64(jutil.PtrValue(&authorizer)))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -119,13 +119,13 @@
//export Java_io_v_v23_security_access_PermissionsAuthorizer_nativeAuthorize
func Java_io_v_v23_security_access_PermissionsAuthorizer_nativeAuthorize(jenv *C.JNIEnv, jPermissionsAuthorizer C.jobject, goPtr C.jlong, jContext C.jobject, jCall C.jobject) {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- call, err := jsecurity.GoCall(env, jutil.WrapObject(jCall))
+ call, err := jsecurity.GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
return
diff --git a/v23/security/caveats.go b/v23/security/caveats.go
index 4abe029..d49b0b5 100644
--- a/v23/security/caveats.go
+++ b/v23/security/caveats.go
@@ -19,10 +19,10 @@
import "C"
var systemCaveats = map[uniqueid.Id]bool{
- security.ConstCaveat.Id: true,
- security.ExpiryCaveat.Id: true,
- security.MethodCaveat.Id: true,
- security.PeerBlessingsCaveat.Id: true,
+ security.ConstCaveat.Id: true,
+ security.ExpiryCaveat.Id: true,
+ security.MethodCaveat.Id: true,
+ security.PeerBlessingsCaveat.Id: true,
security.PublicKeyThirdPartyCaveat.Id: true,
}
diff --git a/v23/security/jni.go b/v23/security/jni.go
index b363e97..9c6de3f 100644
--- a/v23/security/jni.go
+++ b/v23/security/jni.go
@@ -143,7 +143,7 @@
//export Java_io_v_v23_security_CallImpl_nativeTimestamp
func Java_io_v_v23_security_CallImpl_nativeTimestamp(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
t := (*(*security.Call)(jutil.NativePtr(goPtr))).Timestamp()
jTime, err := jutil.JTime(env, t)
if err != nil {
@@ -155,7 +155,7 @@
//export Java_io_v_v23_security_CallImpl_nativeMethod
func Java_io_v_v23_security_CallImpl_nativeMethod(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
method := (*(*security.Call)(jutil.NativePtr(goPtr))).Method()
jMethod := jutil.JString(env, jutil.CamelCase(method))
return C.jstring(unsafe.Pointer(jMethod))
@@ -163,7 +163,7 @@
//export Java_io_v_v23_security_CallImpl_nativeMethodTags
func Java_io_v_v23_security_CallImpl_nativeMethodTags(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
tags := (*(*security.Call)(jutil.NativePtr(goPtr))).MethodTags()
jTags, err := jutil.JVDLValueArray(env, tags)
if err != nil {
@@ -175,14 +175,14 @@
//export Java_io_v_v23_security_CallImpl_nativeSuffix
func Java_io_v_v23_security_CallImpl_nativeSuffix(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jSuffix := jutil.JString(env, (*(*security.Call)(jutil.NativePtr(goPtr))).Suffix())
return C.jstring(unsafe.Pointer(jSuffix))
}
//export Java_io_v_v23_security_CallImpl_nativeRemoteDischarges
func Java_io_v_v23_security_CallImpl_nativeRemoteDischarges(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
remoteDischarges := (*(*security.Call)(jutil.NativePtr(goPtr))).RemoteDischarges()
jObjectMap, err := javaDischargeMap(env, remoteDischarges)
if err != nil {
@@ -194,7 +194,7 @@
//export Java_io_v_v23_security_CallImpl_nativeLocalDischarges
func Java_io_v_v23_security_CallImpl_nativeLocalDischarges(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
localDischarges := (*(*security.Call)(jutil.NativePtr(goPtr))).LocalDischarges()
jObjectMap, err := javaDischargeMap(env, localDischarges)
if err != nil {
@@ -206,14 +206,14 @@
//export Java_io_v_v23_security_CallImpl_nativeLocalEndpoint
func Java_io_v_v23_security_CallImpl_nativeLocalEndpoint(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jEndpoint := jutil.JString(env, (*(*security.Call)(jutil.NativePtr(goPtr))).LocalEndpoint().String())
return C.jstring(unsafe.Pointer(jEndpoint))
}
//export Java_io_v_v23_security_CallImpl_nativeRemoteEndpoint
func Java_io_v_v23_security_CallImpl_nativeRemoteEndpoint(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
jEndpoint := jutil.JString(env, (*(*security.Call)(jutil.NativePtr(goPtr))).RemoteEndpoint().String())
return C.jstring(unsafe.Pointer(jEndpoint))
@@ -221,7 +221,7 @@
//export Java_io_v_v23_security_CallImpl_nativeLocalPrincipal
func Java_io_v_v23_security_CallImpl_nativeLocalPrincipal(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
principal := (*(*security.Call)(jutil.NativePtr(goPtr))).LocalPrincipal()
jPrincipal, err := JavaPrincipal(env, principal)
if err != nil {
@@ -233,7 +233,7 @@
//export Java_io_v_v23_security_CallImpl_nativeLocalBlessings
func Java_io_v_v23_security_CallImpl_nativeLocalBlessings(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessings := (*(*security.Call)(jutil.NativePtr(goPtr))).LocalBlessings()
jBlessings, err := JavaBlessings(env, blessings)
if err != nil {
@@ -245,7 +245,7 @@
//export Java_io_v_v23_security_CallImpl_nativeRemoteBlessings
func Java_io_v_v23_security_CallImpl_nativeRemoteBlessings(jenv *C.JNIEnv, jCall C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessings := (*(*security.Call)(jutil.NativePtr(goPtr))).RemoteBlessings()
jBlessings, err := JavaBlessings(env, blessings)
if err != nil {
@@ -262,7 +262,7 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeCreate
func Java_io_v_v23_security_VPrincipalImpl_nativeCreate(jenv *C.JNIEnv, jclass C.jclass) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
principal, err := vsecurity.NewPrincipal()
if err != nil {
jutil.JThrowV(env, err)
@@ -278,8 +278,8 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeCreateForSigner
func Java_io_v_v23_security_VPrincipalImpl_nativeCreateForSigner(jenv *C.JNIEnv, jclass C.jclass, jSigner C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- signerObj := jutil.WrapObject(jSigner)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ signerObj := jutil.WrapObject(uintptr(unsafe.Pointer(jSigner)))
signer, err := GoSigner(env, signerObj)
if err != nil {
jutil.JThrowV(env, err)
@@ -301,10 +301,10 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeCreateForAll
func Java_io_v_v23_security_VPrincipalImpl_nativeCreateForAll(jenv *C.JNIEnv, jclass C.jclass, jSigner C.jobject, jStore C.jobject, jRoots C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- signerObj := jutil.WrapObject(jSigner)
- storeObj := jutil.WrapObject(jStore)
- rootsObj := jutil.WrapObject(jRoots)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ signerObj := jutil.WrapObject(uintptr(unsafe.Pointer(jSigner)))
+ storeObj := jutil.WrapObject(uintptr(unsafe.Pointer(jStore)))
+ rootsObj := jutil.WrapObject(uintptr(unsafe.Pointer(jRoots)))
signer, err := GoSigner(env, signerObj)
if err != nil {
jutil.JThrowV(env, err)
@@ -338,9 +338,9 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeCreatePersistent
func Java_io_v_v23_security_VPrincipalImpl_nativeCreatePersistent(jenv *C.JNIEnv, jclass C.jclass, jPassphrase C.jstring, jDir C.jstring) C.jobject {
- env := jutil.WrapEnv(jenv)
- passphrase := jutil.GoString(env, jutil.WrapObject(jPassphrase))
- dir := jutil.GoString(env, jutil.WrapObject(jDir))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ passphrase := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPassphrase))))
+ dir := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDir))))
principal, err := vsecurity.LoadPersistentPrincipal(dir, []byte(passphrase))
if err != nil {
if principal, err = vsecurity.CreatePersistentPrincipal(dir, []byte(passphrase)); err != nil {
@@ -358,14 +358,14 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeCreatePersistentForSigner
func Java_io_v_v23_security_VPrincipalImpl_nativeCreatePersistentForSigner(jenv *C.JNIEnv, jclass C.jclass, jSigner C.jobject, jDir C.jstring) C.jobject {
- env := jutil.WrapEnv(jenv)
- signerObj := jutil.WrapObject(jSigner)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ signerObj := jutil.WrapObject(uintptr(unsafe.Pointer(jSigner)))
signer, err := GoSigner(env, signerObj)
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- dir := jutil.GoString(env, jutil.WrapObject(jDir))
+ dir := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDir))))
stateSerializer, err := vsecurity.NewPrincipalStateSerializer(dir)
if err != nil {
jutil.JThrowV(env, err)
@@ -387,24 +387,24 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeBless
func Java_io_v_v23_security_VPrincipalImpl_nativeBless(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong, jKey C.jobject, jWith C.jobject, jExtension C.jstring, jCaveat C.jobject, jAdditionalCaveats C.jobjectArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- key, err := GoPublicKey(env, jutil.WrapObject(jKey))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ key, err := GoPublicKey(env, jutil.WrapObject(uintptr(unsafe.Pointer(jKey))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- with, err := GoBlessings(env, jutil.WrapObject(jWith))
+ with, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jWith))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- extension := jutil.GoString(env, jutil.WrapObject(jExtension))
- caveat, err := GoCaveat(env, jutil.WrapObject(jCaveat))
+ extension := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jExtension))))
+ caveat, err := GoCaveat(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCaveat))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- additionalCaveats, err := GoCaveats(env, jutil.WrapObject(jAdditionalCaveats))
+ additionalCaveats, err := GoCaveats(env, jutil.WrapObject(uintptr(unsafe.Pointer(jAdditionalCaveats))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -424,9 +424,9 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeBlessSelf
func Java_io_v_v23_security_VPrincipalImpl_nativeBlessSelf(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong, jName C.jstring, jCaveats C.jobjectArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- name := jutil.GoString(env, jutil.WrapObject(jName))
- caveats, err := GoCaveats(env, jutil.WrapObject(jCaveats))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ name := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jName))))
+ caveats, err := GoCaveats(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCaveats))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -446,8 +446,8 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeSign
func Java_io_v_v23_security_VPrincipalImpl_nativeSign(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong, jMessage C.jbyteArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- message := jutil.GoByteArray(env, jutil.WrapObject(jMessage))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ message := jutil.GoByteArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jMessage))))
sig, err := (*(*security.Principal)(jutil.NativePtr(goPtr))).Sign(message)
if err != nil {
jutil.JThrowV(env, err)
@@ -463,7 +463,7 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativePublicKey
func Java_io_v_v23_security_VPrincipalImpl_nativePublicKey(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
key := (*(*security.Principal)(jutil.NativePtr(goPtr))).PublicKey()
jKey, err := JavaPublicKey(env, key)
if err != nil {
@@ -475,8 +475,8 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeBlessingsInfo
func Java_io_v_v23_security_VPrincipalImpl_nativeBlessingsInfo(jenv *C.JNIEnv, jPrincipalImpl C.jobject, goPtr C.jlong, jBlessings C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- blessings, err := GoBlessings(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -502,7 +502,7 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeBlessingStore
func Java_io_v_v23_security_VPrincipalImpl_nativeBlessingStore(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
store := (*(*security.Principal)(jutil.NativePtr(goPtr))).BlessingStore()
jStore, err := JavaBlessingStore(env, store)
if err != nil {
@@ -514,7 +514,7 @@
//export Java_io_v_v23_security_VPrincipalImpl_nativeRoots
func Java_io_v_v23_security_VPrincipalImpl_nativeRoots(jenv *C.JNIEnv, jVPrincipalImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
roots := (*(*security.Principal)(jutil.NativePtr(goPtr))).Roots()
jRoots, err := JavaBlessingRoots(env, roots)
if err != nil {
@@ -531,9 +531,9 @@
//export Java_io_v_v23_security_Blessings_nativeCreate
func Java_io_v_v23_security_Blessings_nativeCreate(jenv *C.JNIEnv, jBlessingsClass C.jclass, jWire C.jobject) C.jlong {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
var blessings security.Blessings
- if err := jutil.GoVomCopy(env, jutil.WrapObject(jWire), jWireBlessingsClass, &blessings); err != nil {
+ if err := jutil.GoVomCopy(env, jutil.WrapObject(uintptr(unsafe.Pointer(jWire))), jWireBlessingsClass, &blessings); err != nil {
jutil.JThrowV(env, err)
return C.jlong(0)
}
@@ -543,8 +543,8 @@
//export Java_io_v_v23_security_Blessings_nativeCreateUnion
func Java_io_v_v23_security_Blessings_nativeCreateUnion(jenv *C.JNIEnv, jBlessingsClass C.jclass, jBlessingsArr C.jobjectArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- blessingsArr, err := GoBlessingsArray(env, jutil.WrapObject(jBlessingsArr))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessingsArr, err := GoBlessingsArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessingsArr))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -564,7 +564,7 @@
//export Java_io_v_v23_security_Blessings_nativePublicKey
func Java_io_v_v23_security_Blessings_nativePublicKey(jenv *C.JNIEnv, jBlessings C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
key := (*(*security.Blessings)(jutil.NativePtr(goPtr))).PublicKey()
jPublicKey, err := JavaPublicKey(env, key)
if err != nil {
@@ -576,7 +576,7 @@
//export Java_io_v_v23_security_Blessings_nativeSigningBlessings
func Java_io_v_v23_security_Blessings_nativeSigningBlessings(jenv *C.JNIEnv, jBlessings C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessings := security.SigningBlessings(*(*security.Blessings)(jutil.NativePtr(goPtr)))
jSigningBlessings, err := JavaBlessings(env, blessings)
if err != nil {
@@ -588,7 +588,7 @@
//export Java_io_v_v23_security_Blessings_nativeWireFormat
func Java_io_v_v23_security_Blessings_nativeWireFormat(jenv *C.JNIEnv, jBlessings C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
wire := security.MarshalBlessings(*(*security.Blessings)(jutil.NativePtr(goPtr)))
jWire, err := JavaWireBlessings(env, wire)
if err != nil {
@@ -605,13 +605,13 @@
//export Java_io_v_v23_security_BlessingRootsImpl_nativeAdd
func Java_io_v_v23_security_BlessingRootsImpl_nativeAdd(jenv *C.JNIEnv, jBlessingRootsImpl C.jobject, goPtr C.jlong, jRoot C.jobject, jPattern C.jobject) {
- env := jutil.WrapEnv(jenv)
- root, err := JavaPublicKeyToDER(env, jutil.WrapObject(jRoot))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ root, err := JavaPublicKeyToDER(env, jutil.WrapObject(uintptr(unsafe.Pointer(jRoot))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- pattern, err := GoBlessingPattern(env, jutil.WrapObject(jPattern))
+ pattern, err := GoBlessingPattern(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPattern))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -624,13 +624,13 @@
//export Java_io_v_v23_security_BlessingRootsImpl_nativeRecognized
func Java_io_v_v23_security_BlessingRootsImpl_nativeRecognized(jenv *C.JNIEnv, jBlessingRootsImpl C.jobject, goPtr C.jlong, jRoot C.jobject, jBlessing C.jstring) {
- env := jutil.WrapEnv(jenv)
- root, err := JavaPublicKeyToDER(env, jutil.WrapObject(jRoot))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ root, err := JavaPublicKeyToDER(env, jutil.WrapObject(uintptr(unsafe.Pointer(jRoot))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- blessing := jutil.GoString(env, jutil.WrapObject(jBlessing))
+ blessing := jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessing))))
if err := (*(*security.BlessingRoots)(jutil.NativePtr(goPtr))).Recognized(root, blessing); err != nil {
jutil.JThrowV(env, err)
}
@@ -638,7 +638,7 @@
//export Java_io_v_v23_security_BlessingRootsImpl_nativeDebugString
func Java_io_v_v23_security_BlessingRootsImpl_nativeDebugString(jenv *C.JNIEnv, jBlessingRootsImpl C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
debug := (*(*security.BlessingRoots)(jutil.NativePtr(goPtr))).DebugString()
jDebug := jutil.JString(env, debug)
return C.jstring(unsafe.Pointer(jDebug))
@@ -646,7 +646,7 @@
//export Java_io_v_v23_security_BlessingRootsImpl_nativeToString
func Java_io_v_v23_security_BlessingRootsImpl_nativeToString(jenv *C.JNIEnv, jBlessingRootsImpl C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
str := fmt.Sprintf("%v", (*(*security.BlessingRoots)(jutil.NativePtr(goPtr))))
jStr := jutil.JString(env, str)
return C.jstring(unsafe.Pointer(jStr))
@@ -654,7 +654,7 @@
//export Java_io_v_v23_security_BlessingRootsImpl_nativeDump
func Java_io_v_v23_security_BlessingRootsImpl_nativeDump(jenv *C.JNIEnv, jBlessingRootsImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
dump := (*(*security.BlessingRoots)(jutil.NativePtr(goPtr))).Dump()
result := make(map[jutil.Object][]jutil.Object)
for pattern, keys := range dump {
@@ -688,13 +688,13 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeSet
func Java_io_v_v23_security_BlessingStoreImpl_nativeSet(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jBlessings C.jobject, jForPeers C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- blessings, err := GoBlessings(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- forPeers, err := GoBlessingPattern(env, jutil.WrapObject(jForPeers))
+ forPeers, err := GoBlessingPattern(env, jutil.WrapObject(uintptr(unsafe.Pointer(jForPeers))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -714,8 +714,8 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeForPeer
func Java_io_v_v23_security_BlessingStoreImpl_nativeForPeer(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jPeerBlessings C.jobjectArray) C.jobject {
- env := jutil.WrapEnv(jenv)
- peerBlessings, err := jutil.GoStringArray(env, jutil.WrapObject(jPeerBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ peerBlessings, err := jutil.GoStringArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPeerBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -731,8 +731,8 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeSetDefaultBlessings
func Java_io_v_v23_security_BlessingStoreImpl_nativeSetDefaultBlessings(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jBlessings C.jobject) {
- env := jutil.WrapEnv(jenv)
- blessings, err := GoBlessings(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -744,7 +744,7 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeDefaultBlessings
func Java_io_v_v23_security_BlessingStoreImpl_nativeDefaultBlessings(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessings := (*(*security.BlessingStore)(jutil.NativePtr(goPtr))).Default()
jBlessings, err := JavaBlessings(env, blessings)
if err != nil {
@@ -756,7 +756,7 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativePublicKey
func Java_io_v_v23_security_BlessingStoreImpl_nativePublicKey(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
key := (*(*security.BlessingStore)(jutil.NativePtr(goPtr))).PublicKey()
jKey, err := JavaPublicKey(env, key)
if err != nil {
@@ -768,7 +768,7 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativePeerBlessings
func Java_io_v_v23_security_BlessingStoreImpl_nativePeerBlessings(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessingsMap := (*(*security.BlessingStore)(jutil.NativePtr(goPtr))).PeerBlessings()
bmap := make(map[jutil.Object]jutil.Object)
for pattern, blessings := range blessingsMap {
@@ -794,20 +794,20 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeCacheDischarge
func Java_io_v_v23_security_BlessingStoreImpl_nativeCacheDischarge(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jDischarge C.jobject, jCaveat C.jobject, jImpetus C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessingStore := *(*security.BlessingStore)(jutil.NativePtr(goPtr))
- discharge, err := GoDischarge(env, jutil.WrapObject(jDischarge))
+ discharge, err := GoDischarge(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDischarge))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- caveat, err := GoCaveat(env, jutil.WrapObject(jCaveat))
+ caveat, err := GoCaveat(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCaveat))))
if err != nil {
jutil.JThrowV(env, err)
return
}
var impetus security.DischargeImpetus
- err = jutil.GoVomCopy(env, jutil.WrapObject(jImpetus), jDischargeImpetusClass, &impetus)
+ err = jutil.GoVomCopy(env, jutil.WrapObject(uintptr(unsafe.Pointer(jImpetus))), jDischargeImpetusClass, &impetus)
if err != nil {
jutil.JThrowV(env, err)
return
@@ -817,9 +817,9 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeClearDischarges
func Java_io_v_v23_security_BlessingStoreImpl_nativeClearDischarges(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jDischarges C.jobject) {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessingStore := *(*security.BlessingStore)(jutil.NativePtr(goPtr))
- arr, err := jutil.GoObjectArray(env, jutil.WrapObject(jDischarges))
+ arr, err := jutil.GoObjectArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jDischarges))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -838,15 +838,15 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeDischarge
func Java_io_v_v23_security_BlessingStoreImpl_nativeDischarge(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong, jCaveat C.jobject, jImpetus C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
blessingStore := *(*security.BlessingStore)(jutil.NativePtr(goPtr))
- caveat, err := GoCaveat(env, jutil.WrapObject(jCaveat))
+ caveat, err := GoCaveat(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCaveat))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
var impetus security.DischargeImpetus
- err = jutil.GoVomCopy(env, jutil.WrapObject(jImpetus), jDischargeImpetusClass, &impetus)
+ err = jutil.GoVomCopy(env, jutil.WrapObject(uintptr(unsafe.Pointer(jImpetus))), jDischargeImpetusClass, &impetus)
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -862,7 +862,7 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeDebugString
func Java_io_v_v23_security_BlessingStoreImpl_nativeDebugString(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
debug := (*(*security.BlessingStore)(jutil.NativePtr(goPtr))).DebugString()
jDebug := jutil.JString(env, debug)
return C.jstring(unsafe.Pointer(jDebug))
@@ -870,7 +870,7 @@
//export Java_io_v_v23_security_BlessingStoreImpl_nativeToString
func Java_io_v_v23_security_BlessingStoreImpl_nativeToString(jenv *C.JNIEnv, jBlessingStoreImpl C.jobject, goPtr C.jlong) C.jstring {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
str := fmt.Sprintf("%s", (*(*security.BlessingStore)(jutil.NativePtr(goPtr))))
jStr := jutil.JString(env, str)
return C.jstring(unsafe.Pointer(jStr))
@@ -883,16 +883,16 @@
//export Java_io_v_v23_security_BlessingPattern_nativeCreate
func Java_io_v_v23_security_BlessingPattern_nativeCreate(jenv *C.JNIEnv, jBlessingPatternClass C.jclass, jValue C.jstring) C.jlong {
- env := jutil.WrapEnv(jenv)
- pattern := security.BlessingPattern(jutil.GoString(env, jutil.WrapObject(jValue)))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ pattern := security.BlessingPattern(jutil.GoString(env, jutil.WrapObject(uintptr(unsafe.Pointer(jValue)))))
jutil.GoRef(&pattern) // Un-refed when the BlessingPattern object is finalized.
return C.jlong(jutil.PtrValue(&pattern))
}
//export Java_io_v_v23_security_BlessingPattern_nativeIsMatchedBy
func Java_io_v_v23_security_BlessingPattern_nativeIsMatchedBy(jenv *C.JNIEnv, jBlessingPattern C.jobject, goPtr C.jlong, jBlessings C.jobjectArray) C.jboolean {
- env := jutil.WrapEnv(jenv)
- blessings, err := jutil.GoStringArray(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := jutil.GoStringArray(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return C.JNI_FALSE
@@ -916,7 +916,7 @@
//export Java_io_v_v23_security_BlessingPattern_nativeMakeNonExtendable
func Java_io_v_v23_security_BlessingPattern_nativeMakeNonExtendable(jenv *C.JNIEnv, jBlessingPattern C.jobject, goPtr C.jlong) C.jobject {
- env := jutil.WrapEnv(jenv)
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
pattern := (*(*security.BlessingPattern)(jutil.NativePtr(goPtr))).MakeNonExtendable()
jPattern, err := JavaBlessingPattern(env, pattern)
if err != nil {
@@ -933,18 +933,18 @@
//export Java_io_v_v23_security_PublicKeyThirdPartyCaveatValidator_nativeValidate
func Java_io_v_v23_security_PublicKeyThirdPartyCaveatValidator_nativeValidate(jenv *C.JNIEnv, jThirdPartyValidatorClass C.jclass, jContext C.jobject, jCall C.jobject, jCaveatParam C.jobject) {
- env := jutil.WrapEnv(jenv)
- param, err := jutil.GoVomCopyValue(env, jutil.WrapObject(jCaveatParam))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ param, err := jutil.GoVomCopyValue(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCaveatParam))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- call, err := GoCall(env, jutil.WrapObject(jCall))
+ call, err := GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
return
@@ -962,13 +962,13 @@
//export Java_io_v_v23_security_VSecurity_nativeGetRemoteBlessingNames
func Java_io_v_v23_security_VSecurity_nativeGetRemoteBlessingNames(jenv *C.JNIEnv, jVSecurityClass C.jclass, jCtx C.jobject, jCall C.jobject) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jCtx))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCtx))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- call, err := GoCall(env, jutil.WrapObject(jCall))
+ call, err := GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -984,18 +984,18 @@
//export Java_io_v_v23_security_VSecurity_nativeGetSigningBlessingNames
func Java_io_v_v23_security_VSecurity_nativeGetSigningBlessingNames(jenv *C.JNIEnv, jVSecurityClass C.jclass, jCtx C.jobject, jPrincipal C.jobject, jBlessings C.jobject) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jCtx))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCtx))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- principal, err := GoPrincipal(env, jutil.WrapObject(jPrincipal))
+ principal, err := GoPrincipal(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPrincipal))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- blessings, err := GoBlessings(env, jutil.WrapObject(jBlessings))
+ blessings, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -1011,13 +1011,13 @@
//export Java_io_v_v23_security_VSecurity_nativeGetLocalBlessingNames
func Java_io_v_v23_security_VSecurity_nativeGetLocalBlessingNames(jenv *C.JNIEnv, jVSecurityClass C.jclass, jCtx C.jobject, jCall C.jobject) C.jobjectArray {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jCtx))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCtx))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- call, err := GoCall(env, jutil.WrapObject(jCall))
+ call, err := GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -1033,13 +1033,13 @@
//export Java_io_v_v23_security_VSecurity_nativeAddToRoots
func Java_io_v_v23_security_VSecurity_nativeAddToRoots(jenv *C.JNIEnv, jVPrincipalClass C.jclass, jPrincipal C.jobject, jBlessings C.jobject) {
- env := jutil.WrapEnv(jenv)
- blessings, err := GoBlessings(env, jutil.WrapObject(jBlessings))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ blessings, err := GoBlessings(env, jutil.WrapObject(uintptr(unsafe.Pointer(jBlessings))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- principal, err := GoPrincipal(env, jutil.WrapObject(jPrincipal))
+ principal, err := GoPrincipal(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPrincipal))))
if err != nil {
jutil.JThrowV(env, err)
}
diff --git a/v23/security/util.go b/v23/security/util.go
index 4cc0993..b5b352c 100644
--- a/v23/security/util.go
+++ b/v23/security/util.go
@@ -96,8 +96,8 @@
if err != nil {
return security.Caveat{}, err
}
- return security.Caveat {
- Id: id,
+ return security.Caveat{
+ Id: id,
ParamVom: paramVom,
}, nil
}
diff --git a/v23/services/groups/jni.go b/v23/services/groups/jni.go
index 573c339..e1a2a8e 100644
--- a/v23/services/groups/jni.go
+++ b/v23/services/groups/jni.go
@@ -27,20 +27,20 @@
//export Java_io_v_v23_services_groups_PermissionsAuthorizer_nativeCreate
func Java_io_v_v23_services_groups_PermissionsAuthorizer_nativeCreate(jenv *C.JNIEnv, jPermissionsAuthorizerClass C.jclass, jPermissions C.jobject, jTagType C.jobject) C.jobject {
- env := jutil.WrapEnv(jenv)
- perms, err := jaccess.GoPermissions(env, jutil.WrapObject(jPermissions))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ perms, err := jaccess.GoPermissions(env, jutil.WrapObject(uintptr(unsafe.Pointer(jPermissions))))
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- tagType, err := jutil.GoVdlType(env, jutil.WrapObject(jTagType))
+ tagType, err := jutil.GoVdlType(env, jutil.WrapObject(uintptr(unsafe.Pointer(jTagType))))
authorizer, err := groups.PermissionsAuthorizer(perms, tagType)
if err != nil {
jutil.JThrowV(env, err)
return nil
}
- jutil.GoRef(&authorizer) // Un-refed when the Java PermissionsAuthorizer is finalized
- jAuthorizer, err := jutil.NewObject(env, jutil.WrapClass(jPermissionsAuthorizerClass), []jutil.Sign{jutil.LongSign}, int64(jutil.PtrValue(&authorizer)))
+ jutil.GoRef(&authorizer) // Un-refed when the Java PermissionsAuthorizer is finalized
+ jAuthorizer, err := jutil.NewObject(env, jutil.WrapClass(uintptr(unsafe.Pointer(jPermissionsAuthorizerClass))), []jutil.Sign{jutil.LongSign}, int64(jutil.PtrValue(&authorizer)))
if err != nil {
jutil.JThrowV(env, err)
return nil
@@ -50,13 +50,13 @@
//export Java_io_v_v23_services_groups_PermissionsAuthorizer_nativeAuthorize
func Java_io_v_v23_services_groups_PermissionsAuthorizer_nativeAuthorize(jenv *C.JNIEnv, jPermissionsAuthorizer C.jobject, goPtr C.jlong, jContext C.jobject, jCall C.jobject) {
- env := jutil.WrapEnv(jenv)
- ctx, err := jcontext.GoContext(env, jutil.WrapObject(jContext))
+ env := jutil.WrapEnv(uintptr(unsafe.Pointer(jenv)))
+ ctx, err := jcontext.GoContext(env, jutil.WrapObject(uintptr(unsafe.Pointer(jContext))))
if err != nil {
jutil.JThrowV(env, err)
return
}
- call, err := jsecurity.GoCall(env, jutil.WrapObject(jCall))
+ call, err := jsecurity.GoCall(env, jutil.WrapObject(uintptr(unsafe.Pointer(jCall))))
if err != nil {
jutil.JThrowV(env, err)
return