diff --git a/bind/bind_test.go b/bind/bind_test.go index cf6d009..9fe39a0 100644 --- a/bind/bind_test.go +++ b/bind/bind_test.go @@ -266,9 +266,7 @@ func TestGenJava(t *testing.T) { } for _, filename := range allTests { refs := fileRefs(t, filename, "Java/") - imp := &java.Importer{ - JavaPkgPrefix: "go.", - } + imp := &java.Importer{} classes, err := imp.Import(refs) if err != nil { t.Fatal(err) @@ -290,7 +288,7 @@ func TestGenJava(t *testing.T) { } var genNames []string for _, emb := range refs.Embedders { - genNames = append(genNames, imp.JavaPkgPrefix+emb.Pkg+"."+emb.Name) + genNames = append(genNames, emb.Pkg+"."+emb.Name) } cg.Init(classes, genNames) genJavaPackages(t, tmpGopath, cg) @@ -380,9 +378,7 @@ func TestGenGoJavaWrappers(t *testing.T) { for _, filename := range javaTests { var buf bytes.Buffer refs := fileRefs(t, filename, "Java/") - imp := &java.Importer{ - JavaPkgPrefix: "go.", - } + imp := &java.Importer{} classes, err := imp.Import(refs) if err != nil { t.Fatal(err) @@ -400,7 +396,7 @@ func TestGenGoJavaWrappers(t *testing.T) { } var genNames []string for _, emb := range refs.Embedders { - genNames = append(genNames, imp.JavaPkgPrefix+emb.Pkg+"."+emb.Name) + genNames = append(genNames, emb.Pkg+"."+emb.Name) } cg.Init(classes, genNames) genJavaPackages(t, tmpGopath, cg) diff --git a/bind/genjava.go b/bind/genjava.go index bcd0a4c..3164b77 100644 --- a/bind/genjava.go +++ b/bind/genjava.go @@ -20,7 +20,7 @@ import ( type JavaGen struct { // JavaPkg is the Java package prefix for the generated classes. The prefix is prepended to the Go - // package name to create the full Java package name. If JavaPkg is empty, 'go' is used as prefix. + // package name to create the full Java package name. JavaPkg string *Generator @@ -844,11 +844,10 @@ func JavaPkgName(pkgPrefix string, pkg *types.Package) string { return "go" } s := javaNameReplacer(pkg.Name()) - if pkgPrefix != "" { - return pkgPrefix + "." + s - } else { - return "go." + s + if pkgPrefix == "" { + return s } + return pkgPrefix + "." + s } func (g *JavaGen) className() string { diff --git a/bind/java/ClassesTest.java b/bind/java/ClassesTest.java index ca38391..c8264df 100644 --- a/bind/java/ClassesTest.java +++ b/bind/java/ClassesTest.java @@ -12,12 +12,12 @@ import java.io.IOException; import java.util.Arrays; import java.util.Random; -import go.javapkg.Javapkg; -import go.javapkg.I; -import go.javapkg.GoObject; -import go.javapkg.GoRunnable; -import go.javapkg.GoSubset; -import go.javapkg.GoInputStream; +import javapkg.Javapkg; +import javapkg.I; +import javapkg.GoObject; +import javapkg.GoRunnable; +import javapkg.GoSubset; +import javapkg.GoInputStream; public class ClassesTest extends InstrumentationTestCase { public void testConst() { diff --git a/bind/java/SeqBench.java b/bind/java/SeqBench.java index 1377701..26adb9d 100644 --- a/bind/java/SeqBench.java +++ b/bind/java/SeqBench.java @@ -13,7 +13,7 @@ import java.util.HashMap; import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; -import go.benchmark.*; +import benchmark.*; public class SeqBench extends InstrumentationTestCase { @@ -22,7 +22,7 @@ public class SeqBench extends InstrumentationTestCase { } } - private static class Benchmarks implements go.benchmark.Benchmarks { + private static class Benchmarks implements benchmark.Benchmarks { private static Map benchmarks; private static ExecutorService executor = Executors.newSingleThreadExecutor(); diff --git a/bind/java/SeqTest.java b/bind/java/SeqTest.java index 156e591..6bce54d 100644 --- a/bind/java/SeqTest.java +++ b/bind/java/SeqTest.java @@ -10,8 +10,8 @@ import android.test.MoreAsserts; import java.util.Arrays; import java.util.Random; -import go.testpkg.*; -import go.secondpkg.Secondpkg; +import testpkg.*; +import secondpkg.Secondpkg; public class SeqTest extends InstrumentationTestCase { public SeqTest() { @@ -483,14 +483,14 @@ public class SeqTest extends InstrumentationTestCase { } public void testImportedPkg() { - Testpkg.callImportedI(new go.secondpkg.I() { + Testpkg.callImportedI(new secondpkg.I() { @Override public long f(long i) { return i; } }); assertEquals("imported string should match", Secondpkg.HelloString, Secondpkg.hello()); - go.secondpkg.I i = Testpkg.newImportedI(); - go.secondpkg.S s = Testpkg.newImportedS(); + secondpkg.I i = Testpkg.newImportedI(); + secondpkg.S s = Testpkg.newImportedS(); i = Testpkg.getImportedVarI(); s = Testpkg.getImportedVarS(); assertEquals("numbers should match", 8, i.f(8)); @@ -505,9 +505,9 @@ public class SeqTest extends InstrumentationTestCase { Testpkg.withImportedI(i); Testpkg.withImportedS(s); - go.secondpkg.IF f = new AnI(); + secondpkg.IF f = new AnI(); f = Testpkg.new_(); - go.secondpkg.Ser ser = Testpkg.newSer(); + secondpkg.Ser ser = Testpkg.newSer(); } public void testRoundtripEquality() { diff --git a/bind/testdata/basictypes.java.c.golden b/bind/testdata/basictypes.java.c.golden index 11738f5..bdebd0c 100644 --- a/bind/testdata/basictypes.java.c.golden +++ b/bind/testdata/basictypes.java.c.golden @@ -11,12 +11,12 @@ JNIEXPORT void JNICALL -Java_go_basictypes_Basictypes__1init(JNIEnv *env, jclass _unused) { +Java_basictypes_Basictypes__1init(JNIEnv *env, jclass _unused) { jclass clazz; } JNIEXPORT jboolean JNICALL -Java_go_basictypes_Basictypes_bool(JNIEnv* env, jclass _clazz, jboolean p0) { +Java_basictypes_Basictypes_bool(JNIEnv* env, jclass _clazz, jboolean p0) { char _p0 = (char)p0; char r0 = proxybasictypes__Bool(_p0); jboolean _r0 = r0 ? JNI_TRUE : JNI_FALSE; @@ -24,7 +24,7 @@ Java_go_basictypes_Basictypes_bool(JNIEnv* env, jclass _clazz, jboolean p0) { } JNIEXPORT jbyteArray JNICALL -Java_go_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass _clazz, jbyteArray x) { +Java_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass _clazz, jbyteArray x) { nbyteslice _x = go_seq_from_java_bytearray(env, x, 0); nbyteslice r0 = proxybasictypes__ByteArrays(_x); go_seq_release_byte_array(env, x, _x.ptr); @@ -33,14 +33,14 @@ Java_go_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass _clazz, jbyteArray } JNIEXPORT void JNICALL -Java_go_basictypes_Basictypes_error(JNIEnv* env, jclass _clazz) { +Java_basictypes_Basictypes_error(JNIEnv* env, jclass _clazz) { int32_t r0 = proxybasictypes__Error(); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons); go_seq_maybe_throw_exception(env, _r0); } JNIEXPORT jlong JNICALL -Java_go_basictypes_Basictypes_errorPair(JNIEnv* env, jclass _clazz) { +Java_basictypes_Basictypes_errorPair(JNIEnv* env, jclass _clazz) { struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair(); jlong _r0 = (jlong)res.r0; jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons); @@ -49,7 +49,7 @@ Java_go_basictypes_Basictypes_errorPair(JNIEnv* env, jclass _clazz) { } JNIEXPORT void JNICALL -Java_go_basictypes_Basictypes_ints(JNIEnv* env, jclass _clazz, jbyte x, jshort y, jint z, jlong t, jlong u) { +Java_basictypes_Basictypes_ints(JNIEnv* env, jclass _clazz, jbyte x, jshort y, jint z, jlong t, jlong u) { int8_t _x = (int8_t)x; int16_t _y = (int16_t)y; int32_t _z = (int32_t)z; diff --git a/bind/testdata/basictypes.java.golden b/bind/testdata/basictypes.java.golden index d6168fd..3f831de 100644 --- a/bind/testdata/basictypes.java.golden +++ b/bind/testdata/basictypes.java.golden @@ -1,8 +1,8 @@ -// Java class go.basictypes.Basictypes is a proxy for talking to a Go program. +// Java class basictypes.Basictypes is a proxy for talking to a Go program. // gobind -lang=java basictypes // // File is generated by gobind. Do not edit. -package go.basictypes; +package basictypes; import go.Seq; diff --git a/bind/testdata/classes.go b/bind/testdata/classes.go index d110eb9..0dead86 100644 --- a/bind/testdata/classes.go +++ b/bind/testdata/classes.go @@ -5,7 +5,7 @@ package java import ( - gopkg "Java/go/java" + gopkg "Java/java" "Java/java/io" "Java/java/lang" "Java/java/lang/System" diff --git a/bind/testdata/classes.go.golden b/bind/testdata/classes.go.golden index ff637a8..7cff13e 100644 --- a/bind/testdata/classes.go.golden +++ b/bind/testdata/classes.go.golden @@ -30,24 +30,24 @@ type Java_util_Spliterators interface { type Java_lang_System interface { } -type Go_java_Future interface { +type Java_Future interface { Get() (Java_lang_Object, error) Get2(a0 int64, a1 Java_util_concurrent_TimeUnit) (Java_lang_Object, error) - Super() Go_java_Future + Super() Java_Future } -type Go_java_InputStream interface { +type Java_InputStream interface { Read() (int32, error) - Super() Go_java_InputStream + Super() Java_InputStream } -type Go_java_Object interface { - Super() Go_java_Object +type Java_Object interface { + Super() Java_Object } -type Go_java_Runnable interface { +type Java_Runnable interface { Run() - Super() Go_java_Runnable + Super() Java_Runnable } type Java_util_PrimitiveIterator_OfInt interface { @@ -84,10 +84,10 @@ import "Java/java/lang/Object" import "Java/java/util/concurrent/TimeUnit" import "Java/java/util/Spliterators" import "Java/java/lang/System" -import "Java/go/java/Future" -import "Java/go/java/InputStream" -import "Java/go/java/Object" -import "Java/go/java/Runnable" +import "Java/java/Future" +import "Java/java/InputStream" +import "Java/java/Object" +import "Java/java/Runnable" import "Java/java/util/PrimitiveIterator/OfInt" import "Java/java/util/Spliterator/OfInt" import "Java/java/io/Console" @@ -114,10 +114,10 @@ func initClasses() { init_java_util_concurrent_TimeUnit() init_java_util_Spliterators() init_java_lang_System() - init_go_java_Future() - init_go_java_InputStream() - init_go_java_Object() - init_go_java_Runnable() + init_java_Future() + init_java_InputStream() + init_java_Object() + init_java_Runnable() init_java_util_PrimitiveIterator_OfInt() init_java_util_Spliterator_OfInt() init_java_io_Console() @@ -446,33 +446,33 @@ type proxy_class_java_lang_System _seq.Ref func (p *proxy_class_java_lang_System) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } -var class_go_java_Future C.jclass +var class_java_Future C.jclass -func init_go_java_Future() { - cls := C.CString("go/java/Future") +func init_java_Future() { + cls := C.CString("java/Future") clazz := C.go_seq_find_class(cls) C.free(unsafe.Pointer(cls)) if clazz == nil { return } - class_go_java_Future = clazz - Future.Cast = func(v interface{}) Java.Go_java_Future { - t := reflect.TypeOf((*proxy_class_go_java_Future)(nil)) - cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_go_java_Future) + class_java_Future = clazz + Future.Cast = func(v interface{}) Java.Java_Future { + t := reflect.TypeOf((*proxy_class_java_Future)(nil)) + cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Future) ref := C.jint(_seq.ToRefNum(cv)) - if C.go_seq_isinstanceof(ref, class_go_java_Future) != 1 { - panic(fmt.Errorf("%T is not an instance of %s", v, "go.java.Future")) + if C.go_seq_isinstanceof(ref, class_java_Future) != 1 { + panic(fmt.Errorf("%T is not an instance of %s", v, "java.Future")) } return cv } } -type proxy_class_go_java_Future _seq.Ref +type proxy_class_java_Future _seq.Ref -func (p *proxy_class_go_java_Future) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } +func (p *proxy_class_java_Future) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } -func (p *proxy_class_go_java_Future) Get() (Java.Java_lang_Object, error) { - res := C.cproxy_go_java_Future_get__(C.jint(p.Bind_proxy_refnum__())) +func (p *proxy_class_java_Future) Get() (Java.Java_lang_Object, error) { + res := C.cproxy_java_Future_get__(C.jint(p.Bind_proxy_refnum__())) var _res Java.Java_lang_Object _res_ref := _seq.FromRefNum(int32(res.res)) if _res_ref != nil { @@ -494,13 +494,13 @@ func (p *proxy_class_go_java_Future) Get() (Java.Java_lang_Object, error) { return _res, _exc } -func (p *proxy_class_go_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent_TimeUnit) (Java.Java_lang_Object, error) { +func (p *proxy_class_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent_TimeUnit) (Java.Java_lang_Object, error) { _a0 := C.jlong(a0) var _a1 C.jint = _seq.NullRefNum if a1 != nil { _a1 = C.jint(_seq.ToRefNum(a1)) } - res := C.cproxy_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), _a0, _a1) + res := C.cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), _a0, _a1) var _res Java.Java_lang_Object _res_ref := _seq.FromRefNum(int32(res.res)) if _res_ref != nil { @@ -522,14 +522,14 @@ func (p *proxy_class_go_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent return _res, _exc } -func (p *proxy_class_go_java_Future) Super() Java.Go_java_Future { - return &super_go_java_Future{p} +func (p *proxy_class_java_Future) Super() Java.Java_Future { + return &super_java_Future{p} } -type super_go_java_Future struct {*proxy_class_go_java_Future} +type super_java_Future struct {*proxy_class_java_Future} -func (p *super_go_java_Future) Get() (Java.Java_lang_Object, error) { - res := C.csuper_go_java_Future_get__(C.jint(p.Bind_proxy_refnum__())) +func (p *super_java_Future) Get() (Java.Java_lang_Object, error) { + res := C.csuper_java_Future_get__(C.jint(p.Bind_proxy_refnum__())) var _res Java.Java_lang_Object _res_ref := _seq.FromRefNum(int32(res.res)) if _res_ref != nil { @@ -551,13 +551,13 @@ func (p *super_go_java_Future) Get() (Java.Java_lang_Object, error) { return _res, _exc } -func (p *super_go_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent_TimeUnit) (Java.Java_lang_Object, error) { +func (p *super_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent_TimeUnit) (Java.Java_lang_Object, error) { _a0 := C.jlong(a0) var _a1 C.jint = _seq.NullRefNum if a1 != nil { _a1 = C.jint(_seq.ToRefNum(a1)) } - res := C.csuper_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), _a0, _a1) + res := C.csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), _a0, _a1) var _res Java.Java_lang_Object _res_ref := _seq.FromRefNum(int32(res.res)) if _res_ref != nil { @@ -579,33 +579,33 @@ func (p *super_go_java_Future) Get2(a0 int64, a1 Java.Java_util_concurrent_TimeU return _res, _exc } -var class_go_java_InputStream C.jclass +var class_java_InputStream C.jclass -func init_go_java_InputStream() { - cls := C.CString("go/java/InputStream") +func init_java_InputStream() { + cls := C.CString("java/InputStream") clazz := C.go_seq_find_class(cls) C.free(unsafe.Pointer(cls)) if clazz == nil { return } - class_go_java_InputStream = clazz - InputStream.Cast = func(v interface{}) Java.Go_java_InputStream { - t := reflect.TypeOf((*proxy_class_go_java_InputStream)(nil)) - cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_go_java_InputStream) + class_java_InputStream = clazz + InputStream.Cast = func(v interface{}) Java.Java_InputStream { + t := reflect.TypeOf((*proxy_class_java_InputStream)(nil)) + cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_InputStream) ref := C.jint(_seq.ToRefNum(cv)) - if C.go_seq_isinstanceof(ref, class_go_java_InputStream) != 1 { - panic(fmt.Errorf("%T is not an instance of %s", v, "go.java.InputStream")) + if C.go_seq_isinstanceof(ref, class_java_InputStream) != 1 { + panic(fmt.Errorf("%T is not an instance of %s", v, "java.InputStream")) } return cv } } -type proxy_class_go_java_InputStream _seq.Ref +type proxy_class_java_InputStream _seq.Ref -func (p *proxy_class_go_java_InputStream) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } +func (p *proxy_class_java_InputStream) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } -func (p *proxy_class_go_java_InputStream) Read() (int32, error) { - res := C.cproxy_go_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__())) +func (p *proxy_class_java_InputStream) Read() (int32, error) { + res := C.cproxy_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__())) _res := int32(res.res) var _exc error _exc_ref := _seq.FromRefNum(int32(res.exc)) @@ -619,14 +619,14 @@ func (p *proxy_class_go_java_InputStream) Read() (int32, error) { return _res, _exc } -func (p *proxy_class_go_java_InputStream) Super() Java.Go_java_InputStream { - return &super_go_java_InputStream{p} +func (p *proxy_class_java_InputStream) Super() Java.Java_InputStream { + return &super_java_InputStream{p} } -type super_go_java_InputStream struct {*proxy_class_go_java_InputStream} +type super_java_InputStream struct {*proxy_class_java_InputStream} -func (p *super_go_java_InputStream) Read() (int32, error) { - res := C.csuper_go_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__())) +func (p *super_java_InputStream) Read() (int32, error) { + res := C.csuper_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__())) _res := int32(res.res) var _exc error _exc_ref := _seq.FromRefNum(int32(res.exc)) @@ -640,64 +640,64 @@ func (p *super_go_java_InputStream) Read() (int32, error) { return _res, _exc } -var class_go_java_Object C.jclass +var class_java_Object C.jclass -func init_go_java_Object() { - cls := C.CString("go/java/Object") +func init_java_Object() { + cls := C.CString("java/Object") clazz := C.go_seq_find_class(cls) C.free(unsafe.Pointer(cls)) if clazz == nil { return } - class_go_java_Object = clazz - Object.Cast = func(v interface{}) Java.Go_java_Object { - t := reflect.TypeOf((*proxy_class_go_java_Object)(nil)) - cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_go_java_Object) + class_java_Object = clazz + Object.Cast = func(v interface{}) Java.Java_Object { + t := reflect.TypeOf((*proxy_class_java_Object)(nil)) + cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Object) ref := C.jint(_seq.ToRefNum(cv)) - if C.go_seq_isinstanceof(ref, class_go_java_Object) != 1 { - panic(fmt.Errorf("%T is not an instance of %s", v, "go.java.Object")) + if C.go_seq_isinstanceof(ref, class_java_Object) != 1 { + panic(fmt.Errorf("%T is not an instance of %s", v, "java.Object")) } return cv } } -type proxy_class_go_java_Object _seq.Ref +type proxy_class_java_Object _seq.Ref -func (p *proxy_class_go_java_Object) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } +func (p *proxy_class_java_Object) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } -func (p *proxy_class_go_java_Object) Super() Java.Go_java_Object { - return &super_go_java_Object{p} +func (p *proxy_class_java_Object) Super() Java.Java_Object { + return &super_java_Object{p} } -type super_go_java_Object struct {*proxy_class_go_java_Object} +type super_java_Object struct {*proxy_class_java_Object} -var class_go_java_Runnable C.jclass +var class_java_Runnable C.jclass -func init_go_java_Runnable() { - cls := C.CString("go/java/Runnable") +func init_java_Runnable() { + cls := C.CString("java/Runnable") clazz := C.go_seq_find_class(cls) C.free(unsafe.Pointer(cls)) if clazz == nil { return } - class_go_java_Runnable = clazz - Runnable.Cast = func(v interface{}) Java.Go_java_Runnable { - t := reflect.TypeOf((*proxy_class_go_java_Runnable)(nil)) - cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_go_java_Runnable) + class_java_Runnable = clazz + Runnable.Cast = func(v interface{}) Java.Java_Runnable { + t := reflect.TypeOf((*proxy_class_java_Runnable)(nil)) + cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Runnable) ref := C.jint(_seq.ToRefNum(cv)) - if C.go_seq_isinstanceof(ref, class_go_java_Runnable) != 1 { - panic(fmt.Errorf("%T is not an instance of %s", v, "go.java.Runnable")) + if C.go_seq_isinstanceof(ref, class_java_Runnable) != 1 { + panic(fmt.Errorf("%T is not an instance of %s", v, "java.Runnable")) } return cv } } -type proxy_class_go_java_Runnable _seq.Ref +type proxy_class_java_Runnable _seq.Ref -func (p *proxy_class_go_java_Runnable) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } +func (p *proxy_class_java_Runnable) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } -func (p *proxy_class_go_java_Runnable) Run() { - res := C.cproxy_go_java_Runnable_run(C.jint(p.Bind_proxy_refnum__())) +func (p *proxy_class_java_Runnable) Run() { + res := C.cproxy_java_Runnable_run(C.jint(p.Bind_proxy_refnum__())) var _exc error _exc_ref := _seq.FromRefNum(int32(res)) if _exc_ref != nil { @@ -710,14 +710,14 @@ func (p *proxy_class_go_java_Runnable) Run() { if (_exc != nil) { panic(_exc) } } -func (p *proxy_class_go_java_Runnable) Super() Java.Go_java_Runnable { - return &super_go_java_Runnable{p} +func (p *proxy_class_java_Runnable) Super() Java.Java_Runnable { + return &super_java_Runnable{p} } -type super_go_java_Runnable struct {*proxy_class_go_java_Runnable} +type super_java_Runnable struct {*proxy_class_java_Runnable} -func (p *super_go_java_Runnable) Run() { - res := C.csuper_go_java_Runnable_run(C.jint(p.Bind_proxy_refnum__())) +func (p *super_java_Runnable) Run() { + res := C.csuper_java_Runnable_run(C.jint(p.Bind_proxy_refnum__())) var _exc error _exc_ref := _seq.FromRefNum(int32(res)) if _exc_ref != nil { @@ -835,7 +835,7 @@ package gomobile_bind import "C" import ( - java_1 "Java/go/java" + java_1 "Java/java" "Java/java/io" "Java/java/lang" "Java/java/util/concurrent" @@ -1022,7 +1022,7 @@ func proxyjava_Runnable_Run(refnum C.int32_t, param_this C.int32_t) { if param_this < 0 { // go object _param_this = _param_this_ref.Get().(java_1.Runnable) } else { // foreign object - _param_this = (*proxy_class_go_java_Runnable)(_param_this_ref) + _param_this = (*proxy_class_java_Runnable)(_param_this_ref) } } v.Run(_param_this) diff --git a/bind/testdata/classes.java.c.golden b/bind/testdata/classes.java.c.golden index e738c12..62da76a 100644 --- a/bind/testdata/classes.java.c.golden +++ b/bind/testdata/classes.java.c.golden @@ -44,22 +44,22 @@ ret_jint cproxy_s_java_lang_System_console(jclass clazz, jmethodID m) { } static jclass class_java_lang_System; -static jclass class_go_java_Future; -static jclass sclass_go_java_Future; -static jmethodID m_go_java_Future_get__; -static jmethodID sm_go_java_Future_get__; -static jmethodID m_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2; -static jmethodID sm_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2; -static jclass class_go_java_InputStream; -static jclass sclass_go_java_InputStream; -static jmethodID m_go_java_InputStream_read__; -static jmethodID sm_go_java_InputStream_read__; -static jclass class_go_java_Object; -static jclass sclass_go_java_Object; -static jclass class_go_java_Runnable; -static jclass sclass_go_java_Runnable; -static jmethodID m_go_java_Runnable_run; -static jmethodID sm_go_java_Runnable_run; +static jclass class_java_Future; +static jclass sclass_java_Future; +static jmethodID m_java_Future_get__; +static jmethodID sm_java_Future_get__; +static jmethodID m_java_Future_get__JLjava_util_concurrent_TimeUnit_2; +static jmethodID sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2; +static jclass class_java_InputStream; +static jclass sclass_java_InputStream; +static jmethodID m_java_InputStream_read__; +static jmethodID sm_java_InputStream_read__; +static jclass class_java_Object; +static jclass sclass_java_Object; +static jclass class_java_Runnable; +static jclass sclass_java_Runnable; +static jmethodID m_java_Runnable_run; +static jmethodID sm_java_Runnable_run; static jclass class_java_util_PrimitiveIterator_OfInt; static jclass class_java_util_Spliterator_OfInt; static jclass class_java_io_Console; @@ -86,30 +86,30 @@ void init_proxies() { class_java_util_Spliterators = (*env)->NewGlobalRef(env, clazz); clazz = (*env)->FindClass(env, "java/lang/System"); class_java_lang_System = (*env)->NewGlobalRef(env, clazz); - clazz = (*env)->FindClass(env, "go/java/Future"); - class_go_java_Future = (*env)->NewGlobalRef(env, clazz); - sclass_go_java_Future = (*env)->GetSuperclass(env, clazz); - sclass_go_java_Future = (*env)->NewGlobalRef(env, sclass_go_java_Future); - m_go_java_Future_get__ = go_seq_get_method_id(clazz, "get", "()Ljava/lang/Object;"); - sm_go_java_Future_get__ = go_seq_get_method_id(sclass_go_java_Future, "get", "()Ljava/lang/Object;"); - m_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(clazz, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;"); - sm_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(sclass_go_java_Future, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;"); - clazz = (*env)->FindClass(env, "go/java/InputStream"); - class_go_java_InputStream = (*env)->NewGlobalRef(env, clazz); - sclass_go_java_InputStream = (*env)->GetSuperclass(env, clazz); - sclass_go_java_InputStream = (*env)->NewGlobalRef(env, sclass_go_java_InputStream); - m_go_java_InputStream_read__ = go_seq_get_method_id(clazz, "read", "()I"); - sm_go_java_InputStream_read__ = go_seq_get_method_id(sclass_go_java_InputStream, "read", "()I"); - clazz = (*env)->FindClass(env, "go/java/Object"); - class_go_java_Object = (*env)->NewGlobalRef(env, clazz); - sclass_go_java_Object = (*env)->GetSuperclass(env, clazz); - sclass_go_java_Object = (*env)->NewGlobalRef(env, sclass_go_java_Object); - clazz = (*env)->FindClass(env, "go/java/Runnable"); - class_go_java_Runnable = (*env)->NewGlobalRef(env, clazz); - sclass_go_java_Runnable = (*env)->GetSuperclass(env, clazz); - sclass_go_java_Runnable = (*env)->NewGlobalRef(env, sclass_go_java_Runnable); - m_go_java_Runnable_run = go_seq_get_method_id(clazz, "run", "()V"); - sm_go_java_Runnable_run = go_seq_get_method_id(sclass_go_java_Runnable, "run", "()V"); + clazz = (*env)->FindClass(env, "java/Future"); + class_java_Future = (*env)->NewGlobalRef(env, clazz); + sclass_java_Future = (*env)->GetSuperclass(env, clazz); + sclass_java_Future = (*env)->NewGlobalRef(env, sclass_java_Future); + m_java_Future_get__ = go_seq_get_method_id(clazz, "get", "()Ljava/lang/Object;"); + sm_java_Future_get__ = go_seq_get_method_id(sclass_java_Future, "get", "()Ljava/lang/Object;"); + m_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(clazz, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;"); + sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(sclass_java_Future, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;"); + clazz = (*env)->FindClass(env, "java/InputStream"); + class_java_InputStream = (*env)->NewGlobalRef(env, clazz); + sclass_java_InputStream = (*env)->GetSuperclass(env, clazz); + sclass_java_InputStream = (*env)->NewGlobalRef(env, sclass_java_InputStream); + m_java_InputStream_read__ = go_seq_get_method_id(clazz, "read", "()I"); + sm_java_InputStream_read__ = go_seq_get_method_id(sclass_java_InputStream, "read", "()I"); + clazz = (*env)->FindClass(env, "java/Object"); + class_java_Object = (*env)->NewGlobalRef(env, clazz); + sclass_java_Object = (*env)->GetSuperclass(env, clazz); + sclass_java_Object = (*env)->NewGlobalRef(env, sclass_java_Object); + clazz = (*env)->FindClass(env, "java/Runnable"); + class_java_Runnable = (*env)->NewGlobalRef(env, clazz); + sclass_java_Runnable = (*env)->GetSuperclass(env, clazz); + sclass_java_Runnable = (*env)->NewGlobalRef(env, sclass_java_Runnable); + m_java_Runnable_run = go_seq_get_method_id(clazz, "run", "()V"); + sm_java_Runnable_run = go_seq_get_method_id(sclass_java_Runnable, "run", "()V"); clazz = (*env)->FindClass(env, "java/util/PrimitiveIterator$OfInt"); class_java_util_PrimitiveIterator_OfInt = (*env)->NewGlobalRef(env, clazz); clazz = (*env)->FindClass(env, "java/util/Spliterator$OfInt"); @@ -181,11 +181,11 @@ ret_jint cproxy_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit return __res; } -ret_jint cproxy_go_java_Future_get__(jint this) { +ret_jint cproxy_java_Future_get__(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - jobject res = (*env)->CallObjectMethod(env, _this, m_go_java_Future_get__); + jobject res = (*env)->CallObjectMethod(env, _this, m_java_Future_get__); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -197,11 +197,11 @@ ret_jint cproxy_go_java_Future_get__(jint this) { return __res; } -ret_jint csuper_go_java_Future_get__(jint this) { +ret_jint csuper_java_Future_get__(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_go_java_Future, sm_go_java_Future_get__); + jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_Future, sm_java_Future_get__); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -213,13 +213,13 @@ ret_jint csuper_go_java_Future_get__(jint this) { return __res; } -ret_jint cproxy_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) { +ret_jint cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) { JNIEnv *env = go_seq_push_local_frame(3); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); jlong _a0 = a0; jobject _a1 = go_seq_from_refnum(env, a1, NULL, NULL); - jobject res = (*env)->CallObjectMethod(env, _this, m_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1); + jobject res = (*env)->CallObjectMethod(env, _this, m_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -231,13 +231,13 @@ ret_jint cproxy_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, return __res; } -ret_jint csuper_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) { +ret_jint csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) { JNIEnv *env = go_seq_push_local_frame(3); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); jlong _a0 = a0; jobject _a1 = go_seq_from_refnum(env, a1, NULL, NULL); - jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_go_java_Future, sm_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1); + jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_Future, sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -249,11 +249,11 @@ ret_jint csuper_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, return __res; } -ret_jint cproxy_go_java_InputStream_read__(jint this) { +ret_jint cproxy_java_InputStream_read__(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - jint res = (*env)->CallIntMethod(env, _this, m_go_java_InputStream_read__); + jint res = (*env)->CallIntMethod(env, _this, m_java_InputStream_read__); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -265,11 +265,11 @@ ret_jint cproxy_go_java_InputStream_read__(jint this) { return __res; } -ret_jint csuper_go_java_InputStream_read__(jint this) { +ret_jint csuper_java_InputStream_read__(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - jint res = (*env)->CallNonvirtualIntMethod(env, _this, sclass_go_java_InputStream, sm_go_java_InputStream_read__); + jint res = (*env)->CallNonvirtualIntMethod(env, _this, sclass_java_InputStream, sm_java_InputStream_read__); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); if (_exc != NULL) { @@ -281,22 +281,22 @@ ret_jint csuper_go_java_InputStream_read__(jint this) { return __res; } -jint cproxy_go_java_Runnable_run(jint this) { +jint cproxy_java_Runnable_run(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - (*env)->CallVoidMethod(env, _this, m_go_java_Runnable_run); + (*env)->CallVoidMethod(env, _this, m_java_Runnable_run); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); go_seq_pop_local_frame(env); return _exc_ref; } -jint csuper_go_java_Runnable_run(jint this) { +jint csuper_java_Runnable_run(jint this) { JNIEnv *env = go_seq_push_local_frame(1); // Must be a Java object jobject _this = go_seq_from_refnum(env, this, NULL, NULL); - (*env)->CallNonvirtualVoidMethod(env, _this, sclass_go_java_Runnable, sm_go_java_Runnable_run); + (*env)->CallNonvirtualVoidMethod(env, _this, sclass_java_Runnable, sm_java_Runnable_run); jobject _exc = go_seq_get_exception(env); int32_t _exc_ref = go_seq_to_refnum(env, _exc); go_seq_pop_local_frame(env); @@ -335,34 +335,34 @@ jclass proxy_class_java_Runnable; jmethodID proxy_class_java_Runnable_cons; JNIEXPORT void JNICALL -Java_go_java_Java__1init(JNIEnv *env, jclass _unused) { +Java_java_Java__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/java/Future"); + clazz = (*env)->FindClass(env, "java/Future"); proxy_class_java_Future = (*env)->NewGlobalRef(env, clazz); proxy_class_java_Future_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/Object"); + clazz = (*env)->FindClass(env, "java/Object"); proxy_class_java_Object = (*env)->NewGlobalRef(env, clazz); proxy_class_java_Object_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/Runnable"); + clazz = (*env)->FindClass(env, "java/Runnable"); proxy_class_java_Runnable = (*env)->NewGlobalRef(env, clazz); proxy_class_java_Runnable_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); } JNIEXPORT jobject JNICALL -Java_go_java_Java_newInputStream(JNIEnv* env, jclass _clazz) { +Java_java_Java_newInputStream(JNIEnv* env, jclass _clazz) { int32_t r0 = proxyjava__NewInputStream(); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_java_InputStream, proxy_class_java_InputStream_cons); return _r0; } JNIEXPORT jobject JNICALL -Java_go_java_Future__1_1New(JNIEnv *env, jclass clazz) { +Java_java_Future__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_java_Future(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT jobject JNICALL -Java_go_java_Future_get__(JNIEnv* env, jobject __this__) { +Java_java_Future_get__(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); int32_t r0 = proxyjava_Future_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL); @@ -370,7 +370,7 @@ Java_go_java_Future_get__(JNIEnv* env, jobject __this__) { } JNIEXPORT jobject JNICALL -Java_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(JNIEnv* env, jobject __this__, jlong p0, jobject p1) { +Java_java_Future_get__JLjava_util_concurrent_TimeUnit_2(JNIEnv* env, jobject __this__, jlong p0, jobject p1) { int32_t o = go_seq_to_refnum_go(env, __this__); int64_t _p0 = (int64_t)p0; int32_t _p1 = go_seq_to_refnum(env, p1); @@ -380,14 +380,14 @@ Java_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(JNIEnv* env, jobject } JNIEXPORT void JNICALL -Java_go_java_Future_setFuture(JNIEnv *env, jobject this, jobject v) { +Java_java_Future_setFuture(JNIEnv *env, jobject this, jobject v) { int32_t o = go_seq_to_refnum_go(env, this); int32_t _v = go_seq_to_refnum(env, v); proxyjava_Future_Future_Set(o, _v); } JNIEXPORT jobject JNICALL -Java_go_java_Future_getFuture(JNIEnv *env, jobject this) { +Java_java_Future_getFuture(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); int32_t r0 = proxyjava_Future_Future_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL); @@ -395,13 +395,13 @@ Java_go_java_Future_getFuture(JNIEnv *env, jobject this) { } JNIEXPORT jobject JNICALL -Java_go_java_InputStream__1_1NewInputStream(JNIEnv *env, jclass clazz) { +Java_java_InputStream__1_1NewInputStream(JNIEnv *env, jclass clazz) { int32_t refnum = proxyjava__NewInputStream(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT jint JNICALL -Java_go_java_InputStream_read__(JNIEnv* env, jobject __this__) { +Java_java_InputStream_read__(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); struct proxyjava_InputStream_Read_return res = proxyjava_InputStream_Read(o); jint _r0 = (jint)res.r0; @@ -411,14 +411,14 @@ Java_go_java_InputStream_read__(JNIEnv* env, jobject __this__) { } JNIEXPORT void JNICALL -Java_go_java_InputStream_setInputStream(JNIEnv *env, jobject this, jobject v) { +Java_java_InputStream_setInputStream(JNIEnv *env, jobject this, jobject v) { int32_t o = go_seq_to_refnum_go(env, this); int32_t _v = go_seq_to_refnum(env, v); proxyjava_InputStream_InputStream_Set(o, _v); } JNIEXPORT jobject JNICALL -Java_go_java_InputStream_getInputStream(JNIEnv *env, jobject this) { +Java_java_InputStream_getInputStream(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); int32_t r0 = proxyjava_InputStream_InputStream_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL); @@ -426,20 +426,20 @@ Java_go_java_InputStream_getInputStream(JNIEnv *env, jobject this) { } JNIEXPORT jobject JNICALL -Java_go_java_Object__1_1New(JNIEnv *env, jclass clazz) { +Java_java_Object__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_java_Object(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_java_Object_setObject(JNIEnv *env, jobject this, jobject v) { +Java_java_Object_setObject(JNIEnv *env, jobject this, jobject v) { int32_t o = go_seq_to_refnum_go(env, this); int32_t _v = go_seq_to_refnum(env, v); proxyjava_Object_Object_Set(o, _v); } JNIEXPORT jobject JNICALL -Java_go_java_Object_getObject(JNIEnv *env, jobject this) { +Java_java_Object_getObject(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); int32_t r0 = proxyjava_Object_Object_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL); @@ -447,27 +447,27 @@ Java_go_java_Object_getObject(JNIEnv *env, jobject this) { } JNIEXPORT jobject JNICALL -Java_go_java_Runnable__1_1New(JNIEnv *env, jclass clazz) { +Java_java_Runnable__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_java_Runnable(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_java_Runnable_run(JNIEnv* env, jobject __this__) { +Java_java_Runnable_run(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); int32_t _this_ = go_seq_to_refnum(env, __this__); proxyjava_Runnable_Run(o, _this_); } JNIEXPORT void JNICALL -Java_go_java_Runnable_setRunnable(JNIEnv *env, jobject this, jobject v) { +Java_java_Runnable_setRunnable(JNIEnv *env, jobject this, jobject v) { int32_t o = go_seq_to_refnum_go(env, this); int32_t _v = go_seq_to_refnum(env, v); proxyjava_Runnable_Runnable_Set(o, _v); } JNIEXPORT jobject JNICALL -Java_go_java_Runnable_getRunnable(JNIEnv *env, jobject this) { +Java_java_Runnable_getRunnable(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); int32_t r0 = proxyjava_Runnable_Runnable_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL); diff --git a/bind/testdata/classes.java.golden b/bind/testdata/classes.java.golden index 40d4999..b9d602c 100644 --- a/bind/testdata/classes.java.golden +++ b/bind/testdata/classes.java.golden @@ -1,8 +1,8 @@ -// Java class go.java.Future is a proxy for talking to a Go program. +// Java class java.Future is a proxy for talking to a Go program. // gobind -lang=java classes // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -30,11 +30,11 @@ public final class Future implements Seq.GoObject, java.util.concurrent.Future { @Override public native java.lang.Object get(long p0, java.util.concurrent.TimeUnit p1); } -// Java class go.java.InputStream is a proxy for talking to a Go program. +// Java class java.InputStream is a proxy for talking to a Go program. // gobind -lang=java classes // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -62,11 +62,11 @@ public final class InputStream extends java.io.InputStream implements Seq.GoObje @Override public native int read() throws java.io.IOException; } -// Java class go.java.Object is a proxy for talking to a Go program. +// Java class java.Object is a proxy for talking to a Go program. // gobind -lang=java classes // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -92,11 +92,11 @@ public final class Object extends java.lang.Object implements Seq.GoObject { } -// Java class go.java.Runnable is a proxy for talking to a Go program. +// Java class java.Runnable is a proxy for talking to a Go program. // gobind -lang=java classes // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -123,11 +123,11 @@ public final class Runnable implements Seq.GoObject, java.lang.Runnable { @Override public native void run(); } -// Java class go.java.Java is a proxy for talking to a Go program. +// Java class java.Java is a proxy for talking to a Go program. // gobind -lang=java classes // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; diff --git a/bind/testdata/classes.java.h.golden b/bind/testdata/classes.java.h.golden index 9421910..4e8aed1 100644 --- a/bind/testdata/classes.java.h.golden +++ b/bind/testdata/classes.java.h.golden @@ -50,14 +50,14 @@ extern jint cproxy_java_lang_Runnable_run(jint this); extern ret_jint cproxy_java_io_InputStream_read__(jint this); extern ret_jint cproxy_java_util_concurrent_Future_get__(jint this); extern ret_jint cproxy_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1); -extern ret_jint cproxy_go_java_Future_get__(jint this); -extern ret_jint csuper_go_java_Future_get__(jint this); -extern ret_jint cproxy_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1); -extern ret_jint csuper_go_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1); -extern ret_jint cproxy_go_java_InputStream_read__(jint this); -extern ret_jint csuper_go_java_InputStream_read__(jint this); -extern jint cproxy_go_java_Runnable_run(jint this); -extern jint csuper_go_java_Runnable_run(jint this); +extern ret_jint cproxy_java_Future_get__(jint this); +extern ret_jint csuper_java_Future_get__(jint this); +extern ret_jint cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1); +extern ret_jint csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1); +extern ret_jint cproxy_java_InputStream_read__(jint this); +extern ret_jint csuper_java_InputStream_read__(jint this); +extern jint cproxy_java_Runnable_run(jint this); +extern jint csuper_java_Runnable_run(jint this); extern jint cproxy_java_io_Console_flush(jint this); extern ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2(jclass clazz, jmethodID m, jint a0); extern ret_jint cproxy_s_java_lang_System_console(jclass clazz, jmethodID m); diff --git a/bind/testdata/ignore.java.c.golden b/bind/testdata/ignore.java.c.golden index 981fbdf..9be1408 100644 --- a/bind/testdata/ignore.java.c.golden +++ b/bind/testdata/ignore.java.c.golden @@ -19,15 +19,15 @@ jclass proxy_class_ignore_S; jmethodID proxy_class_ignore_S_cons; JNIEXPORT void JNICALL -Java_go_ignore_Ignore__1init(JNIEnv *env, jclass _unused) { +Java_ignore_Ignore__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/ignore/S"); + clazz = (*env)->FindClass(env, "ignore/S"); proxy_class_ignore_S = (*env)->NewGlobalRef(env, clazz); proxy_class_ignore_S_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/ignore/Ignore$proxyI"); + clazz = (*env)->FindClass(env, "ignore/Ignore$proxyI"); proxy_class_ignore_I = (*env)->NewGlobalRef(env, clazz); proxy_class_ignore_I_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/ignore/I"); + clazz = (*env)->FindClass(env, "ignore/I"); // skipped method I.Argument with unsupported parameter or return types // skipped method I.Result with unsupported parameter or return types @@ -40,7 +40,7 @@ Java_go_ignore_Ignore__1init(JNIEnv *env, jclass _unused) { // skipped function Result with unsupported parameter or return types JNIEXPORT jobject JNICALL -Java_go_ignore_S__1_1New(JNIEnv *env, jclass clazz) { +Java_ignore_S__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_ignore_S(); return go_seq_from_refnum(env, refnum, NULL, NULL); } diff --git a/bind/testdata/ignore.java.golden b/bind/testdata/ignore.java.golden index 0dd0d83..6255635 100644 --- a/bind/testdata/ignore.java.golden +++ b/bind/testdata/ignore.java.golden @@ -1,8 +1,8 @@ -// Java class go.ignore.S is a proxy for talking to a Go program. +// Java class ignore.S is a proxy for talking to a Go program. // gobind -lang=java ignore // // File is generated by gobind. Do not edit. -package go.ignore; +package ignore; import go.Seq; @@ -50,11 +50,11 @@ public final class S implements Seq.Proxy, I { } } -// Java class go.ignore.I is a proxy for talking to a Go program. +// Java class ignore.I is a proxy for talking to a Go program. // gobind -lang=java ignore // // File is generated by gobind. Do not edit. -package go.ignore; +package ignore; import go.Seq; @@ -66,11 +66,11 @@ public interface I { } -// Java class go.ignore.Ignore is a proxy for talking to a Go program. +// Java class ignore.Ignore is a proxy for talking to a Go program. // gobind -lang=java ignore // // File is generated by gobind. Do not edit. -package go.ignore; +package ignore; import go.Seq; diff --git a/bind/testdata/interfaces.java.c.golden b/bind/testdata/interfaces.java.c.golden index ed6616d..7c31204 100644 --- a/bind/testdata/interfaces.java.c.golden +++ b/bind/testdata/interfaces.java.c.golden @@ -36,61 +36,61 @@ jmethodID proxy_class_interfaces_WithParam_cons; static jmethodID mid_WithParam_HasParam; JNIEXPORT void JNICALL -Java_go_interfaces_Interfaces__1init(JNIEnv *env, jclass _unused) { +Java_interfaces_Interfaces__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyError"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyError"); proxy_class_interfaces_Error = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_Error_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/Error"); + clazz = (*env)->FindClass(env, "interfaces/Error"); mid_Error_Err = (*env)->GetMethodID(env, clazz, "err", "()V"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI"); proxy_class_interfaces_I = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_I_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/I"); + clazz = (*env)->FindClass(env, "interfaces/I"); mid_I_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI1"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI1"); proxy_class_interfaces_I1 = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_I1_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/I1"); + clazz = (*env)->FindClass(env, "interfaces/I1"); mid_I1_J = (*env)->GetMethodID(env, clazz, "j", "()V"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI2"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI2"); proxy_class_interfaces_I2 = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_I2_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/I2"); + clazz = (*env)->FindClass(env, "interfaces/I2"); mid_I2_G = (*env)->GetMethodID(env, clazz, "g", "()V"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyI3"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI3"); proxy_class_interfaces_I3 = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_I3_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/I3"); - mid_I3_F = (*env)->GetMethodID(env, clazz, "f", "()Lgo/interfaces/I1;"); + clazz = (*env)->FindClass(env, "interfaces/I3"); + mid_I3_F = (*env)->GetMethodID(env, clazz, "f", "()Linterfaces/I1;"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyLargerI"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyLargerI"); proxy_class_interfaces_LargerI = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_LargerI_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/LargerI"); + clazz = (*env)->FindClass(env, "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$proxySameI"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxySameI"); proxy_class_interfaces_SameI = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_SameI_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/SameI"); + clazz = (*env)->FindClass(env, "interfaces/SameI"); mid_SameI_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I"); - clazz = (*env)->FindClass(env, "go/interfaces/Interfaces$proxyWithParam"); + clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyWithParam"); proxy_class_interfaces_WithParam = (*env)->NewGlobalRef(env, clazz); proxy_class_interfaces_WithParam_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/interfaces/WithParam"); + clazz = (*env)->FindClass(env, "interfaces/WithParam"); mid_WithParam_HasParam = (*env)->GetMethodID(env, clazz, "hasParam", "(Z)V"); } JNIEXPORT jint JNICALL -Java_go_interfaces_Interfaces_add3(JNIEnv* env, jclass _clazz, jobject r) { +Java_interfaces_Interfaces_add3(JNIEnv* env, jclass _clazz, jobject r) { int32_t _r = go_seq_to_refnum(env, r); int32_t r0 = proxyinterfaces__Add3(_r); jint _r0 = (jint)r0; @@ -98,7 +98,7 @@ Java_go_interfaces_Interfaces_add3(JNIEnv* env, jclass _clazz, jobject r) { } JNIEXPORT void JNICALL -Java_go_interfaces_Interfaces_callErr(JNIEnv* env, jclass _clazz, jobject e) { +Java_interfaces_Interfaces_callErr(JNIEnv* env, jclass _clazz, jobject e) { int32_t _e = go_seq_to_refnum(env, e); int32_t r0 = proxyinterfaces__CallErr(_e); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons); @@ -106,14 +106,14 @@ Java_go_interfaces_Interfaces_callErr(JNIEnv* env, jclass _clazz, jobject e) { } JNIEXPORT jobject JNICALL -Java_go_interfaces_Interfaces_seven(JNIEnv* env, jclass _clazz) { +Java_interfaces_Interfaces_seven(JNIEnv* env, jclass _clazz) { int32_t r0 = proxyinterfaces__Seven(); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_interfaces_I, proxy_class_interfaces_I_cons); return _r0; } JNIEXPORT void JNICALL -Java_go_interfaces_Interfaces_00024proxyError_err(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyError_err(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); int32_t r0 = proxyinterfaces_Error_Err(o); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons); @@ -131,7 +131,7 @@ int32_t cproxyinterfaces_Error_Err(int32_t refnum) { } JNIEXPORT jint JNICALL -Java_go_interfaces_Interfaces_00024proxyI_rand(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyI_rand(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(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_00024proxyI1_j(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyI1_j(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxyinterfaces_I1_J(o); } @@ -161,7 +161,7 @@ void cproxyinterfaces_I1_J(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_interfaces_Interfaces_00024proxyI2_g(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyI2_g(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxyinterfaces_I2_G(o); } @@ -174,7 +174,7 @@ void cproxyinterfaces_I2_G(int32_t refnum) { } JNIEXPORT jobject JNICALL -Java_go_interfaces_Interfaces_00024proxyI3_f(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyI3_f(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(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_00024proxyLargerI_anotherFunc(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyLargerI_anotherFunc(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxyinterfaces_LargerI_AnotherFunc(o); } @@ -204,7 +204,7 @@ void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum) { } JNIEXPORT jint JNICALL -Java_go_interfaces_Interfaces_00024proxyLargerI_rand(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxyLargerI_rand(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(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_00024proxySameI_rand(JNIEnv* env, jobject __this__) { +Java_interfaces_Interfaces_00024proxySameI_rand(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(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_00024proxyWithParam_hasParam(JNIEnv* env, jobject __this__, jboolean p0) { +Java_interfaces_Interfaces_00024proxyWithParam_hasParam(JNIEnv* env, jobject __this__, jboolean p0) { int32_t o = go_seq_to_refnum_go(env, __this__); char _p0 = (char)p0; proxyinterfaces_WithParam_HasParam(o, _p0); diff --git a/bind/testdata/interfaces.java.golden b/bind/testdata/interfaces.java.golden index 8164d15..44d5413 100644 --- a/bind/testdata/interfaces.java.golden +++ b/bind/testdata/interfaces.java.golden @@ -1,8 +1,8 @@ -// Java class go.interfaces.Error is a proxy for talking to a Go program. +// Java class interfaces.Error is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -11,11 +11,11 @@ public interface Error { } -// Java class go.interfaces.I is a proxy for talking to a Go program. +// Java class interfaces.I is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -24,11 +24,11 @@ public interface I { } -// Java class go.interfaces.I1 is a proxy for talking to a Go program. +// Java class interfaces.I1 is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -37,11 +37,11 @@ public interface I1 { } -// Java class go.interfaces.I2 is a proxy for talking to a Go program. +// Java class interfaces.I2 is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -50,11 +50,11 @@ public interface I2 { } -// Java class go.interfaces.I3 is a proxy for talking to a Go program. +// Java class interfaces.I3 is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -63,11 +63,11 @@ public interface I3 { } -// Java class go.interfaces.LargerI is a proxy for talking to a Go program. +// Java class interfaces.LargerI is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -77,11 +77,11 @@ public interface LargerI extends I, SameI { } -// Java class go.interfaces.SameI is a proxy for talking to a Go program. +// Java class interfaces.SameI is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -90,11 +90,11 @@ public interface SameI { } -// Java class go.interfaces.WithParam is a proxy for talking to a Go program. +// Java class interfaces.WithParam is a proxy for talking to a Go program. // gobind -lang=java interfaces // // File is generated by gobind. Do not edit. -package go.interfaces; +package interfaces; import go.Seq; @@ -103,11 +103,11 @@ public interface WithParam { } -// Java class go.interfaces.Interfaces is a proxy for talking to a Go program. +// Java class 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; +package interfaces; import go.Seq; diff --git a/bind/testdata/issue10788.java.c.golden b/bind/testdata/issue10788.java.c.golden index 24e883c..7176a4d 100644 --- a/bind/testdata/issue10788.java.c.golden +++ b/bind/testdata/issue10788.java.c.golden @@ -17,35 +17,35 @@ jclass proxy_class_issue10788_TestStruct; jmethodID proxy_class_issue10788_TestStruct_cons; JNIEXPORT void JNICALL -Java_go_issue10788_Issue10788__1init(JNIEnv *env, jclass _unused) { +Java_issue10788_Issue10788__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/issue10788/TestStruct"); + clazz = (*env)->FindClass(env, "issue10788/TestStruct"); proxy_class_issue10788_TestStruct = (*env)->NewGlobalRef(env, clazz); proxy_class_issue10788_TestStruct_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/issue10788/Issue10788$proxyTestInterface"); + clazz = (*env)->FindClass(env, "issue10788/Issue10788$proxyTestInterface"); proxy_class_issue10788_TestInterface = (*env)->NewGlobalRef(env, clazz); proxy_class_issue10788_TestInterface_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/issue10788/TestInterface"); - mid_TestInterface_DoSomeWork = (*env)->GetMethodID(env, clazz, "doSomeWork", "(Lgo/issue10788/TestStruct;)V"); + clazz = (*env)->FindClass(env, "issue10788/TestInterface"); + mid_TestInterface_DoSomeWork = (*env)->GetMethodID(env, clazz, "doSomeWork", "(Lissue10788/TestStruct;)V"); mid_TestInterface_MultipleUnnamedParams = (*env)->GetMethodID(env, clazz, "multipleUnnamedParams", "(JLjava/lang/String;J)V"); } JNIEXPORT jobject JNICALL -Java_go_issue10788_TestStruct__1_1New(JNIEnv *env, jclass clazz) { +Java_issue10788_TestStruct__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_issue10788_TestStruct(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_issue10788_TestStruct_setValue(JNIEnv *env, jobject this, jstring v) { +Java_issue10788_TestStruct_setValue(JNIEnv *env, jobject this, jstring v) { int32_t o = go_seq_to_refnum_go(env, this); nstring _v = go_seq_from_java_string(env, v); proxyissue10788_TestStruct_Value_Set(o, _v); } JNIEXPORT jstring JNICALL -Java_go_issue10788_TestStruct_getValue(JNIEnv *env, jobject this) { +Java_issue10788_TestStruct_getValue(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); nstring r0 = proxyissue10788_TestStruct_Value_Get(o); jstring _r0 = go_seq_to_java_string(env, r0); @@ -53,7 +53,7 @@ Java_go_issue10788_TestStruct_getValue(JNIEnv *env, jobject this) { } JNIEXPORT void JNICALL -Java_go_issue10788_Issue10788_00024proxyTestInterface_doSomeWork(JNIEnv* env, jobject __this__, jobject s) { +Java_issue10788_Issue10788_00024proxyTestInterface_doSomeWork(JNIEnv* env, jobject __this__, jobject s) { int32_t o = go_seq_to_refnum_go(env, __this__); int32_t _s = go_seq_to_refnum(env, s); proxyissue10788_TestInterface_DoSomeWork(o, _s); @@ -68,7 +68,7 @@ void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s) { } JNIEXPORT void JNICALL -Java_go_issue10788_Issue10788_00024proxyTestInterface_multipleUnnamedParams(JNIEnv* env, jobject __this__, jlong p0, jstring p1, jlong p2) { +Java_issue10788_Issue10788_00024proxyTestInterface_multipleUnnamedParams(JNIEnv* env, jobject __this__, jlong p0, jstring p1, jlong p2) { int32_t o = go_seq_to_refnum_go(env, __this__); nint _p0 = (nint)p0; nstring _p1 = go_seq_from_java_string(env, p1); diff --git a/bind/testdata/issue10788.java.golden b/bind/testdata/issue10788.java.golden index 9264d36..75ea43d 100644 --- a/bind/testdata/issue10788.java.golden +++ b/bind/testdata/issue10788.java.golden @@ -1,8 +1,8 @@ -// Java class go.issue10788.TestStruct is a proxy for talking to a Go program. +// Java class issue10788.TestStruct is a proxy for talking to a Go program. // gobind -lang=java issue10788 // // File is generated by gobind. Do not edit. -package go.issue10788; +package issue10788; import go.Seq; @@ -55,11 +55,11 @@ public final class TestStruct implements Seq.Proxy { } } -// Java class go.issue10788.TestInterface is a proxy for talking to a Go program. +// Java class issue10788.TestInterface is a proxy for talking to a Go program. // gobind -lang=java issue10788 // // File is generated by gobind. Do not edit. -package go.issue10788; +package issue10788; import go.Seq; @@ -69,11 +69,11 @@ public interface TestInterface { } -// Java class go.issue10788.Issue10788 is a proxy for talking to a Go program. +// Java class issue10788.Issue10788 is a proxy for talking to a Go program. // gobind -lang=java issue10788 // // File is generated by gobind. Do not edit. -package go.issue10788; +package issue10788; import go.Seq; diff --git a/bind/testdata/issue12328.java.c.golden b/bind/testdata/issue12328.java.c.golden index da995de..de835cf 100644 --- a/bind/testdata/issue12328.java.c.golden +++ b/bind/testdata/issue12328.java.c.golden @@ -13,28 +13,28 @@ jclass proxy_class_issue12328_T; jmethodID proxy_class_issue12328_T_cons; JNIEXPORT void JNICALL -Java_go_issue12328_Issue12328__1init(JNIEnv *env, jclass _unused) { +Java_issue12328_Issue12328__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/issue12328/T"); + clazz = (*env)->FindClass(env, "issue12328/T"); proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz); proxy_class_issue12328_T_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); } JNIEXPORT jobject JNICALL -Java_go_issue12328_T__1_1New(JNIEnv *env, jclass clazz) { +Java_issue12328_T__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_issue12328_T(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_issue12328_T_setErr(JNIEnv *env, jobject this, jobject v) { +Java_issue12328_T_setErr(JNIEnv *env, jobject this, jobject v) { int32_t o = go_seq_to_refnum_go(env, this); int32_t _v = go_seq_to_refnum(env, v); proxyissue12328_T_Err_Set(o, _v); } JNIEXPORT jobject JNICALL -Java_go_issue12328_T_getErr(JNIEnv *env, jobject this) { +Java_issue12328_T_getErr(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); int32_t r0 = proxyissue12328_T_Err_Get(o); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons); diff --git a/bind/testdata/issue12328.java.golden b/bind/testdata/issue12328.java.golden index 23fc5ef..db4d3da 100644 --- a/bind/testdata/issue12328.java.golden +++ b/bind/testdata/issue12328.java.golden @@ -1,8 +1,8 @@ -// Java class go.issue12328.T is a proxy for talking to a Go program. +// Java class issue12328.T is a proxy for talking to a Go program. // gobind -lang=java issue12328 // // File is generated by gobind. Do not edit. -package go.issue12328; +package issue12328; import go.Seq; @@ -55,11 +55,11 @@ public final class T implements Seq.Proxy { } } -// Java class go.issue12328.Issue12328 is a proxy for talking to a Go program. +// Java class issue12328.Issue12328 is a proxy for talking to a Go program. // gobind -lang=java issue12328 // // File is generated by gobind. Do not edit. -package go.issue12328; +package issue12328; import go.Seq; diff --git a/bind/testdata/issue12403.java.c.golden b/bind/testdata/issue12403.java.c.golden index fb5537b..d9c9ce2 100644 --- a/bind/testdata/issue12403.java.c.golden +++ b/bind/testdata/issue12403.java.c.golden @@ -15,19 +15,19 @@ static jmethodID mid_Parsable_FromJSON; static jmethodID mid_Parsable_ToJSON; JNIEXPORT void JNICALL -Java_go_issue12403_Issue12403__1init(JNIEnv *env, jclass _unused) { +Java_issue12403_Issue12403__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/issue12403/Issue12403$proxyParsable"); + clazz = (*env)->FindClass(env, "issue12403/Issue12403$proxyParsable"); proxy_class_issue12403_Parsable = (*env)->NewGlobalRef(env, clazz); proxy_class_issue12403_Parsable_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/issue12403/Parsable"); + clazz = (*env)->FindClass(env, "issue12403/Parsable"); mid_Parsable_FromJSON = (*env)->GetMethodID(env, clazz, "fromJSON", "(Ljava/lang/String;)Ljava/lang/String;"); mid_Parsable_ToJSON = (*env)->GetMethodID(env, clazz, "toJSON", "()Ljava/lang/String;"); } JNIEXPORT jstring JNICALL -Java_go_issue12403_Issue12403_00024proxyParsable_fromJSON(JNIEnv* env, jobject __this__, jstring jstr) { +Java_issue12403_Issue12403_00024proxyParsable_fromJSON(JNIEnv* env, jobject __this__, jstring jstr) { int32_t o = go_seq_to_refnum_go(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_00024proxyParsable_toJSON(JNIEnv* env, jobject __this__) { +Java_issue12403_Issue12403_00024proxyParsable_toJSON(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); struct proxyissue12403_Parsable_ToJSON_return res = proxyissue12403_Parsable_ToJSON(o); jstring _r0 = go_seq_to_java_string(env, res.r0); diff --git a/bind/testdata/issue12403.java.golden b/bind/testdata/issue12403.java.golden index 50c81af..290ef26 100644 --- a/bind/testdata/issue12403.java.golden +++ b/bind/testdata/issue12403.java.golden @@ -1,8 +1,8 @@ -// Java class go.issue12403.Parsable is a proxy for talking to a Go program. +// Java class issue12403.Parsable is a proxy for talking to a Go program. // gobind -lang=java issue12403 // // File is generated by gobind. Do not edit. -package go.issue12403; +package issue12403; import go.Seq; @@ -12,11 +12,11 @@ public interface Parsable { } -// Java class go.issue12403.Issue12403 is a proxy for talking to a Go program. +// Java class issue12403.Issue12403 is a proxy for talking to a Go program. // gobind -lang=java issue12403 // // File is generated by gobind. Do not edit. -package go.issue12403; +package issue12403; import go.Seq; diff --git a/bind/testdata/java.java.c.golden b/bind/testdata/java.java.c.golden index 26b7f24..3fadda6 100644 --- a/bind/testdata/java.java.c.golden +++ b/bind/testdata/java.java.c.golden @@ -47,27 +47,27 @@ jclass proxy_class_java_S; jmethodID proxy_class_java_S_cons; JNIEXPORT void JNICALL -Java_go_java_Java__1init(JNIEnv *env, jclass _unused) { +Java_java_Java__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/java/Java$proxyF"); + clazz = (*env)->FindClass(env, "java/Java$proxyF"); proxy_class_java_F = (*env)->NewGlobalRef(env, clazz); proxy_class_java_F_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/F"); + clazz = (*env)->FindClass(env, "java/F"); - clazz = (*env)->FindClass(env, "go/java/Java$proxyO"); + clazz = (*env)->FindClass(env, "java/Java$proxyO"); proxy_class_java_O = (*env)->NewGlobalRef(env, clazz); proxy_class_java_O_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/O"); + clazz = (*env)->FindClass(env, "java/O"); - clazz = (*env)->FindClass(env, "go/java/Java$proxyR"); + clazz = (*env)->FindClass(env, "java/Java$proxyR"); proxy_class_java_R = (*env)->NewGlobalRef(env, clazz); proxy_class_java_R_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/R"); + clazz = (*env)->FindClass(env, "java/R"); - clazz = (*env)->FindClass(env, "go/java/Java$proxyS"); + clazz = (*env)->FindClass(env, "java/Java$proxyS"); proxy_class_java_S = (*env)->NewGlobalRef(env, clazz); proxy_class_java_S_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/java/S"); + clazz = (*env)->FindClass(env, "java/S"); } diff --git a/bind/testdata/java.java.golden b/bind/testdata/java.java.golden index 7a01da8..f2472fc 100644 --- a/bind/testdata/java.java.golden +++ b/bind/testdata/java.java.golden @@ -1,8 +1,8 @@ -// Java class go.java.F is a proxy for talking to a Go program. +// Java class java.F is a proxy for talking to a Go program. // gobind -lang=java java // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -10,11 +10,11 @@ public interface F { } -// Java class go.java.O is a proxy for talking to a Go program. +// Java class java.O is a proxy for talking to a Go program. // gobind -lang=java java // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -22,11 +22,11 @@ public interface O { } -// Java class go.java.R is a proxy for talking to a Go program. +// Java class java.R is a proxy for talking to a Go program. // gobind -lang=java java // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -34,11 +34,11 @@ public interface R { } -// Java class go.java.S is a proxy for talking to a Go program. +// Java class java.S is a proxy for talking to a Go program. // gobind -lang=java java // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; @@ -46,11 +46,11 @@ public interface S { } -// Java class go.java.Java is a proxy for talking to a Go program. +// Java class java.Java is a proxy for talking to a Go program. // gobind -lang=java java // // File is generated by gobind. Do not edit. -package go.java; +package java; import go.Seq; diff --git a/bind/testdata/keywords.java.c.golden b/bind/testdata/keywords.java.c.golden index 9dd20f6..5e1fa46 100644 --- a/bind/testdata/keywords.java.c.golden +++ b/bind/testdata/keywords.java.c.golden @@ -66,12 +66,12 @@ static jmethodID mid_KeywordCaller_Volatile; static jmethodID mid_KeywordCaller_While; JNIEXPORT void JNICALL -Java_go_keywords_Keywords__1init(JNIEnv *env, jclass _unused) { +Java_keywords_Keywords__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/keywords/Keywords$proxyKeywordCaller"); + clazz = (*env)->FindClass(env, "keywords/Keywords$proxyKeywordCaller"); proxy_class_keywords_KeywordCaller = (*env)->NewGlobalRef(env, clazz); proxy_class_keywords_KeywordCaller_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/keywords/KeywordCaller"); + clazz = (*env)->FindClass(env, "keywords/KeywordCaller"); mid_KeywordCaller_Abstract = (*env)->GetMethodID(env, clazz, "abstract_", "()V"); mid_KeywordCaller_Assert = (*env)->GetMethodID(env, clazz, "assert_", "()V"); mid_KeywordCaller_Boolean = (*env)->GetMethodID(env, clazz, "boolean_", "()V"); @@ -129,19 +129,19 @@ Java_go_keywords_Keywords__1init(JNIEnv *env, jclass _unused) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_const_1(JNIEnv* env, jclass _clazz, jstring id) { +Java_keywords_Keywords_const_1(JNIEnv* env, jclass _clazz, jstring id) { nstring _id = go_seq_from_java_string(env, id); proxykeywords__Const(_id); } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_static_1(JNIEnv* env, jclass _clazz, jstring strictfp_) { +Java_keywords_Keywords_static_1(JNIEnv* env, jclass _clazz, jstring strictfp_) { nstring _strictfp_ = go_seq_from_java_string(env, strictfp_); proxykeywords__Static(_strictfp_); } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_abstract_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_abstract_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Abstract(o); } @@ -154,7 +154,7 @@ void cproxykeywords_KeywordCaller_Abstract(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_assert_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_assert_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Assert(o); } @@ -167,7 +167,7 @@ void cproxykeywords_KeywordCaller_Assert(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_boolean_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_boolean_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Boolean(o); } @@ -180,7 +180,7 @@ void cproxykeywords_KeywordCaller_Boolean(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_break_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_break_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Break(o); } @@ -193,7 +193,7 @@ void cproxykeywords_KeywordCaller_Break(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_byte_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_byte_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Byte(o); } @@ -206,7 +206,7 @@ void cproxykeywords_KeywordCaller_Byte(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_case_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_case_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Case(o); } @@ -219,7 +219,7 @@ void cproxykeywords_KeywordCaller_Case(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_catch_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_catch_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Catch(o); } @@ -232,7 +232,7 @@ void cproxykeywords_KeywordCaller_Catch(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_char_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_char_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Char(o); } @@ -245,7 +245,7 @@ void cproxykeywords_KeywordCaller_Char(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_class_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_class_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Class(o); } @@ -258,7 +258,7 @@ void cproxykeywords_KeywordCaller_Class(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_const_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_const_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Const(o); } @@ -271,7 +271,7 @@ void cproxykeywords_KeywordCaller_Const(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_continue_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_continue_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Continue(o); } @@ -284,7 +284,7 @@ void cproxykeywords_KeywordCaller_Continue(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_default_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_default_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Default(o); } @@ -297,7 +297,7 @@ void cproxykeywords_KeywordCaller_Default(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_do_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_do_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Do(o); } @@ -310,7 +310,7 @@ void cproxykeywords_KeywordCaller_Do(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_double_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_double_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Double(o); } @@ -323,7 +323,7 @@ void cproxykeywords_KeywordCaller_Double(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_else_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_else_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Else(o); } @@ -336,7 +336,7 @@ void cproxykeywords_KeywordCaller_Else(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_enum_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_enum_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Enum(o); } @@ -349,7 +349,7 @@ void cproxykeywords_KeywordCaller_Enum(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_extends_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_extends_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Extends(o); } @@ -362,7 +362,7 @@ void cproxykeywords_KeywordCaller_Extends(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_false_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_false_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_False(o); } @@ -375,7 +375,7 @@ void cproxykeywords_KeywordCaller_False(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_final_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_final_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Final(o); } @@ -388,7 +388,7 @@ void cproxykeywords_KeywordCaller_Final(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_finally_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_finally_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Finally(o); } @@ -401,7 +401,7 @@ void cproxykeywords_KeywordCaller_Finally(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_float_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_float_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Float(o); } @@ -414,7 +414,7 @@ void cproxykeywords_KeywordCaller_Float(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_for_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_for_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_For(o); } @@ -427,7 +427,7 @@ void cproxykeywords_KeywordCaller_For(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_goto_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_goto_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Goto(o); } @@ -440,7 +440,7 @@ void cproxykeywords_KeywordCaller_Goto(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_if_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_if_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_If(o); } @@ -453,7 +453,7 @@ void cproxykeywords_KeywordCaller_If(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_implements_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_implements_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Implements(o); } @@ -466,7 +466,7 @@ void cproxykeywords_KeywordCaller_Implements(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_import_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_import_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Import(o); } @@ -479,7 +479,7 @@ void cproxykeywords_KeywordCaller_Import(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_instanceof_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_instanceof_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Instanceof(o); } @@ -492,7 +492,7 @@ void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_int_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_int_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Int(o); } @@ -505,7 +505,7 @@ void cproxykeywords_KeywordCaller_Int(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_interface_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_interface_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Interface(o); } @@ -518,7 +518,7 @@ void cproxykeywords_KeywordCaller_Interface(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_long_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_long_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Long(o); } @@ -531,7 +531,7 @@ void cproxykeywords_KeywordCaller_Long(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_native_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_native_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Native(o); } @@ -544,7 +544,7 @@ void cproxykeywords_KeywordCaller_Native(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_new_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_new_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_New(o); } @@ -557,7 +557,7 @@ void cproxykeywords_KeywordCaller_New(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_null_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_null_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Null(o); } @@ -570,7 +570,7 @@ void cproxykeywords_KeywordCaller_Null(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_package_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_package_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Package(o); } @@ -583,7 +583,7 @@ void cproxykeywords_KeywordCaller_Package(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_private_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_private_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Private(o); } @@ -596,7 +596,7 @@ void cproxykeywords_KeywordCaller_Private(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_protected_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_protected_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Protected(o); } @@ -609,7 +609,7 @@ void cproxykeywords_KeywordCaller_Protected(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_public_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_public_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Public(o); } @@ -622,7 +622,7 @@ void cproxykeywords_KeywordCaller_Public(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_return_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_return_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Return(o); } @@ -635,7 +635,7 @@ void cproxykeywords_KeywordCaller_Return(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_short_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_short_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Short(o); } @@ -648,7 +648,7 @@ void cproxykeywords_KeywordCaller_Short(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_static_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_static_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Static(o); } @@ -661,7 +661,7 @@ void cproxykeywords_KeywordCaller_Static(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_strictfp_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_strictfp_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Strictfp(o); } @@ -674,7 +674,7 @@ void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_super_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_super_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Super(o); } @@ -687,7 +687,7 @@ void cproxykeywords_KeywordCaller_Super(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_switch_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_switch_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Switch(o); } @@ -700,7 +700,7 @@ void cproxykeywords_KeywordCaller_Switch(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_synchronized_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_synchronized_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Synchronized(o); } @@ -713,7 +713,7 @@ void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_this_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_this_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_This(o); } @@ -726,7 +726,7 @@ void cproxykeywords_KeywordCaller_This(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_throw_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_throw_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Throw(o); } @@ -739,7 +739,7 @@ void cproxykeywords_KeywordCaller_Throw(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_throws_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_throws_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Throws(o); } @@ -752,7 +752,7 @@ void cproxykeywords_KeywordCaller_Throws(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_transient_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_transient_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Transient(o); } @@ -765,7 +765,7 @@ void cproxykeywords_KeywordCaller_Transient(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_true_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_true_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_True(o); } @@ -778,7 +778,7 @@ void cproxykeywords_KeywordCaller_True(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_try_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_try_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Try(o); } @@ -791,7 +791,7 @@ void cproxykeywords_KeywordCaller_Try(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_void_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_void_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Void(o); } @@ -804,7 +804,7 @@ void cproxykeywords_KeywordCaller_Void(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_volatile_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_volatile_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_Volatile(o); } @@ -817,7 +817,7 @@ void cproxykeywords_KeywordCaller_Volatile(int32_t refnum) { } JNIEXPORT void JNICALL -Java_go_keywords_Keywords_00024proxyKeywordCaller_while_1(JNIEnv* env, jobject __this__) { +Java_keywords_Keywords_00024proxyKeywordCaller_while_1(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxykeywords_KeywordCaller_While(o); } diff --git a/bind/testdata/keywords.java.golden b/bind/testdata/keywords.java.golden index 4334f81..23d2d6c 100644 --- a/bind/testdata/keywords.java.golden +++ b/bind/testdata/keywords.java.golden @@ -1,8 +1,8 @@ -// Java class go.keywords.KeywordCaller is a proxy for talking to a Go program. +// Java class keywords.KeywordCaller is a proxy for talking to a Go program. // gobind -lang=java keywords // // File is generated by gobind. Do not edit. -package go.keywords; +package keywords; import go.Seq; @@ -63,11 +63,11 @@ public interface KeywordCaller { } -// Java class go.keywords.Keywords is a proxy for talking to a Go program. +// Java class keywords.Keywords is a proxy for talking to a Go program. // gobind -lang=java keywords // // File is generated by gobind. Do not edit. -package go.keywords; +package keywords; import go.Seq; diff --git a/bind/testdata/structs.java.c.golden b/bind/testdata/structs.java.c.golden index 9b84a2f..52ca312 100644 --- a/bind/testdata/structs.java.c.golden +++ b/bind/testdata/structs.java.c.golden @@ -18,24 +18,24 @@ jclass proxy_class_structs_S2; jmethodID proxy_class_structs_S2_cons; JNIEXPORT void JNICALL -Java_go_structs_Structs__1init(JNIEnv *env, jclass _unused) { +Java_structs_Structs__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/structs/S"); + clazz = (*env)->FindClass(env, "structs/S"); proxy_class_structs_S = (*env)->NewGlobalRef(env, clazz); proxy_class_structs_S_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/structs/S2"); + clazz = (*env)->FindClass(env, "structs/S2"); proxy_class_structs_S2 = (*env)->NewGlobalRef(env, clazz); proxy_class_structs_S2_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/structs/Structs$proxyI"); + clazz = (*env)->FindClass(env, "structs/Structs$proxyI"); proxy_class_structs_I = (*env)->NewGlobalRef(env, clazz); proxy_class_structs_I_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/structs/I"); + clazz = (*env)->FindClass(env, "structs/I"); mid_I_M = (*env)->GetMethodID(env, clazz, "m", "()V"); } JNIEXPORT jobject JNICALL -Java_go_structs_Structs_identity(JNIEnv* env, jclass _clazz, jobject s) { +Java_structs_Structs_identity(JNIEnv* env, jclass _clazz, jobject s) { int32_t _s = go_seq_to_refnum(env, s); int32_t r0 = proxystructs__Identity(_s); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_structs_S, proxy_class_structs_S_cons); @@ -43,7 +43,7 @@ Java_go_structs_Structs_identity(JNIEnv* env, jclass _clazz, jobject s) { } JNIEXPORT jobject JNICALL -Java_go_structs_Structs_identityWithError(JNIEnv* env, jclass _clazz, jobject s) { +Java_structs_Structs_identityWithError(JNIEnv* env, jclass _clazz, jobject s) { int32_t _s = go_seq_to_refnum(env, s); struct proxystructs__IdentityWithError_return res = proxystructs__IdentityWithError(_s); jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons); @@ -53,13 +53,13 @@ Java_go_structs_Structs_identityWithError(JNIEnv* env, jclass _clazz, jobject s) } JNIEXPORT jobject JNICALL -Java_go_structs_S__1_1New(JNIEnv *env, jclass clazz) { +Java_structs_S__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_structs_S(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT jobject JNICALL -Java_go_structs_S_identity(JNIEnv* env, jobject __this__) { +Java_structs_S_identity(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); struct proxystructs_S_Identity_return res = proxystructs_S_Identity(o); jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons); @@ -69,7 +69,7 @@ Java_go_structs_S_identity(JNIEnv* env, jobject __this__) { } JNIEXPORT jdouble JNICALL -Java_go_structs_S_sum(JNIEnv* env, jobject __this__) { +Java_structs_S_sum(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); double r0 = proxystructs_S_Sum(o); jdouble _r0 = (jdouble)r0; @@ -77,14 +77,14 @@ Java_go_structs_S_sum(JNIEnv* env, jobject __this__) { } JNIEXPORT void JNICALL -Java_go_structs_S_setX(JNIEnv *env, jobject this, jdouble v) { +Java_structs_S_setX(JNIEnv *env, jobject this, jdouble v) { int32_t o = go_seq_to_refnum_go(env, this); double _v = (double)v; proxystructs_S_X_Set(o, _v); } JNIEXPORT jdouble JNICALL -Java_go_structs_S_getX(JNIEnv *env, jobject this) { +Java_structs_S_getX(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); double r0 = proxystructs_S_X_Get(o); jdouble _r0 = (jdouble)r0; @@ -92,14 +92,14 @@ Java_go_structs_S_getX(JNIEnv *env, jobject this) { } JNIEXPORT void JNICALL -Java_go_structs_S_setY(JNIEnv *env, jobject this, jdouble v) { +Java_structs_S_setY(JNIEnv *env, jobject this, jdouble v) { int32_t o = go_seq_to_refnum_go(env, this); double _v = (double)v; proxystructs_S_Y_Set(o, _v); } JNIEXPORT jdouble JNICALL -Java_go_structs_S_getY(JNIEnv *env, jobject this) { +Java_structs_S_getY(JNIEnv *env, jobject this) { int32_t o = go_seq_to_refnum_go(env, this); double r0 = proxystructs_S_Y_Get(o); jdouble _r0 = (jdouble)r0; @@ -107,19 +107,19 @@ Java_go_structs_S_getY(JNIEnv *env, jobject this) { } JNIEXPORT jobject JNICALL -Java_go_structs_S2__1_1New(JNIEnv *env, jclass clazz) { +Java_structs_S2__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_structs_S2(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_structs_S2_m(JNIEnv* env, jobject __this__) { +Java_structs_S2_m(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxystructs_S2_M(o); } JNIEXPORT jstring JNICALL -Java_go_structs_S2_string(JNIEnv* env, jobject __this__) { +Java_structs_S2_string(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); nstring r0 = proxystructs_S2_String(o); jstring _r0 = go_seq_to_java_string(env, r0); @@ -127,7 +127,7 @@ Java_go_structs_S2_string(JNIEnv* env, jobject __this__) { } JNIEXPORT void JNICALL -Java_go_structs_Structs_00024proxyI_m(JNIEnv* env, jobject __this__) { +Java_structs_Structs_00024proxyI_m(JNIEnv* env, jobject __this__) { int32_t o = go_seq_to_refnum_go(env, __this__); proxystructs_I_M(o); } diff --git a/bind/testdata/structs.java.golden b/bind/testdata/structs.java.golden index 416973f..9f5009e 100644 --- a/bind/testdata/structs.java.golden +++ b/bind/testdata/structs.java.golden @@ -1,8 +1,8 @@ -// Java class go.structs.S is a proxy for talking to a Go program. +// Java class structs.S is a proxy for talking to a Go program. // gobind -lang=java structs // // File is generated by gobind. Do not edit. -package go.structs; +package structs; import go.Seq; @@ -62,11 +62,11 @@ public final class S implements Seq.Proxy { } } -// Java class go.structs.S2 is a proxy for talking to a Go program. +// Java class structs.S2 is a proxy for talking to a Go program. // gobind -lang=java structs // // File is generated by gobind. Do not edit. -package go.structs; +package structs; import go.Seq; @@ -106,11 +106,11 @@ public final class S2 implements Seq.Proxy, I { } } -// Java class go.structs.I is a proxy for talking to a Go program. +// Java class structs.I is a proxy for talking to a Go program. // gobind -lang=java structs // // File is generated by gobind. Do not edit. -package go.structs; +package structs; import go.Seq; @@ -119,11 +119,11 @@ public interface I { } -// Java class go.structs.Structs is a proxy for talking to a Go program. +// Java class structs.Structs is a proxy for talking to a Go program. // gobind -lang=java structs // // File is generated by gobind. Do not edit. -package go.structs; +package structs; import go.Seq; diff --git a/bind/testdata/try.java.c.golden b/bind/testdata/try.java.c.golden index f31ec12..232822f 100644 --- a/bind/testdata/try.java.c.golden +++ b/bind/testdata/try.java.c.golden @@ -11,12 +11,12 @@ JNIEXPORT void JNICALL -Java_go_try__Try__1init(JNIEnv *env, jclass _unused) { +Java_try__Try__1init(JNIEnv *env, jclass _unused) { jclass clazz; } JNIEXPORT jstring JNICALL -Java_go_try__Try_this_1(JNIEnv* env, jclass _clazz) { +Java_try__Try_this_1(JNIEnv* env, jclass _clazz) { nstring r0 = proxytry__This(); jstring _r0 = go_seq_to_java_string(env, r0); return _r0; diff --git a/bind/testdata/try.java.golden b/bind/testdata/try.java.golden index 044e424..ac27fd9 100644 --- a/bind/testdata/try.java.golden +++ b/bind/testdata/try.java.golden @@ -1,8 +1,8 @@ -// Java class go.try_.Try is a proxy for talking to a Go program. +// Java class try_.Try is a proxy for talking to a Go program. // gobind -lang=java try // // File is generated by gobind. Do not edit. -package go.try_; +package try_; import go.Seq; diff --git a/bind/testdata/vars.java.c.golden b/bind/testdata/vars.java.c.golden index eb491d3..ff5e77c 100644 --- a/bind/testdata/vars.java.c.golden +++ b/bind/testdata/vars.java.c.golden @@ -15,175 +15,175 @@ jclass proxy_class_vars_S; jmethodID proxy_class_vars_S_cons; JNIEXPORT void JNICALL -Java_go_vars_Vars__1init(JNIEnv *env, jclass _unused) { +Java_vars_Vars__1init(JNIEnv *env, jclass _unused) { jclass clazz; - clazz = (*env)->FindClass(env, "go/vars/S"); + clazz = (*env)->FindClass(env, "vars/S"); proxy_class_vars_S = (*env)->NewGlobalRef(env, clazz); proxy_class_vars_S_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/vars/Vars$proxyI"); + clazz = (*env)->FindClass(env, "vars/Vars$proxyI"); proxy_class_vars_I = (*env)->NewGlobalRef(env, clazz); proxy_class_vars_I_cons = (*env)->GetMethodID(env, clazz, "", "(Lgo/Seq$Ref;)V"); - clazz = (*env)->FindClass(env, "go/vars/I"); + clazz = (*env)->FindClass(env, "vars/I"); } JNIEXPORT jobject JNICALL -Java_go_vars_S__1_1New(JNIEnv *env, jclass clazz) { +Java_vars_S__1_1New(JNIEnv *env, jclass clazz) { int32_t refnum = new_vars_S(); return go_seq_from_refnum(env, refnum, NULL, NULL); } JNIEXPORT void JNICALL -Java_go_vars_Vars_setABool(JNIEnv *env, jclass clazz, jboolean v) { +Java_vars_Vars_setABool(JNIEnv *env, jclass clazz, jboolean v) { char _v = (char)v; var_setvars_ABool(_v); } JNIEXPORT jboolean JNICALL -Java_go_vars_Vars_getABool(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getABool(JNIEnv *env, jclass clazz) { char r0 = var_getvars_ABool(); jboolean _r0 = r0 ? JNI_TRUE : JNI_FALSE; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAFloat(JNIEnv *env, jclass clazz, jdouble v) { +Java_vars_Vars_setAFloat(JNIEnv *env, jclass clazz, jdouble v) { double _v = (double)v; var_setvars_AFloat(_v); } JNIEXPORT jdouble JNICALL -Java_go_vars_Vars_getAFloat(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAFloat(JNIEnv *env, jclass clazz) { double r0 = var_getvars_AFloat(); jdouble _r0 = (jdouble)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAFloat32(JNIEnv *env, jclass clazz, jfloat v) { +Java_vars_Vars_setAFloat32(JNIEnv *env, jclass clazz, jfloat v) { float _v = (float)v; var_setvars_AFloat32(_v); } JNIEXPORT jfloat JNICALL -Java_go_vars_Vars_getAFloat32(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAFloat32(JNIEnv *env, jclass clazz) { float r0 = var_getvars_AFloat32(); jfloat _r0 = (jfloat)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAFloat64(JNIEnv *env, jclass clazz, jdouble v) { +Java_vars_Vars_setAFloat64(JNIEnv *env, jclass clazz, jdouble v) { double _v = (double)v; var_setvars_AFloat64(_v); } JNIEXPORT jdouble JNICALL -Java_go_vars_Vars_getAFloat64(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAFloat64(JNIEnv *env, jclass clazz) { double r0 = var_getvars_AFloat64(); jdouble _r0 = (jdouble)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAString(JNIEnv *env, jclass clazz, jstring v) { +Java_vars_Vars_setAString(JNIEnv *env, jclass clazz, jstring v) { nstring _v = go_seq_from_java_string(env, v); var_setvars_AString(_v); } JNIEXPORT jstring JNICALL -Java_go_vars_Vars_getAString(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAString(JNIEnv *env, jclass clazz) { nstring r0 = var_getvars_AString(); jstring _r0 = go_seq_to_java_string(env, r0); return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAStructPtr(JNIEnv *env, jclass clazz, jobject v) { +Java_vars_Vars_setAStructPtr(JNIEnv *env, jclass clazz, jobject v) { int32_t _v = go_seq_to_refnum(env, v); var_setvars_AStructPtr(_v); } JNIEXPORT jobject JNICALL -Java_go_vars_Vars_getAStructPtr(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAStructPtr(JNIEnv *env, jclass clazz) { int32_t r0 = var_getvars_AStructPtr(); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_vars_S, proxy_class_vars_S_cons); return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInt(JNIEnv *env, jclass clazz, jlong v) { +Java_vars_Vars_setAnInt(JNIEnv *env, jclass clazz, jlong v) { nint _v = (nint)v; var_setvars_AnInt(_v); } JNIEXPORT jlong JNICALL -Java_go_vars_Vars_getAnInt(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInt(JNIEnv *env, jclass clazz) { nint r0 = var_getvars_AnInt(); jlong _r0 = (jlong)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInt16(JNIEnv *env, jclass clazz, jshort v) { +Java_vars_Vars_setAnInt16(JNIEnv *env, jclass clazz, jshort v) { int16_t _v = (int16_t)v; var_setvars_AnInt16(_v); } JNIEXPORT jshort JNICALL -Java_go_vars_Vars_getAnInt16(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInt16(JNIEnv *env, jclass clazz) { int16_t r0 = var_getvars_AnInt16(); jshort _r0 = (jshort)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInt32(JNIEnv *env, jclass clazz, jint v) { +Java_vars_Vars_setAnInt32(JNIEnv *env, jclass clazz, jint v) { int32_t _v = (int32_t)v; var_setvars_AnInt32(_v); } JNIEXPORT jint JNICALL -Java_go_vars_Vars_getAnInt32(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInt32(JNIEnv *env, jclass clazz) { int32_t r0 = var_getvars_AnInt32(); jint _r0 = (jint)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInt64(JNIEnv *env, jclass clazz, jlong v) { +Java_vars_Vars_setAnInt64(JNIEnv *env, jclass clazz, jlong v) { int64_t _v = (int64_t)v; var_setvars_AnInt64(_v); } JNIEXPORT jlong JNICALL -Java_go_vars_Vars_getAnInt64(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInt64(JNIEnv *env, jclass clazz) { int64_t r0 = var_getvars_AnInt64(); jlong _r0 = (jlong)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInt8(JNIEnv *env, jclass clazz, jbyte v) { +Java_vars_Vars_setAnInt8(JNIEnv *env, jclass clazz, jbyte v) { int8_t _v = (int8_t)v; var_setvars_AnInt8(_v); } JNIEXPORT jbyte JNICALL -Java_go_vars_Vars_getAnInt8(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInt8(JNIEnv *env, jclass clazz) { int8_t r0 = var_getvars_AnInt8(); jbyte _r0 = (jbyte)r0; return _r0; } JNIEXPORT void JNICALL -Java_go_vars_Vars_setAnInterface(JNIEnv *env, jclass clazz, jobject v) { +Java_vars_Vars_setAnInterface(JNIEnv *env, jclass clazz, jobject v) { int32_t _v = go_seq_to_refnum(env, v); var_setvars_AnInterface(_v); } JNIEXPORT jobject JNICALL -Java_go_vars_Vars_getAnInterface(JNIEnv *env, jclass clazz) { +Java_vars_Vars_getAnInterface(JNIEnv *env, jclass clazz) { int32_t r0 = var_getvars_AnInterface(); jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_vars_I, proxy_class_vars_I_cons); return _r0; diff --git a/bind/testdata/vars.java.golden b/bind/testdata/vars.java.golden index 27450df..2e6b49d 100644 --- a/bind/testdata/vars.java.golden +++ b/bind/testdata/vars.java.golden @@ -1,8 +1,8 @@ -// Java class go.vars.S is a proxy for talking to a Go program. +// Java class vars.S is a proxy for talking to a Go program. // gobind -lang=java vars // // File is generated by gobind. Do not edit. -package go.vars; +package vars; import go.Seq; @@ -42,11 +42,11 @@ public final class S implements Seq.Proxy, I { } } -// Java class go.vars.I is a proxy for talking to a Go program. +// Java class vars.I is a proxy for talking to a Go program. // gobind -lang=java vars // // File is generated by gobind. Do not edit. -package go.vars; +package vars; import go.Seq; @@ -54,11 +54,11 @@ public interface I { } -// Java class go.vars.Vars is a proxy for talking to a Go program. +// Java class vars.Vars is a proxy for talking to a Go program. // gobind -lang=java vars // // File is generated by gobind. Do not edit. -package go.vars; +package vars; import go.Seq; diff --git a/bind/testpkg/javapkg/classes.go b/bind/testpkg/javapkg/classes.go index f18b920..5ce80ca 100644 --- a/bind/testpkg/javapkg/classes.go +++ b/bind/testpkg/javapkg/classes.go @@ -7,7 +7,6 @@ package javapkg import ( - gopkg "Java/go/javapkg" "Java/java/beans" "Java/java/io" "Java/java/io/IOException" @@ -19,6 +18,7 @@ import ( "Java/java/net" "Java/java/util" "Java/java/util/concurrent" + gopkg "Java/javapkg" xnet "Java/javax/net" ) diff --git a/cmd/gobind/main.go b/cmd/gobind/main.go index 86f02d3..ef42cd1 100644 --- a/cmd/gobind/main.go +++ b/cmd/gobind/main.go @@ -25,8 +25,8 @@ import ( var ( lang = flag.String("lang", "java", "target language for bindings, either java, go, or objc (experimental).") outdir = flag.String("outdir", "", "result will be written to the directory instead of stdout.") - javaPkg = flag.String("javapkg", "", "custom Java package path prefix used instead of the default 'go'. Valid only with -lang=java.") - prefix = flag.String("prefix", "", "custom Objective-C name prefix used instead of the default 'Go'. Valid only with -lang=objc.") + javaPkg = flag.String("javapkg", "", "custom Java package path prefix. Valid only with -lang=java.") + prefix = flag.String("prefix", "", "custom Objective-C name prefix. Valid only with -lang=objc.") bootclasspath = flag.String("bootclasspath", "", "Java bootstrap classpath.") classpath = flag.String("classpath", "", "Java classpath.") ) @@ -60,17 +60,10 @@ func main() { log.Fatal(err) } if len(refs.Refs) > 0 { - pref := *javaPkg - if pref == "" { - pref = "go" - } - if pref != "" { - pref = pref + "." - } imp := &java.Importer{ Bootclasspath: *bootclasspath, Classpath: *classpath, - JavaPkgPrefix: pref, + JavaPkg: *javaPkg, } classes, err = imp.Import(refs) if err != nil { @@ -84,7 +77,11 @@ func main() { defer os.RemoveAll(tmpGopath) var genNames []string for _, emb := range refs.Embedders { - genNames = append(genNames, pref+emb.Pkg+"."+emb.Name) + n := emb.Pkg + "." + emb.Name + if *javaPkg != "" { + n = *javaPkg + "." + n + } + genNames = append(genNames, n) } if err := genJavaPackages(ctx, tmpGopath, classes, genNames); err != nil { log.Fatal(err) diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index 9bef68a..e9a685b 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -149,9 +149,9 @@ var ( func init() { // bind command specific commands. cmdBind.flag.StringVar(&bindJavaPkg, "javapkg", "", - "specifies custom Java package path prefix used instead of the default 'go'. Valid only with -target=android.") + "specifies custom Java package path prefix. Valid only with -target=android.") cmdBind.flag.StringVar(&bindPrefix, "prefix", "", - "custom Objective-C name prefix used instead of the default 'Go'. Valid only with -target=ios.") + "custom Objective-C name prefix. Valid only with -target=ios.") cmdBind.flag.StringVar(&bindClasspath, "classpath", "", "The classpath for imported Java classes. Valid only with -target=android.") cmdBind.flag.StringVar(&bindBootClasspath, "bootclasspath", "", "The bootstrap classpath for imported Java classes. Valid only with -target=android.") } @@ -391,17 +391,10 @@ func GenClasses(pkgs []*build.Package, srcDir, jpkgSrc string) ([]*java.Class, e if err != nil { return nil, err } - pref := bindJavaPkg - if pref == "" { - pref = "go" - } - if pref != "" { - pref = pref + "." - } imp := &java.Importer{ Bootclasspath: bClspath, Classpath: bindClasspath, - JavaPkgPrefix: pref, + JavaPkg: bindJavaPkg, } classes, err := imp.Import(refs) if err != nil { @@ -416,7 +409,11 @@ func GenClasses(pkgs []*build.Package, srcDir, jpkgSrc string) ([]*java.Class, e } var genNames []string for _, emb := range refs.Embedders { - genNames = append(genNames, pref+emb.Pkg+"."+emb.Name) + n := emb.Pkg + "." + emb.Name + if bindJavaPkg != "" { + n = bindJavaPkg + "." + n + } + genNames = append(genNames, n) } g.Init(classes, genNames) for i, jpkg := range g.Packages() { @@ -495,12 +492,10 @@ func (b *binder) GenJava(pkg *types.Package, allPkg []*types.Package, classes [] var className string pkgName := "" pkgPath := "" - javaPkg := "" if pkg != nil { className = strings.Title(pkg.Name()) pkgName = pkg.Name() pkgPath = pkg.Path() - javaPkg = bindJavaPkg } else { pkgName = "universe" className = "Universe" @@ -509,13 +504,13 @@ func (b *binder) GenJava(pkg *types.Package, allPkg []*types.Package, classes [] cFile := filepath.Join(outdir, "java_"+pkgName+".c") hFile := filepath.Join(outdir, pkgName+".h") bindOption := "-lang=java" - if javaPkg != "" { - bindOption += " -javapkg=" + javaPkg + if bindJavaPkg != "" { + bindOption += " -javapkg=" + bindJavaPkg } var buf bytes.Buffer g := &bind.JavaGen{ - JavaPkg: javaPkg, + JavaPkg: bindJavaPkg, Generator: &bind.Generator{ Printer: &bind.Printer{Buf: &buf, IndentEach: []byte(" ")}, Fset: b.fset, diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index 4f19be6..61bfe07 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -45,7 +45,7 @@ func TestBindAndroid(t *testing.T) { }{ { wantGobind: "gobind -lang=java", - wantPkgDir: "go/asset", + wantPkgDir: "asset", }, { javaPkg: "com.example.foo", @@ -121,7 +121,7 @@ mkdir -p $WORK/android/src/main/java/{{.JavaPkgDir}} mkdir -p $WORK/gomobile_bind mkdir -p $WORK/gomobile_bind mkdir -p $WORK/android/src/main/java/go -gobind -lang=java -outdir=$WORK/android/src/main/java/go +{{.GobindJavaCmd}} -outdir=$WORK/android/src/main/java/go mkdir -p $WORK/android/src/main/java/go mkdir -p $WORK/gomobile_bind mkdir -p $WORK/gomobile_bind diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go index bdf942f..000a95f 100644 --- a/cmd/gomobile/doc.go +++ b/cmd/gomobile/doc.go @@ -56,7 +56,7 @@ the module import wizard (File > New > New Module > Import .JAR or (version 1.7+) and Android SDK (API level 15 or newer) to build the library for Android. The environment variable ANDROID_HOME must be set to the path to Android SDK. The generated Java class is in the java -package 'go.' unless -javapkg flag is specified. +package '' unless -javapkg flag is specified. By default, -target=android builds shared libraries for all supported instruction sets (arm, arm64, 386, amd64). A subset of instruction sets @@ -64,8 +64,8 @@ can be selected by specifying target type with the architecture name. E.g., -target=android/arm,android/386. For -target ios, gomobile must be run on an OS X machine with Xcode -installed. Support is not complete. The generated Objective-C types -are prefixed with 'Go' unless the -prefix flag is provided. +installed. Support is not complete. The -prefix flag can be used to prefix +the names of generated Objective-C types. The -v flag provides verbose output, including the list of packages built. diff --git a/example/bind/android/app/src/main/java/org/golang/example/bind/MainActivity.java b/example/bind/android/app/src/main/java/org/golang/example/bind/MainActivity.java index 98d273d..47248d9 100644 --- a/example/bind/android/app/src/main/java/org/golang/example/bind/MainActivity.java +++ b/example/bind/android/app/src/main/java/org/golang/example/bind/MainActivity.java @@ -10,8 +10,7 @@ import android.app.Activity; import android.os.Bundle; import android.widget.TextView; -import go.hello.Hello; - +import hello.Hello; public class MainActivity extends Activity { diff --git a/example/ivy/android/build.gradle b/example/ivy/android/build.gradle index a6fcfe1..b193299 100644 --- a/example/ivy/android/build.gradle +++ b/example/ivy/android/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' + classpath 'com.android.tools.build:gradle:2.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/example/reverse/android/src/main/AndroidManifest.xml b/example/reverse/android/src/main/AndroidManifest.xml index 0704280..21604d8 100644 --- a/example/reverse/android/src/main/AndroidManifest.xml +++ b/example/reverse/android/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> + package="reverse" > diff --git a/example/reverse/android/src/main/res/layout/activity_main.xml b/example/reverse/android/src/main/res/layout/activity_main.xml index e7aaba2..ee94e47 100644 --- a/example/reverse/android/src/main/res/layout/activity_main.xml +++ b/example/reverse/android/src/main/res/layout/activity_main.xml @@ -4,7 +4,7 @@ - +