mobile/bind: make Java proxy classes private
Proxies are an implementation detail, so make them private to hide them from the public API. Also, move the proxy classes out of its interface scope; classes declared inside Java interfaces are always public and cannot be declared otherwise. Use the lowercase "proxy" class prefix to avoid name clashes with exported Go interfaces and structs. Change-Id: Iae6a53ed4885b7899f2fa770b73c135f54ffb263 Reviewed-on: https://go-review.googlesource.com/21370 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
5e11c20fc0
commit
e1840f9c11
@ -165,6 +165,9 @@ func (g *javaGen) genInterface(iface interfaceInfo) {
|
||||
g.genFuncSignature(m, false, true)
|
||||
}
|
||||
|
||||
g.Outdent()
|
||||
g.Printf("}\n")
|
||||
|
||||
g.Printf("\n")
|
||||
g.Printf(javaProxyPreamble, iface.obj.Name())
|
||||
g.Indent()
|
||||
@ -177,9 +180,6 @@ func (g *javaGen) genInterface(iface interfaceInfo) {
|
||||
g.genFuncSignature(m, false, false)
|
||||
}
|
||||
|
||||
g.Outdent()
|
||||
g.Printf("}\n")
|
||||
|
||||
g.Outdent()
|
||||
g.Printf("}\n\n")
|
||||
}
|
||||
@ -346,10 +346,11 @@ func (g *javaGen) genJNIFuncSignature(o *types.Func, sName string, proxy bool) {
|
||||
g.Printf("Java_%s_%s", g.jniPkgName(), g.className())
|
||||
if sName != "" {
|
||||
// 0024 is the mangled form of $, for naming inner classes.
|
||||
g.Printf("_00024%s", sName)
|
||||
g.Printf("_00024")
|
||||
if proxy {
|
||||
g.Printf("_00024Proxy")
|
||||
g.Printf("proxy")
|
||||
}
|
||||
g.Printf("%s", sName)
|
||||
}
|
||||
g.Printf("_%s(JNIEnv* env, ", o.Name())
|
||||
if sName != "" {
|
||||
@ -891,8 +892,8 @@ func (g *javaGen) jniCallType(t types.Type) string {
|
||||
return "TODO"
|
||||
}
|
||||
|
||||
func (g *javaGen) jniClassSigType(obj *types.TypeName) string {
|
||||
return strings.Replace(g.javaPkgName(obj.Pkg()), ".", "/", -1) + "/" + className(obj.Pkg()) + "$" + obj.Name()
|
||||
func (g *javaGen) jniClassSigPrefix(pkg *types.Package) string {
|
||||
return strings.Replace(g.javaPkgName(pkg), ".", "/", -1) + "/" + className(pkg) + "$"
|
||||
}
|
||||
|
||||
func (g *javaGen) jniSigType(T types.Type) string {
|
||||
@ -934,7 +935,7 @@ func (g *javaGen) jniSigType(T types.Type) string {
|
||||
}
|
||||
g.errorf("unsupported pointer to type: %s", T)
|
||||
case *types.Named:
|
||||
return "L" + g.jniClassSigType(T.Obj()) + ";"
|
||||
return "L" + g.jniClassSigPrefix(T.Obj().Pkg()) + T.Obj().Name() + ";"
|
||||
default:
|
||||
g.errorf("unsupported jniType: %#+v, %s\n", T, T)
|
||||
}
|
||||
@ -972,15 +973,15 @@ func (g *javaGen) genC() error {
|
||||
g.Indent()
|
||||
g.Printf("jclass clazz;\n")
|
||||
for _, s := range g.structs {
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigType(s.obj))
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigPrefix(s.obj.Pkg())+s.obj.Name())
|
||||
g.Printf("proxy_class_%s_%s = (*env)->NewGlobalRef(env, clazz);\n", g.pkgPrefix, s.obj.Name())
|
||||
g.Printf("proxy_class_%s_%s_cons = (*env)->GetMethodID(env, clazz, \"<init>\", \"(Lgo/Seq$Ref;)V\");\n", g.pkgPrefix, s.obj.Name())
|
||||
}
|
||||
for _, iface := range g.interfaces {
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigType(iface.obj)+"$Proxy")
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigPrefix(iface.obj.Pkg())+"proxy"+iface.obj.Name())
|
||||
g.Printf("proxy_class_%s_%s = (*env)->NewGlobalRef(env, clazz);\n", g.pkgPrefix, iface.obj.Name())
|
||||
g.Printf("proxy_class_%s_%s_cons = (*env)->GetMethodID(env, clazz, \"<init>\", \"(Lgo/Seq$Ref;)V\");\n", g.pkgPrefix, iface.obj.Name())
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigType(iface.obj))
|
||||
g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigPrefix(iface.obj.Pkg())+iface.obj.Name())
|
||||
for _, m := range iface.summary.callable {
|
||||
if !g.isSigSupported(m.Type()) {
|
||||
g.Printf("// skipped method %s.%s with unsupported parameter or return types\n\n", iface.obj.Name(), m.Name())
|
||||
@ -1085,8 +1086,8 @@ func (g *javaGen) genJava() error {
|
||||
}
|
||||
|
||||
const (
|
||||
javaProxyPreamble = `static final class Proxy extends Seq.Proxy implements %s {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
javaProxyPreamble = `private static final class proxy%[1]s extends Seq.Proxy implements %[1]s {
|
||||
proxy%[1]s(Seq.Ref ref) { super(ref); }
|
||||
|
||||
`
|
||||
javaPreamble = `// Java class %[1]s.%[2]s is a proxy for talking to a Go program.
|
||||
|
2
bind/testdata/ignore.java.c.golden
vendored
2
bind/testdata/ignore.java.c.golden
vendored
@ -24,7 +24,7 @@ Java_go_ignore_Ignore_init(JNIEnv *env, jclass _unused) {
|
||||
clazz = (*env)->FindClass(env, "go/ignore/Ignore$S");
|
||||
proxy_class_ignore_S = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_ignore_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/ignore/Ignore$I$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/ignore/Ignore$proxyI");
|
||||
proxy_class_ignore_I = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_ignore_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/ignore/Ignore$I");
|
||||
|
14
bind/testdata/ignore.java.golden
vendored
14
bind/testdata/ignore.java.golden
vendored
@ -54,15 +54,15 @@ public abstract class Ignore {
|
||||
|
||||
// skipped method I.Result with unsupported parameter or return types
|
||||
|
||||
}
|
||||
|
||||
private static final class proxyI extends Seq.Proxy implements I {
|
||||
proxyI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
// skipped method I.Argument with unsupported parameter or return types
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
// skipped method I.Result with unsupported parameter or return types
|
||||
|
||||
// skipped method I.Argument with unsupported parameter or return types
|
||||
|
||||
// skipped method I.Result with unsupported parameter or return types
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// skipped const NamedConst with unsupported type: *types.Const
|
||||
|
34
bind/testdata/interfaces.java.c.golden
vendored
34
bind/testdata/interfaces.java.c.golden
vendored
@ -38,50 +38,50 @@ static jmethodID mid_WithParam_HasParam;
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_init(JNIEnv *env, jclass _unused) {
|
||||
jclass clazz;
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$Error$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyError");
|
||||
proxy_class_interfaces_Error = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_Error_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$Error");
|
||||
mid_Error_Err = (*env)->GetMethodID(env, clazz, "Err", "()V");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI");
|
||||
proxy_class_interfaces_I = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I");
|
||||
mid_I_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I1$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI1");
|
||||
proxy_class_interfaces_I1 = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_I1_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I1");
|
||||
mid_I1_J = (*env)->GetMethodID(env, clazz, "J", "()V");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I2$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI2");
|
||||
proxy_class_interfaces_I2 = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_I2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I2");
|
||||
mid_I2_G = (*env)->GetMethodID(env, clazz, "G", "()V");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I3$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI3");
|
||||
proxy_class_interfaces_I3 = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_I3_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$I3");
|
||||
mid_I3_F = (*env)->GetMethodID(env, clazz, "F", "()Lgo/interfaces/Interfaces$I1;");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$LargerI$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyLargerI");
|
||||
proxy_class_interfaces_LargerI = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_LargerI_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$LargerI");
|
||||
mid_LargerI_AnotherFunc = (*env)->GetMethodID(env, clazz, "AnotherFunc", "()V");
|
||||
mid_LargerI_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$SameI$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxySameI");
|
||||
proxy_class_interfaces_SameI = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_SameI_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$SameI");
|
||||
mid_SameI_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I");
|
||||
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$WithParam$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyWithParam");
|
||||
proxy_class_interfaces_WithParam = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_interfaces_WithParam_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$WithParam");
|
||||
@ -113,7 +113,7 @@ Java_go_interfaces_Interfaces_Seven(JNIEnv* env, jclass clazz) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_00024Error_00024Proxy_Err(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyError_Err(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
nstring r0 = proxyinterfaces_Error_Err(o);
|
||||
jstring _r0 = go_seq_to_java_string(env, r0);
|
||||
@ -131,7 +131,7 @@ nstring cproxyinterfaces_Error_Err(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_go_interfaces_Interfaces_00024I_00024Proxy_Rand(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyI_Rand(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
int32_t r0 = proxyinterfaces_I_Rand(o);
|
||||
jint _r0 = (jint)r0;
|
||||
@ -148,7 +148,7 @@ int32_t cproxyinterfaces_I_Rand(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_00024I1_00024Proxy_J(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyI1_J(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
proxyinterfaces_I1_J(o);
|
||||
}
|
||||
@ -161,7 +161,7 @@ void cproxyinterfaces_I1_J(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_00024I2_00024Proxy_G(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyI2_G(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
proxyinterfaces_I2_G(o);
|
||||
}
|
||||
@ -174,7 +174,7 @@ void cproxyinterfaces_I2_G(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_go_interfaces_Interfaces_00024I3_00024Proxy_F(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyI3_F(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
int32_t r0 = proxyinterfaces_I3_F(o);
|
||||
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_interfaces_I1, proxy_class_interfaces_I1_cons);
|
||||
@ -191,7 +191,7 @@ int32_t cproxyinterfaces_I3_F(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_00024LargerI_00024Proxy_AnotherFunc(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyLargerI_AnotherFunc(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
proxyinterfaces_LargerI_AnotherFunc(o);
|
||||
}
|
||||
@ -204,7 +204,7 @@ void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_go_interfaces_Interfaces_00024LargerI_00024Proxy_Rand(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxyLargerI_Rand(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
int32_t r0 = proxyinterfaces_LargerI_Rand(o);
|
||||
jint _r0 = (jint)r0;
|
||||
@ -221,7 +221,7 @@ int32_t cproxyinterfaces_LargerI_Rand(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_go_interfaces_Interfaces_00024SameI_00024Proxy_Rand(JNIEnv* env, jobject this) {
|
||||
Java_go_interfaces_Interfaces_00024proxySameI_Rand(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
int32_t r0 = proxyinterfaces_SameI_Rand(o);
|
||||
jint _r0 = (jint)r0;
|
||||
@ -238,7 +238,7 @@ int32_t cproxyinterfaces_SameI_Rand(int32_t refnum) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_interfaces_Interfaces_00024WithParam_00024Proxy_HasParam(JNIEnv* env, jobject this, jboolean p0) {
|
||||
Java_go_interfaces_Interfaces_00024proxyWithParam_HasParam(JNIEnv* env, jobject this, jboolean p0) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
char _p0 = (char)p0;
|
||||
proxyinterfaces_WithParam_HasParam(o, _p0);
|
||||
|
98
bind/testdata/interfaces.java.golden
vendored
98
bind/testdata/interfaces.java.golden
vendored
@ -21,84 +21,84 @@ public abstract class Interfaces {
|
||||
|
||||
public interface Error {
|
||||
public void Err() throws Exception;
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements Error {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void Err() throws Exception;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyError extends Seq.Proxy implements Error {
|
||||
proxyError(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void Err() throws Exception;
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public int Rand();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native int Rand();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI extends Seq.Proxy implements I {
|
||||
proxyI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native int Rand();
|
||||
}
|
||||
|
||||
public interface I1 {
|
||||
public void J();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I1 {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void J();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI1 extends Seq.Proxy implements I1 {
|
||||
proxyI1(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void J();
|
||||
}
|
||||
|
||||
public interface I2 {
|
||||
public void G();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I2 {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void G();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI2 extends Seq.Proxy implements I2 {
|
||||
proxyI2(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void G();
|
||||
}
|
||||
|
||||
public interface I3 {
|
||||
public I1 F();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I3 {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native I1 F();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI3 extends Seq.Proxy implements I3 {
|
||||
proxyI3(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native I1 F();
|
||||
}
|
||||
|
||||
public interface LargerI extends I, SameI {
|
||||
public void AnotherFunc();
|
||||
public int Rand();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements LargerI {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void AnotherFunc();
|
||||
public native int Rand();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyLargerI extends Seq.Proxy implements LargerI {
|
||||
proxyLargerI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void AnotherFunc();
|
||||
public native int Rand();
|
||||
}
|
||||
|
||||
public interface SameI {
|
||||
public int Rand();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements SameI {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native int Rand();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxySameI extends Seq.Proxy implements SameI {
|
||||
proxySameI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native int Rand();
|
||||
}
|
||||
|
||||
public interface WithParam {
|
||||
public void HasParam(boolean p0);
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements WithParam {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void HasParam(boolean p0);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyWithParam extends Seq.Proxy implements WithParam {
|
||||
proxyWithParam(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void HasParam(boolean p0);
|
||||
}
|
||||
|
||||
|
||||
|
6
bind/testdata/issue10788.java.c.golden
vendored
6
bind/testdata/issue10788.java.c.golden
vendored
@ -22,7 +22,7 @@ Java_go_issue10788_Issue10788_init(JNIEnv *env, jclass _unused) {
|
||||
clazz = (*env)->FindClass(env, "go/issue10788/Issue10788$TestStruct");
|
||||
proxy_class_issue10788_TestStruct = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_issue10788_TestStruct_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/issue10788/Issue10788$TestInterface$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/issue10788/Issue10788$proxyTestInterface");
|
||||
proxy_class_issue10788_TestInterface = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_issue10788_TestInterface_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/issue10788/Issue10788$TestInterface");
|
||||
@ -47,7 +47,7 @@ Java_go_issue10788_Issue10788_00024TestStruct_getValue(JNIEnv *env, jobject this
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_issue10788_Issue10788_00024TestInterface_00024Proxy_DoSomeWork(JNIEnv* env, jobject this, jobject s) {
|
||||
Java_go_issue10788_Issue10788_00024proxyTestInterface_DoSomeWork(JNIEnv* env, jobject this, jobject s) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
int32_t _s = go_seq_to_refnum(env, s);
|
||||
proxyissue10788_TestInterface_DoSomeWork(o, _s);
|
||||
@ -62,7 +62,7 @@ void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_issue10788_Issue10788_00024TestInterface_00024Proxy_MultipleUnnamedParams(JNIEnv* env, jobject this, jlong p0, jstring p1, jlong p2) {
|
||||
Java_go_issue10788_Issue10788_00024proxyTestInterface_MultipleUnnamedParams(JNIEnv* env, jobject this, jlong p0, jstring p1, jlong p2) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
nint _p0 = (nint)p0;
|
||||
nstring _p1 = go_seq_from_java_string(env, p1);
|
||||
|
14
bind/testdata/issue10788.java.golden
vendored
14
bind/testdata/issue10788.java.golden
vendored
@ -57,13 +57,13 @@ public abstract class Issue10788 {
|
||||
public interface TestInterface {
|
||||
public void DoSomeWork(TestStruct s);
|
||||
public void MultipleUnnamedParams(long p0, String p1, long p2);
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements TestInterface {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void DoSomeWork(TestStruct s);
|
||||
public native void MultipleUnnamedParams(long p0, String p1, long p2);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyTestInterface extends Seq.Proxy implements TestInterface {
|
||||
proxyTestInterface(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void DoSomeWork(TestStruct s);
|
||||
public native void MultipleUnnamedParams(long p0, String p1, long p2);
|
||||
}
|
||||
|
||||
|
||||
|
6
bind/testdata/issue12403.java.c.golden
vendored
6
bind/testdata/issue12403.java.c.golden
vendored
@ -17,7 +17,7 @@ static jmethodID mid_Parsable_ToJSON;
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_issue12403_Issue12403_init(JNIEnv *env, jclass _unused) {
|
||||
jclass clazz;
|
||||
clazz = (*env)->FindClass(env, "go/issue12403/Issue12403$Parsable$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/issue12403/Issue12403$proxyParsable");
|
||||
proxy_class_issue12403_Parsable = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_issue12403_Parsable_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/issue12403/Issue12403$Parsable");
|
||||
@ -27,7 +27,7 @@ Java_go_issue12403_Issue12403_init(JNIEnv *env, jclass _unused) {
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_go_issue12403_Issue12403_00024Parsable_00024Proxy_FromJSON(JNIEnv* env, jobject this, jstring jstr) {
|
||||
Java_go_issue12403_Issue12403_00024proxyParsable_FromJSON(JNIEnv* env, jobject this, jstring jstr) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
nstring _jstr = go_seq_from_java_string(env, jstr);
|
||||
nstring r0 = proxyissue12403_Parsable_FromJSON(o, _jstr);
|
||||
@ -46,7 +46,7 @@ nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr) {
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_go_issue12403_Issue12403_00024Parsable_00024Proxy_ToJSON(JNIEnv* env, jobject this) {
|
||||
Java_go_issue12403_Issue12403_00024proxyParsable_ToJSON(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
struct proxyissue12403_Parsable_ToJSON_return res = proxyissue12403_Parsable_ToJSON(o);
|
||||
jstring _r0 = go_seq_to_java_string(env, res.r0);
|
||||
|
14
bind/testdata/issue12403.java.golden
vendored
14
bind/testdata/issue12403.java.golden
vendored
@ -22,13 +22,13 @@ public abstract class Issue12403 {
|
||||
public interface Parsable {
|
||||
public String FromJSON(String jstr);
|
||||
public String ToJSON() throws Exception;
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements Parsable {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native String FromJSON(String jstr);
|
||||
public native String ToJSON() throws Exception;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyParsable extends Seq.Proxy implements Parsable {
|
||||
proxyParsable(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native String FromJSON(String jstr);
|
||||
public native String ToJSON() throws Exception;
|
||||
}
|
||||
|
||||
|
||||
|
4
bind/testdata/structs.java.c.golden
vendored
4
bind/testdata/structs.java.c.golden
vendored
@ -26,7 +26,7 @@ Java_go_structs_Structs_init(JNIEnv *env, jclass _unused) {
|
||||
clazz = (*env)->FindClass(env, "go/structs/Structs$S2");
|
||||
proxy_class_structs_S2 = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_structs_S2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/structs/Structs$I$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/structs/Structs$proxyI");
|
||||
proxy_class_structs_I = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_structs_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/structs/Structs$I");
|
||||
@ -115,7 +115,7 @@ Java_go_structs_Structs_00024S2_String(JNIEnv* env, jobject this) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_go_structs_Structs_00024I_00024Proxy_M(JNIEnv* env, jobject this) {
|
||||
Java_go_structs_Structs_00024proxyI_M(JNIEnv* env, jobject this) {
|
||||
int32_t o = go_seq_to_refnum(env, this);
|
||||
proxystructs_I_M(o);
|
||||
}
|
||||
|
12
bind/testdata/structs.java.golden
vendored
12
bind/testdata/structs.java.golden
vendored
@ -85,12 +85,12 @@ public abstract class Structs {
|
||||
|
||||
public interface I {
|
||||
public void M();
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void M();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI extends Seq.Proxy implements I {
|
||||
proxyI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
public native void M();
|
||||
}
|
||||
|
||||
|
||||
|
2
bind/testdata/vars.java.c.golden
vendored
2
bind/testdata/vars.java.c.golden
vendored
@ -20,7 +20,7 @@ Java_go_vars_Vars_init(JNIEnv *env, jclass _unused) {
|
||||
clazz = (*env)->FindClass(env, "go/vars/Vars$S");
|
||||
proxy_class_vars_S = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_vars_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/vars/Vars$I$Proxy");
|
||||
clazz = (*env)->FindClass(env, "go/vars/Vars$proxyI");
|
||||
proxy_class_vars_I = (*env)->NewGlobalRef(env, clazz);
|
||||
proxy_class_vars_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||||
clazz = (*env)->FindClass(env, "go/vars/Vars$I");
|
||||
|
10
bind/testdata/vars.java.golden
vendored
10
bind/testdata/vars.java.golden
vendored
@ -42,11 +42,11 @@ public abstract class Vars {
|
||||
}
|
||||
|
||||
public interface I {
|
||||
|
||||
static final class Proxy extends Seq.Proxy implements I {
|
||||
Proxy(Seq.Ref ref) { super(ref); }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static final class proxyI extends Seq.Proxy implements I {
|
||||
proxyI(Seq.Ref ref) { super(ref); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user