go.mobile/bind: include the bind invocation command in generated files.

This change also updates bind/testdata/*.golden.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167160043
This commit is contained in:
Hana Kim
2014-11-10 13:46:47 -05:00
parent 9470e0ba58
commit 32f2370535
11 changed files with 31 additions and 31 deletions
+14 -15
View File
@@ -1,13 +1,15 @@
// Java Package testpkg is a proxy for talking to a Go program.
// gobind -lang=java code.google.com/p/go.mobile/bind/java/testpkg
//
// File is generated by gobind. Do not edit.
// Or do, I'm a comment, not a cop.
package go.testpkg;
import go.Seq;
public final class Testpkg {
public long Add(long x, long y) {
public abstract class Testpkg {
private Testpkg() {} // uninstantiable
public static long Add(long x, long y) {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
long _result;
@@ -18,14 +20,14 @@ public final class Testpkg {
return _result;
}
public void Call(I i) {
public static void Call(I i) {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
_in.writeRef(i.ref());
Seq.send(DESCRIPTOR, CALL_Call, _in, _out);
}
public void GC() {
public static void GC() {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
Seq.send(DESCRIPTOR, CALL_GC, _in, _out);
@@ -47,7 +49,6 @@ public final class Testpkg {
public void call(int code, go.Seq in, go.Seq out) {
switch (code) {
case Proxy.CALL_F: {
// TODO(crawshaw): handle catching a Exception
this.F();
return;
}
@@ -73,21 +74,22 @@ public final class Testpkg {
public void F() {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
_in.writeRef(ref);
Seq.send(DESCRIPTOR, CALL_F, _in, _out);
}
static final int CALL_F = 0x0a01;
static final int CALL_F = 0x10a;
}
}
public void Keep(I i) {
public static void Keep(I i) {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
_in.writeRef(i.ref());
Seq.send(DESCRIPTOR, CALL_Keep, _in, _out);
}
public S New() {
public static S New() {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
S _result;
@@ -96,7 +98,7 @@ public final class Testpkg {
return _result;
}
public long NumSCollected() {
public static long NumSCollected() {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
long _result;
@@ -107,7 +109,7 @@ public final class Testpkg {
public static final class S implements go.Seq.Object {
private static final String DESCRIPTOR = "go.testpkg.S";
private static final int CALL_F = 0x0c00;
private static final int CALL_F = 0x00c;
private go.Seq.Ref ref;
@@ -116,7 +118,7 @@ public final class Testpkg {
public go.Seq.Ref ref() { return ref; }
public void call(int code, go.Seq in, go.Seq out) {
throw new RuntimeException("cycle: cannot call concrete proxy");
throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
}
@@ -140,7 +142,6 @@ public final class Testpkg {
}
@Override public String toString() {
// TODO(crawshaw): use String() string if it is defined.
StringBuilder b = new StringBuilder();
b.append("S").append("{");
return b.append("}").toString();
@@ -155,6 +156,4 @@ public final class Testpkg {
private static final int CALL_New = 5;
private static final int CALL_NumSCollected = 6;
private static final String DESCRIPTOR = "testpkg";
public static Testpkg instance = new Testpkg();
}
+3 -11
View File
@@ -1,7 +1,7 @@
// Package go_testpkg is an autogenerated binder stub for package testpkg.
// gobind -lang=go code.google.com/p/go.mobile/bind/java/testpkg
//
// File is generated by gobind. Do not edit.
// Or do, I'm a comment, not a cop.
package go_testpkg
import (
@@ -13,7 +13,6 @@ func proxy_Add(out, in *seq.Buffer) {
param_x := in.ReadInt()
param_y := in.ReadInt()
res := testpkg.Add(param_x, param_y)
// TODO out.WriteNoException();
out.WriteInt(res)
}
@@ -26,24 +25,21 @@ func proxy_Call(out, in *seq.Buffer) {
param_i = (*proxyI)(param_i_ref)
}
testpkg.Call(param_i)
// TODO out.WriteNoException();
}
func proxy_GC(out, in *seq.Buffer) {
testpkg.GC()
// TODO out.WriteNoException();
}
const (
proxyIDescriptor = "go.testpkg.I"
proxyIFCode = 0x0a01
proxyIFCode = 0x10a
)
type proxyI seq.Ref
func (p *proxyI) F() {
out := new(seq.Buffer)
//out.WriteRef((*seq.Ref)(p))
seq.Transact((*seq.Ref)(p), proxyIFCode, out)
}
@@ -56,24 +52,21 @@ func proxy_Keep(out, in *seq.Buffer) {
param_i = (*proxyI)(param_i_ref)
}
testpkg.Keep(param_i)
// TODO out.WriteNoException();
}
func proxy_New(out, in *seq.Buffer) {
res := testpkg.New()
// TODO out.WriteNoException();
out.WriteGoRef(res)
}
func proxy_NumSCollected(out, in *seq.Buffer) {
res := testpkg.NumSCollected()
// TODO out.WriteNoException();
out.WriteInt(res)
}
const (
proxySDescriptor = "go.testpkg.S"
proxySFCode = 0x0c00
proxySFCode = 0x00c
)
type proxyS seq.Ref
@@ -82,7 +75,6 @@ func proxySF(out, in *seq.Buffer) {
ref := in.ReadRef()
v := ref.Get().(*testpkg.S)
v.F()
// TODO out.WriteNoException();
}
func init() {