2
0
mirror of synced 2025-02-24 23:38:22 +00:00
mobile/bind/testdata/issue12328.java.c.golden
Elias Naur 80e11ad074 mobile/bind: move generated Java classes to package level
Before this CL, generated Java classes or interfaces were inner
classes to the top package class. That is both unnecessary and creates
ugly class names. Instead, move every generated class and interface to its
own package level class.

NOTE: This is a backwards incompatible change and requires every client
of gomobile APIs to be updated to leave out the package class in the
type names. For example, the Go type

package pkg

type S struct {
}

now generates (with the default java package name go) a Java class named
go.pkg.S. The name before this CL was go.pkg.Pkg.S.

Also, change the custom java package to specify the package prefix and
not the full package as before. This is an unfortunate change needed
to avoid name clashes between two bound packages. On the plus side,
the change brings the custom package case closer to the default behaviour,
which is a commen prefix, "go.", and a distinct java package for every
Go package bound.

Change-Id: Iadfaad56e101d1caf7e2a05006f4d384859a20fe
Reviewed-on: https://go-review.googlesource.com/27436
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-08-22 07:41:35 +00:00

38 lines
1.1 KiB
Plaintext

// JNI functions for the Go <=> Java bridge.
// gobind -lang=java issue12328
//
// File is generated by gobind. Do not edit.
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "issue12328.h"
jclass proxy_class_issue12328_T;
jmethodID proxy_class_issue12328_T_cons;
JNIEXPORT void JNICALL
Java_go_issue12328_Issue12328_init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "go/issue12328/T");
proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz);
proxy_class_issue12328_T_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
}
JNIEXPORT void JNICALL
Java_go_issue12328_T_setErr(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyissue12328_T_Err_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_go_issue12328_T_getErr(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum(env, this);
int32_t r0 = proxyissue12328_T_Err_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
return _r0;
}