mobile/bind: don't force Java classes to extend stub classes

Requiring user code to extend Go interface Stubs to be able to pass
Java objects to Go is clumsy and use up the single extend slot.
Instead, support (and enforce) java classes to implement translated
Go interface directly. This is similar to how ObjC works.

The stub classes are now gone, and users of gobind Java APIs need
to update their code to implement interfaces directly.

Change-Id: I880bb7c8e89d3c21210b2ab2c85ced8d7859ff48
Reviewed-on: https://go-review.googlesource.com/21313
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Elias Naur
2016-03-31 07:59:45 +00:00
parent 07a529f836
commit 5e11c20fc0
13 changed files with 151 additions and 337 deletions
+2 -2
View File
@@ -17,12 +17,12 @@ import go.benchmark.Benchmark;
public class SeqBench extends InstrumentationTestCase {
public static class AnI extends Benchmark.I.Stub {
public static class AnI implements Benchmark.I {
@Override public void F() {
}
}
private static class Benchmarks extends Benchmark.Benchmarks.Stub {
private static class Benchmarks implements Benchmark.Benchmarks {
private static Map<String, Runnable> benchmarks;
private static ExecutorService executor = Executors.newSingleThreadExecutor();