2
0
mirror of synced 2025-02-23 23:08:14 +00:00
mobile/bind/testdata/interfaces.java.golden
Elias Naur 5b96314b59 mobile/bind: implement interfaces from imported bound packages
Java classes must explicitly declare implemented interfaces. Bind
already declares all such interfaces within each package. Expand
the set of interfaces to include all bound packages.

In addition, let Java interfaces extend all possible interfaces in
the same way as Java classes. To avoid circular references, only
let interfaces extend compatible interfaces with fewer methods.

Before, each package was imported in its own importer, breaking the
assumption of types.AssignableTo that identical packages have
identical *types.Package. Fix that by using one importer for all
bound packages, replacing package path equality checks with direct
equality checks.

While we're here, add missing arguments to a few error messages.

Change-Id: I5eb58972a3abe918862ca99d5a203809699a3433
Reviewed-on: https://go-review.googlesource.com/20987
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-29 08:36:18 +00:00

193 lines
5.4 KiB
Plaintext

// Java class go.interfaces.Interfaces is a proxy for talking to a Go program.
// gobind -lang=java interfaces
//
// File is generated by gobind. Do not edit.
package go.interfaces;
import go.Seq;
public abstract class Interfaces {
static {
Seq.touch(); // for loading the native library
init();
}
private Interfaces() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void init();
public interface Error extends go.Seq.Object {
public void Err() throws Exception;
public static abstract class Stub implements Error {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements Error {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native void Err() throws Exception;
}
}
public interface I extends go.Seq.Object {
public int Rand();
public static abstract class Stub implements I {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements I {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native int Rand();
}
}
public interface I1 extends go.Seq.Object {
public void J();
static final class Proxy implements I1 {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native void J();
}
}
public interface I2 extends go.Seq.Object {
public void G();
static final class Proxy implements I2 {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native void G();
}
}
public interface I3 extends go.Seq.Object {
public I1 F();
public static abstract class Stub implements I3 {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements I3 {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native I1 F();
}
}
public interface LargerI extends go.Seq.Object, I, SameI {
public void AnotherFunc();
public int Rand();
public static abstract class Stub implements LargerI {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements LargerI {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native void AnotherFunc();
public native int Rand();
}
}
public interface SameI extends go.Seq.Object {
public int Rand();
public static abstract class Stub implements SameI {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements SameI {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native int Rand();
}
}
public interface WithParam extends go.Seq.Object {
public void HasParam(boolean p0);
public static abstract class Stub implements WithParam {
private final go.Seq.Ref ref;
public Stub() {
ref = go.Seq.createRef(this);
}
public final go.Seq.Ref ref() { return ref; }
}
static final class Proxy implements WithParam {
private go.Seq.Ref ref;
Proxy(go.Seq.Ref ref) { this.ref = ref; }
public final go.Seq.Ref ref() { return ref; }
public native void HasParam(boolean p0);
}
}
public static native int Add3(I r);
public static native void CallErr(Error e) throws Exception;
public static native I Seven();
}