mobile/bind: handle null references from Java in Go

The Seq Java class has a special case for null references. Expand
the special case to Go so that null references from Java are properly
translated to nil.

Fixes golang/go#14228

Change-Id: I915d1f843c9db299d6910480f6d10dae0121a3b4
Reviewed-on: https://go-review.googlesource.com/19460
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Elias Naur
2016-02-12 14:54:21 +00:00
committed by David Crawshaw
parent 46f9e01d1e
commit d1c2f486a3
12 changed files with 35 additions and 14 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ public abstract class Structs {
_out = new go.Seq();
S _result;
_in = new go.Seq();
_in.writeRef(s.ref());
_in.writeRef(s != null ? s.ref() : null);
Seq.send(DESCRIPTOR, CALL_Identity, _in, _out);
_result = new S(_out.readRef());
return _result;
@@ -77,7 +77,7 @@ public abstract class Structs {
_out = new go.Seq();
S _result;
_in = new go.Seq();
_in.writeRef(s.ref());
_in.writeRef(s != null ? s.ref() : null);
Seq.send(DESCRIPTOR, CALL_IdentityWithError, _in, _out);
_result = new S(_out.readRef());
String _err = _out.readString();