From 2f75be449fbada35ca42f481f9878ba7f02a7e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Sun, 4 Sep 2016 23:37:26 +0300 Subject: [PATCH] bind: use lowercase method names for Java binds There was a discussion a year ago about making methods and types lowercase in ObjC (https://github.com/golang/go/issues/12889), which was done (https://go-review.googlesource.com/#/c/15780/), alas the suggested Java lower casing was never addressed. This CL converts all generated Java methods to lower case. Change-Id: Ia2f28519bc59362877881636109ddfc651b24960 Reviewed-on: https://go-review.googlesource.com/28494 Reviewed-by: Elias Naur Reviewed-by: David Crawshaw --- bind/bind_test.go | 1 + bind/genjava.go | 81 ++- bind/java/CustomPkgTest.java | 2 +- bind/java/Seq.java | 4 +- bind/java/SeqBench.java | 58 +- bind/java/SeqTest.java | 209 +++--- bind/testdata/basictypes.java.c.golden | 12 +- bind/testdata/basictypes.java.golden | 14 +- bind/testdata/customprefix.java.c.golden | 4 +- bind/testdata/customprefix.java.golden | 6 +- bind/testdata/ignore.java.c.golden | 2 +- bind/testdata/ignore.java.golden | 4 +- bind/testdata/interfaces.java.c.golden | 44 +- bind/testdata/interfaces.java.golden | 46 +- bind/testdata/issue10788.java.c.golden | 10 +- bind/testdata/issue10788.java.golden | 12 +- bind/testdata/issue12328.java.c.golden | 2 +- bind/testdata/issue12328.java.golden | 4 +- bind/testdata/issue12403.java.c.golden | 10 +- bind/testdata/issue12403.java.golden | 12 +- bind/testdata/keywords.go | 61 ++ bind/testdata/keywords.go.golden | 609 +++++++++++++++++ bind/testdata/keywords.java.c.golden | 819 +++++++++++++++++++++++ bind/testdata/keywords.java.golden | 146 ++++ bind/testdata/keywords.java.h.golden | 120 ++++ bind/testdata/keywords.objc.go.h.golden | 117 ++++ bind/testdata/keywords.objc.h.golden | 133 ++++ bind/testdata/keywords.objc.m.golden | 664 ++++++++++++++++++ bind/testdata/structs.java.c.golden | 18 +- bind/testdata/structs.java.golden | 22 +- bind/testdata/try.java.c.golden | 4 +- bind/testdata/try.java.golden | 6 +- bind/testdata/vars.java.c.golden | 2 +- bind/testdata/vars.java.golden | 4 +- bind/testpkg/testpkg.go | 10 + 35 files changed, 2990 insertions(+), 282 deletions(-) create mode 100644 bind/testdata/keywords.go create mode 100644 bind/testdata/keywords.go.golden create mode 100644 bind/testdata/keywords.java.c.golden create mode 100644 bind/testdata/keywords.java.golden create mode 100644 bind/testdata/keywords.java.h.golden create mode 100644 bind/testdata/keywords.objc.go.h.golden create mode 100644 bind/testdata/keywords.objc.h.golden create mode 100644 bind/testdata/keywords.objc.m.golden diff --git a/bind/bind_test.go b/bind/bind_test.go index afbdaf7..4f8a825 100644 --- a/bind/bind_test.go +++ b/bind/bind_test.go @@ -31,6 +31,7 @@ var tests = []string{ "testdata/issue10788.go", "testdata/issue12328.go", "testdata/issue12403.go", + "testdata/keywords.go", "testdata/try.go", "testdata/vars.go", "testdata/ignore.go", diff --git a/bind/genjava.go b/bind/genjava.go index 58e9c23..bf9f77d 100644 --- a/bind/genjava.go +++ b/bind/genjava.go @@ -147,7 +147,7 @@ func (g *JavaGen) genStruct(obj *types.TypeName, T *types.Struct) { g.Printf("@Override public String toString() {\n") g.Indent() if isStringer { - g.Printf("return String();\n") + g.Printf("return string();\n") } else { g.Printf("StringBuilder b = new StringBuilder();\n") g.Printf(`b.append("%s").append("{");`, obj.Name()) @@ -375,7 +375,11 @@ func (g *JavaGen) genJNIFuncSignature(o *types.Func, sName string, proxy bool) { } else { g.Printf(g.className()) } - g.Printf("_%s(JNIEnv* env, ", o.Name()) + oName := javaNameReplacer.Replace(lowerFirst(o.Name())) + if strings.HasSuffix(oName, "_") { + oName += "1" // JNI doesn't like methods ending with underscore, needs the _1 suffixing + } + g.Printf("_%s(JNIEnv* env, ", oName) if sName != "" { g.Printf("jobject this") } else { @@ -431,8 +435,7 @@ func (g *JavaGen) genFuncSignature(o *types.Func, static, header bool) { if !header { g.Printf("native ") } - oName := o.Name() - g.Printf("%s %s(", ret, oName) + g.Printf("%s %s(", ret, javaNameReplacer.Replace(lowerFirst(o.Name()))) params := sig.Params() for i := 0; i < params.Len(); i++ { if i > 0 { @@ -561,33 +564,51 @@ func (g *JavaGen) gobindOpts() string { return strings.Join(opts, " ") } -var javaNameReplacer = strings.NewReplacer( - "-", "_", - ".", "_", -) +var javaKeywordsAndReserves = []string{ + "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", + "class", "const", "continue", "default", "do", "double", "else", "enum", + "extends", "final", "finally", "float", "for", "goto", "if", "implements", + "import", "instanceof", "int", "interface", "long", "native", "new", "package", + "private", "protected", "public", "return", "short", "static", "strictfp", + "super", "switch", "synchronized", "this", "throw", "throws", "transient", + "try", "void", "volatile", "while", "false", "null", "true"} + +// javaNameSanitizer replaces all dashes and dots with underscores, as well as +// avoiding all keywords and reserved words by suffixing such identifier with +// an underscore. +type javaNameSanitizer struct { + symbols *strings.Replacer + reserved map[string]bool +} + +func newJavaNameSanitizer() *javaNameSanitizer { + reserved := make(map[string]bool) + for _, word := range javaKeywordsAndReserves { + reserved[word] = true + } + return &javaNameSanitizer{ + symbols: strings.NewReplacer( + "-", "_", + ".", "_", + ), + reserved: reserved, + } +} + +func (r *javaNameSanitizer) Replace(s string) string { + if r.reserved[s] { + return s + "_" + } + return r.symbols.Replace(s) +} + +var javaNameReplacer = newJavaNameSanitizer() func (g *JavaGen) javaPkgName(pkg *types.Package) string { if pkg == nil { return "go" } s := javaNameReplacer.Replace(pkg.Name()) - // Look for Java keywords that are not Go keywords, and avoid using - // them as a package name. - // - // This is not a problem for normal Go identifiers as we only expose - // exported symbols. The upper case first letter saves everything - // from accidentally matching except for the package name. - // - // Note that basic type names (like int) are not keywords in Go. - switch s { - case "abstract", "assert", "boolean", "byte", "catch", "char", "class", - "do", "double", "enum", "extends", "final", "finally", "float", - "implements", "instanceof", "int", "long", "native", "private", - "protected", "public", "short", "static", "strictfp", "super", - "synchronized", "this", "throw", "throws", "transient", "try", - "void", "volatile", "while": - s += "_" - } if g.JavaPkg != "" { return g.JavaPkg + "." + s } else { @@ -603,7 +624,7 @@ func className(pkg *types.Package) string { if pkg == nil { return "Universe" } - return strings.Title(javaNameReplacer.Replace(pkg.Name())) + return javaNameReplacer.Replace(strings.Title(pkg.Name())) } func (g *JavaGen) genConst(o *types.Const) { @@ -994,7 +1015,7 @@ func (g *JavaGen) GenC() error { } g.Printf("\n") g.Printf("JNIEXPORT void JNICALL\n") - g.Printf("Java_%s_%s_init(JNIEnv *env, jclass _unused) {\n", g.jniPkgName(), g.className()) + g.Printf("Java_%s_%s__1init(JNIEnv *env, jclass _unused) {\n", g.jniPkgName(), g.className()) g.Indent() g.Printf("jclass clazz;\n") for _, s := range g.structs { @@ -1027,7 +1048,7 @@ func (g *JavaGen) GenC() error { jniParams += g.jniSigType(params.At(i).Type()) } g.Printf("mid_%s_%s = (*env)->GetMethodID(env, clazz, %q, \"(%s)%s\");\n", - iface.obj.Name(), m.Name(), m.Name(), jniParams, retSig) + iface.obj.Name(), m.Name(), javaNameReplacer.Replace(lowerFirst(m.Name())), jniParams, retSig) } g.Printf("\n") } @@ -1079,13 +1100,13 @@ func (g *JavaGen) GenJava() error { } } } - g.Printf("init();\n") + g.Printf("_init();\n") g.Outdent() g.Printf("}\n\n") g.Printf("private %s() {} // uninstantiable\n\n", g.className()) g.Printf("// touch is called from other bound packages to initialize this package\n") g.Printf("public static void touch() {}\n\n") - g.Printf("private static native void init();\n\n") + g.Printf("private static native void _init();\n\n") for _, iface := range g.interfaces { g.Printf(javaProxyPreamble, iface.obj.Name()) diff --git a/bind/java/CustomPkgTest.java b/bind/java/CustomPkgTest.java index 5dd6abc..4143025 100644 --- a/bind/java/CustomPkgTest.java +++ b/bind/java/CustomPkgTest.java @@ -10,6 +10,6 @@ import org.golang.custompkg.testpkg.Testpkg; public class CustomPkgTest extends InstrumentationTestCase { public void testHi() { - Testpkg.Hi(); + Testpkg.hi(); } } diff --git a/bind/java/Seq.java b/bind/java/Seq.java index 40012c7..3d26c8d 100644 --- a/bind/java/Seq.java +++ b/bind/java/Seq.java @@ -49,12 +49,12 @@ public class Seq { } private static void throwException(error err) throws Exception { - throw new Exception(err.Error()); + throw new Exception(err.error()); } private static error wrapThrowable(final Throwable t) { return new error() { - @Override public String Error() { + @Override public String error() { return t.getMessage(); } }; diff --git a/bind/java/SeqBench.java b/bind/java/SeqBench.java index d06964d..1377701 100644 --- a/bind/java/SeqBench.java +++ b/bind/java/SeqBench.java @@ -18,7 +18,7 @@ import go.benchmark.*; public class SeqBench extends InstrumentationTestCase { public static class AnI implements I { - @Override public void F() { + @Override public void f() { } } @@ -34,81 +34,81 @@ public class SeqBench extends InstrumentationTestCase { }); benchmarks.put("Noargs", new Runnable() { @Override public void run() { - Benchmark.Noargs(); + Benchmark.noargs(); } }); benchmarks.put("Onearg", new Runnable() { @Override public void run() { - Benchmark.Onearg(0); + Benchmark.onearg(0); } }); benchmarks.put("Manyargs", new Runnable() { @Override public void run() { - Benchmark.Manyargs(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + Benchmark.manyargs(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } }); benchmarks.put("Oneret", new Runnable() { @Override public void run() { - Benchmark.Oneret(); + Benchmark.oneret(); } }); final I javaRef = new AnI(); benchmarks.put("Refforeign", new Runnable() { @Override public void run() { - Benchmark.Ref(javaRef); + Benchmark.ref(javaRef); } }); - final I goRef = Benchmark.NewI(); + final I goRef = Benchmark.newI(); benchmarks.put("Refgo", new Runnable() { @Override public void run() { - Benchmark.Ref(goRef); + Benchmark.ref(goRef); } }); benchmarks.put("StringShort", new Runnable() { @Override public void run() { - Benchmark.String(Benchmark.ShortString); + Benchmark.string(Benchmark.ShortString); } }); benchmarks.put("StringLong", new Runnable() { @Override public void run() { - Benchmark.String(Benchmark.LongString); + Benchmark.string(Benchmark.LongString); } }); benchmarks.put("StringShortUnicode", new Runnable() { @Override public void run() { - Benchmark.String(Benchmark.ShortStringUnicode); + Benchmark.string(Benchmark.ShortStringUnicode); } }); benchmarks.put("StringLongUnicode", new Runnable() { @Override public void run() { - Benchmark.String(Benchmark.LongStringUnicode); + Benchmark.string(Benchmark.LongStringUnicode); } }); benchmarks.put("StringRetShort", new Runnable() { @Override public void run() { - Benchmark.StringRetShort(); + Benchmark.stringRetShort(); } }); benchmarks.put("StringRetLong", new Runnable() { @Override public void run() { - Benchmark.StringRetLong(); + Benchmark.stringRetLong(); } }); final byte[] shortSlice = Benchmark.getShortSlice(); benchmarks.put("SliceShort", new Runnable() { @Override public void run() { - Benchmark.Slice(shortSlice); + Benchmark.slice(shortSlice); } }); final byte[] longSlice = Benchmark.getLongSlice(); benchmarks.put("SliceLong", new Runnable() { @Override public void run() { - Benchmark.Slice(longSlice); + Benchmark.slice(longSlice); } }); } - public void RunDirect(String name, final long n) { + public void runDirect(String name, final long n) { final Runnable r = benchmarks.get(name); try { executor.submit(new Runnable() { @@ -123,40 +123,40 @@ public class SeqBench extends InstrumentationTestCase { } } - public void Run(String name, long n) { + public void run(String name, long n) { final Runnable r = benchmarks.get(name); for (int i = 0; i < n; i++) { r.run(); } } - @Override public I NewI() { + @Override public I newI() { return new AnI(); } - @Override public void Ref(I i) { + @Override public void ref(I i) { } - @Override public void Noargs() { + @Override public void noargs() { } - @Override public void Onearg(long i) { + @Override public void onearg(long i) { } - @Override public long Oneret() { + @Override public long oneret() { return 0; } - @Override public void Manyargs(long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long gp8, long p9) { + @Override public void manyargs(long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long gp8, long p9) { } - @Override public void String(String s) { + @Override public void string(String s) { } - @Override public void Slice(byte[] s) { + @Override public void slice(byte[] s) { } - @Override public String StringRetShort() { + @Override public String stringRetShort() { return Benchmark.ShortString; } - @Override public String StringRetLong() { + @Override public String stringRetLong() { return Benchmark.LongString; } } public void testBenchmark() { - Benchmark.RunBenchmarks(new Benchmarks()); + Benchmark.runBenchmarks(new Benchmarks()); } } diff --git a/bind/java/SeqTest.java b/bind/java/SeqTest.java index 340b93e..c81b682 100644 --- a/bind/java/SeqTest.java +++ b/bind/java/SeqTest.java @@ -64,45 +64,45 @@ public class SeqTest extends InstrumentationTestCase { assertEquals("var IntVar", newIntVar, Testpkg.getIntVar()); S s0 = Testpkg.getStructVar(); - assertEquals("var StructVar", "a struct var", s0.String()); - S s1 = Testpkg.New(); + assertEquals("var StructVar", "a struct var", s0.string()); + S s1 = Testpkg.new_(); Testpkg.setStructVar(s1); - assertEquals("var StructVar", s1.String(), Testpkg.getStructVar().String()); + assertEquals("var StructVar", s1.string(), Testpkg.getStructVar().string()); AnI obj = new AnI(); obj.name = "this is an I"; Testpkg.setInterfaceVar(obj); - assertEquals("var InterfaceVar", obj.String(), Testpkg.getInterfaceVar().String()); + assertEquals("var InterfaceVar", obj.string(), Testpkg.getInterfaceVar().string()); } public void testAssets() { // Make sure that a valid context is set before reading assets Seq.setContext(getInstrumentation().getContext()); String want = "Hello, Assets.\n"; - String got = Testpkg.ReadAsset(); + String got = Testpkg.readAsset(); assertEquals("Asset read", want, got); } public void testAdd() { - long res = Testpkg.Add(3, 4); + long res = Testpkg.add(3, 4); assertEquals("Unexpected arithmetic failure", 7, res); } public void testBool() { - assertTrue(Testpkg.Negate(false)); - assertFalse(Testpkg.Negate(true)); + assertTrue(Testpkg.negate(false)); + assertFalse(Testpkg.negate(true)); } public void testShortString() { String want = "a short string"; - String got = Testpkg.StrDup(want); + String got = Testpkg.strDup(want); assertEquals("Strings should match", want, got); want = ""; - got = Testpkg.StrDup(want); + got = Testpkg.strDup(want); assertEquals("Strings should match (empty string)", want, got); - got = Testpkg.StrDup(null); + got = Testpkg.strDup(null); assertEquals("Strings should match (null string)", want, got); } @@ -112,7 +112,7 @@ public class SeqTest extends InstrumentationTestCase { b.append("0123456789"); } String want = b.toString(); - String got = Testpkg.StrDup(want); + String got = Testpkg.strDup(want); assertEquals("Strings should match", want, got); } @@ -137,20 +137,20 @@ public class SeqTest extends InstrumentationTestCase { "\ufffd" }; for (int i = 0; i < tests.length; i++) { - String got = Testpkg.StrDup(tests[i]); + String got = Testpkg.strDup(tests[i]); String want = wants[i]; assertEquals("Strings should match", want, got); } } public void testNilErr() throws Exception { - Testpkg.Err(null); // returns nil, no exception + Testpkg.err(null); // returns nil, no exception } public void testErr() { String msg = "Go errors are dropped into the confusing space of exceptions"; try { - Testpkg.Err(msg); + Testpkg.err(msg); fail("expected non-nil error to be turned into an exception"); } catch (Exception e) { assertEquals("messages should match", msg, e.getMessage()); @@ -160,9 +160,9 @@ public class SeqTest extends InstrumentationTestCase { public void testByteArray() { for (int i = 0; i < 2048; i++) { if (i == 0) { - byte[] got = Testpkg.BytesAppend(null, null); + byte[] got = Testpkg.bytesAppend(null, null); assertEquals("Bytes(null+null) should match", (byte[])null, got); - got = Testpkg.BytesAppend(new byte[0], new byte[0]); + got = Testpkg.bytesAppend(new byte[0], new byte[0]); assertEquals("Bytes(empty+empty) should match", (byte[])null, got); continue; } @@ -178,7 +178,7 @@ public class SeqTest extends InstrumentationTestCase { if (i > 1) { s2 = Arrays.copyOfRange(want, 1, i); } - byte[] got = Testpkg.BytesAppend(s1, s2); + byte[] got = Testpkg.bytesAppend(s1, s2); MoreAsserts.assertEquals("Bytes(len="+i+") should match", want, got); } } @@ -191,7 +191,7 @@ public class SeqTest extends InstrumentationTestCase { } String stuff = "stuff"; - byte[] got = Testpkg.AppendToString(stuff, bytes); + byte[] got = Testpkg.appendToString(stuff, bytes); try { byte[] s = stuff.getBytes("UTF-8"); @@ -205,50 +205,50 @@ public class SeqTest extends InstrumentationTestCase { } public void testGoRefGC() { - S s = Testpkg.New(); + S s = Testpkg.new_(); runGC(); - long collected = Testpkg.NumSCollected(); + long collected = Testpkg.numSCollected(); assertEquals("Only S should be pinned", 0, collected); s = null; runGC(); - collected = Testpkg.NumSCollected(); + collected = Testpkg.numSCollected(); assertEquals("S should be collected", 1, collected); } private class AnI implements I { - public void E() throws Exception { + public void e() throws Exception { throw new Exception("my exception from E"); } boolean calledF; - public void F() { + public void f() { calledF = true; } - public I I() { + public I i() { return this; } - public S S() { - return Testpkg.New(); + public S s() { + return Testpkg.new_(); } - public String StoString(S s) { - return s.String(); + public String stoString(S s) { + return s.string(); } - public long V() { + public long v() { return 1234; } - public long VE() throws Exception { + public long ve() throws Exception { throw new Exception("my exception from VE"); } public String name; - public String String() { + public String string() { return name; } @@ -259,7 +259,7 @@ public class SeqTest extends InstrumentationTestCase { public void testInterfaceMethodReturnsError() { final AnI obj = new AnI(); try { - Testpkg.CallE(obj); + Testpkg.callE(obj); fail("Expecting exception but none was thrown."); } catch (Exception e) { assertEquals("Error messages should match", "my exception from E", e.getMessage()); @@ -268,47 +268,47 @@ public class SeqTest extends InstrumentationTestCase { public void testInterfaceMethodVoid() { final AnI obj = new AnI(); - Testpkg.CallF(obj); + Testpkg.callF(obj); assertTrue("Want AnI.F to be called", obj.calledF); } public void testInterfaceMethodReturnsInterface() { AnI obj = new AnI(); obj.name = "testing AnI.I"; - I i = Testpkg.CallI(obj); - assertEquals("Want AnI.I to return itself", i.String(), obj.String()); + I i = Testpkg.callI(obj); + assertEquals("Want AnI.I to return itself", i.string(), obj.string()); runGC(); - i = Testpkg.CallI(obj); - assertEquals("Want AnI.I to return itself", i.String(), obj.String()); + i = Testpkg.callI(obj); + assertEquals("Want AnI.I to return itself", i.string(), obj.string()); } public void testInterfaceMethodReturnsStructPointer() { final AnI obj = new AnI(); for (int i = 0; i < 5; i++) { - S s = Testpkg.CallS(obj); - runGC(); + S s = Testpkg.callS(obj); + runGC(); } } public void testInterfaceMethodTakesStructPointer() { final AnI obj = new AnI(); - S s = Testpkg.CallS(obj); - String got = obj.StoString(s); - String want = s.String(); + S s = Testpkg.callS(obj); + String got = obj.stoString(s); + String want = s.string(); assertEquals("Want AnI.StoString(s) to call s's String", want, got); } public void testInterfaceMethodReturnsInt() { final AnI obj = new AnI(); - assertEquals("Values must match", 1234, Testpkg.CallV(obj)); + assertEquals("Values must match", 1234, Testpkg.callV(obj)); } public void testInterfaceMethodReturnsIntOrError() { final AnI obj = new AnI(); try { - long v = Testpkg.CallVE(obj); + long v = Testpkg.callVE(obj); fail("Expecting exception but none was thrown and got value " + v); } catch (Exception e) { assertEquals("Error messages should match", "my exception from VE", e.getMessage()); @@ -328,9 +328,9 @@ public class SeqTest extends InstrumentationTestCase { public void testJavaRefGC() { finalizedAnI = false; AnI obj = new AnI_Traced(); - Testpkg.CallF(obj); + Testpkg.callF(obj); assertTrue("want F to be called", obj.calledF); - Testpkg.CallF(obj); + Testpkg.callF(obj); obj = null; runGC(); assertTrue("want obj to be collected", finalizedAnI); @@ -339,15 +339,15 @@ public class SeqTest extends InstrumentationTestCase { public void testJavaRefKeep() { finalizedAnI = false; AnI obj = new AnI_Traced(); - Testpkg.CallF(obj); - Testpkg.CallF(obj); + Testpkg.callF(obj); + Testpkg.callF(obj); obj = null; runGC(); assertTrue("want obj not to be kept by Go", finalizedAnI); finalizedAnI = false; obj = new AnI_Traced(); - Testpkg.Keep(obj); + Testpkg.keep(obj); obj = null; runGC(); assertFalse("want obj to be kept live by Go", finalizedAnI); @@ -356,35 +356,35 @@ public class SeqTest extends InstrumentationTestCase { private int countI = 0; private class CountI implements I { - public void F() { countI++; } + public void f() { countI++; } - public void E() throws Exception {} - public I I() { return null; } - public S S() { return null; } - public String StoString(S s) { return ""; } - public long V() { return 0; } - public long VE() throws Exception { return 0; } - public String String() { return ""; } + public void e() throws Exception {} + public I i() { return null; } + public S s() { return null; } + public String stoString(S s) { return ""; } + public long v() { return 0; } + public long ve() throws Exception { return 0; } + public String string() { return ""; } } public void testGoRefMapGrow() { CountI obj = new CountI(); - Testpkg.Keep(obj); + Testpkg.keep(obj); // Push active references beyond base map size. for (int i = 0; i < 24; i++) { CountI o = new CountI(); - Testpkg.CallF(o); + Testpkg.callF(o); if (i%3==0) { - Testpkg.Keep(o); + Testpkg.keep(o); } } runGC(); for (int i = 0; i < 128; i++) { - Testpkg.CallF(new CountI()); + Testpkg.callF(new CountI()); } - Testpkg.CallF(obj); // original object needs to work. + Testpkg.callF(obj); // original object needs to work. assertEquals(countI, 1+24+128); } @@ -392,7 +392,7 @@ public class SeqTest extends InstrumentationTestCase { private void runGC() { System.gc(); System.runFinalization(); - Testpkg.GC(); + Testpkg.gc(); System.gc(); System.runFinalization(); } @@ -400,24 +400,24 @@ public class SeqTest extends InstrumentationTestCase { public void testUnnamedParams() { final String msg = "1234567"; assertEquals("want the length of \"1234567\" passed after unnamed params", - 7, Testpkg.UnnamedParams(10, 20, msg)); + 7, Testpkg.unnamedParams(10, 20, msg)); } public void testPointerToStructAsField() { - Node a = Testpkg.NewNode("A"); - Node b = Testpkg.NewNode("B"); + Node a = Testpkg.newNode("A"); + Node b = Testpkg.newNode("B"); a.setNext(b); - String got = a.String(); + String got = a.string(); assertEquals("want Node A points to Node B", "A:B:", got); } public void testImplementsInterface() { - Interface intf = Testpkg.NewConcrete(); + Interface intf = Testpkg.newConcrete(); } public void testErrorField() { final String want = "an error message"; - Node n = Testpkg.NewNode("ErrTest"); + Node n = Testpkg.newNode("ErrTest"); n.setErr(want); String got = n.getErr(); assertEquals("want back the error message we set", want, got); @@ -425,28 +425,28 @@ public class SeqTest extends InstrumentationTestCase { //test if we have JNI local reference table overflow error public void testLocalReferenceOverflow() { - Testpkg.CallWithCallback(new GoCallback() { + Testpkg.callWithCallback(new GoCallback() { @Override - public void VarUpdate() { + public void varUpdate() { //do nothing } }); } public void testNullReferences() { - assertTrue(Testpkg.CallWithNull(null, new NullTest() { - public NullTest Null() { + assertTrue(Testpkg.callWithNull(null, new NullTest() { + public NullTest null_() { return null; } })); - assertEquals("Go nil interface is null", null, Testpkg.NewNullInterface()); - assertEquals("Go nil struct pointer is null", null, Testpkg.NewNullStruct()); + assertEquals("Go nil interface is null", null, Testpkg.newNullInterface()); + assertEquals("Go nil struct pointer is null", null, Testpkg.newNullStruct()); } public void testPassByteArray() { - Testpkg.PassByteArray(new B() { - @Override public void B(byte[] b) { + Testpkg.passByteArray(new B() { + @Override public void b(byte[] b) { byte[] want = new byte[]{1, 2, 3, 4}; MoreAsserts.assertEquals("bytes should match", want, b); } @@ -456,7 +456,7 @@ public class SeqTest extends InstrumentationTestCase { public void testReader() { byte[] b = new byte[8]; try { - long n = Testpkg.ReadIntoByteArray(b); + long n = Testpkg.readIntoByteArray(b); assertEquals("wrote to the entire byte array", b.length, n); byte[] want = new byte[b.length]; for (int i = 0; i < want.length; i++) @@ -468,72 +468,79 @@ public class SeqTest extends InstrumentationTestCase { } public void testGoroutineCallback() { - Testpkg.GoroutineCallback(new Receiver() { - @Override public void Hello(String msg) { + Testpkg.goroutineCallback(new Receiver() { + @Override public void hello(String msg) { } }); } public void testImportedPkg() { - Testpkg.CallImportedI(new go.secondpkg.I() { - @Override public long F(long i) { + Testpkg.callImportedI(new go.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(); + assertEquals("imported string should match", Secondpkg.HelloString, Secondpkg.hello()); + go.secondpkg.I i = Testpkg.newImportedI(); + go.secondpkg.S s = Testpkg.newImportedS(); i = Testpkg.getImportedVarI(); s = Testpkg.getImportedVarS(); - assertEquals("numbers should match", 8, i.F(8)); - assertEquals("numbers should match", 8, s.F(8)); + assertEquals("numbers should match", 8, i.f(8)); + assertEquals("numbers should match", 8, s.f(8)); Testpkg.setImportedVarI(i); Testpkg.setImportedVarS(s); - ImportedFields fields = Testpkg.NewImportedFields(); + ImportedFields fields = Testpkg.newImportedFields(); i = fields.getI(); s = fields.getS(); fields.setI(i); fields.setS(s); - Testpkg.WithImportedI(i); - Testpkg.WithImportedS(s); + Testpkg.withImportedI(i); + Testpkg.withImportedS(s); go.secondpkg.IF f = new AnI(); - f = Testpkg.New(); - go.secondpkg.Ser ser = Testpkg.NewSer(); + f = Testpkg.new_(); + go.secondpkg.Ser ser = Testpkg.newSer(); } public void testRoundtripEquality() { I want = new AnI(); - assertTrue("java object passed through Go should not be wrapped", want == Testpkg.IDup(want)); + assertTrue("java object passed through Go should not be wrapped", want == Testpkg.iDup(want)); InterfaceDupper idup = new InterfaceDupper(){ - @Override public Interface IDup(Interface i) { + @Override public Interface iDup(Interface i) { return i; } }; - assertTrue("Go interface passed through Java should not be wrapped", Testpkg.CallIDupper(idup)); + assertTrue("Go interface passed through Java should not be wrapped", Testpkg.callIDupper(idup)); ConcreteDupper cdup = new ConcreteDupper(){ - @Override public Concrete CDup(Concrete c) { + @Override public Concrete cDup(Concrete c) { return c; } }; - assertTrue("Go struct passed through Java should not be wrapped", Testpkg.CallCDupper(cdup)); + assertTrue("Go struct passed through Java should not be wrapped", Testpkg.callCDupper(cdup)); } public void testEmptyError() { try { - Testpkg.EmptyError(); + Testpkg.emptyError(); fail("Empty error wasn't caught"); } catch (Exception e) { } EmptyErrorer empty = new EmptyErrorer() { - @Override public void EmptyError() throws Exception { + @Override public void emptyError() throws Exception { throw new Exception(""); } }; try { - Testpkg.CallEmptyError(empty); + Testpkg.callEmptyError(empty); fail("Empty exception wasn't caught"); } catch (Exception e) { } } + + public void testInitCaller() { + Testpkg.init(); + + InitCaller initer = Testpkg.newInitCaller(); + initer.init(); + } } diff --git a/bind/testdata/basictypes.java.c.golden b/bind/testdata/basictypes.java.c.golden index 2688464..c645224 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_init(JNIEnv *env, jclass _unused) { +Java_go_basictypes_Basictypes__1init(JNIEnv *env, jclass _unused) { jclass clazz; } JNIEXPORT jboolean JNICALL -Java_go_basictypes_Basictypes_Bool(JNIEnv* env, jclass clazz, jboolean p0) { +Java_go_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_go_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass clazz, jbyteArray x) { nbyteslice _x = go_seq_from_java_bytearray(env, x, 0); nbyteslice r0 = proxybasictypes__ByteArrays(_x); if (_x.ptr != NULL) { @@ -35,14 +35,14 @@ Java_go_basictypes_Basictypes_ByteArrays(JNIEnv* env, jclass clazz, jbyteArray x } JNIEXPORT void JNICALL -Java_go_basictypes_Basictypes_Error(JNIEnv* env, jclass clazz) { +Java_go_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_go_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); @@ -51,7 +51,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_go_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 d8986a2..d6168fd 100644 --- a/bind/testdata/basictypes.java.golden +++ b/bind/testdata/basictypes.java.golden @@ -9,7 +9,7 @@ import go.Seq; public abstract class Basictypes { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Basictypes() {} // uninstantiable @@ -17,7 +17,7 @@ public abstract class Basictypes { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); public static final boolean ABool = true; @@ -28,9 +28,9 @@ public abstract class Basictypes { public static final long AnInt = 7L; public static final long AnInt2 = 9223372036854775807L; - public static native boolean Bool(boolean p0); - public static native byte[] ByteArrays(byte[] x); - public static native void Error() throws Exception; - public static native long ErrorPair() throws Exception; - public static native void Ints(byte x, short y, int z, long t, long u); + public static native boolean bool(boolean p0); + public static native byte[] byteArrays(byte[] x); + public static native void error() throws Exception; + public static native long errorPair() throws Exception; + public static native void ints(byte x, short y, int z, long t, long u); } diff --git a/bind/testdata/customprefix.java.c.golden b/bind/testdata/customprefix.java.c.golden index 456fcf7..f7036c3 100644 --- a/bind/testdata/customprefix.java.c.golden +++ b/bind/testdata/customprefix.java.c.golden @@ -11,12 +11,12 @@ JNIEXPORT void JNICALL -Java_com_example_customprefix_Customprefix_init(JNIEnv *env, jclass _unused) { +Java_com_example_customprefix_Customprefix__1init(JNIEnv *env, jclass _unused) { jclass clazz; } JNIEXPORT void JNICALL -Java_com_example_customprefix_Customprefix_F(JNIEnv* env, jclass clazz) { +Java_com_example_customprefix_Customprefix_f(JNIEnv* env, jclass clazz) { proxycustomprefix__F(); } diff --git a/bind/testdata/customprefix.java.golden b/bind/testdata/customprefix.java.golden index 05f2282..b9d4193 100644 --- a/bind/testdata/customprefix.java.golden +++ b/bind/testdata/customprefix.java.golden @@ -9,7 +9,7 @@ import go.Seq; public abstract class Customprefix { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Customprefix() {} // uninstantiable @@ -17,9 +17,9 @@ public abstract class Customprefix { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); - public static native void F(); + public static native void f(); } diff --git a/bind/testdata/ignore.java.c.golden b/bind/testdata/ignore.java.c.golden index 6ef3b36..7126ad2 100644 --- a/bind/testdata/ignore.java.c.golden +++ b/bind/testdata/ignore.java.c.golden @@ -19,7 +19,7 @@ jclass proxy_class_ignore_S; jmethodID proxy_class_ignore_S_cons; JNIEXPORT void JNICALL -Java_go_ignore_Ignore_init(JNIEnv *env, jclass _unused) { +Java_go_ignore_Ignore__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/ignore/S"); proxy_class_ignore_S = (*env)->NewGlobalRef(env, clazz); diff --git a/bind/testdata/ignore.java.golden b/bind/testdata/ignore.java.golden index 065b7d7..edc5c48 100644 --- a/bind/testdata/ignore.java.golden +++ b/bind/testdata/ignore.java.golden @@ -63,7 +63,7 @@ import go.Seq; public abstract class Ignore { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Ignore() {} // uninstantiable @@ -71,7 +71,7 @@ public abstract class Ignore { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyI extends Seq.Proxy implements I { proxyI(Seq.Ref ref) { super(ref); } diff --git a/bind/testdata/interfaces.java.c.golden b/bind/testdata/interfaces.java.c.golden index 444f86a..bef54fe 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_init(JNIEnv *env, jclass _unused) { +Java_go_interfaces_Interfaces__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/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"); - mid_Error_Err = (*env)->GetMethodID(env, clazz, "Err", "()V"); + mid_Error_Err = (*env)->GetMethodID(env, clazz, "err", "()V"); clazz = (*env)->FindClass(env, "go/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"); - mid_I_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I"); + mid_I_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I"); clazz = (*env)->FindClass(env, "go/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"); - mid_I1_J = (*env)->GetMethodID(env, clazz, "J", "()V"); + mid_I1_J = (*env)->GetMethodID(env, clazz, "j", "()V"); clazz = (*env)->FindClass(env, "go/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"); - mid_I2_G = (*env)->GetMethodID(env, clazz, "G", "()V"); + mid_I2_G = (*env)->GetMethodID(env, clazz, "g", "()V"); clazz = (*env)->FindClass(env, "go/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;"); + mid_I3_F = (*env)->GetMethodID(env, clazz, "f", "()Lgo/interfaces/I1;"); clazz = (*env)->FindClass(env, "go/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"); - mid_LargerI_AnotherFunc = (*env)->GetMethodID(env, clazz, "AnotherFunc", "()V"); - mid_LargerI_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I"); + 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"); 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"); - mid_SameI_Rand = (*env)->GetMethodID(env, clazz, "Rand", "()I"); + mid_SameI_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I"); clazz = (*env)->FindClass(env, "go/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"); - mid_WithParam_HasParam = (*env)->GetMethodID(env, clazz, "HasParam", "(Z)V"); + 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_go_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_go_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_go_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_go_interfaces_Interfaces_00024proxyError_err(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyI_rand(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyI1_j(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyI2_g(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyI3_f(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyLargerI_anotherFunc(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyLargerI_rand(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxySameI_rand(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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_go_interfaces_Interfaces_00024proxyWithParam_hasParam(JNIEnv* env, jobject this, jboolean p0) { int32_t o = go_seq_to_refnum(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 9d55c30..544f0e7 100644 --- a/bind/testdata/interfaces.java.golden +++ b/bind/testdata/interfaces.java.golden @@ -7,7 +7,7 @@ package go.interfaces; import go.Seq; public interface Error { - public void Err() throws Exception; + public void err() throws Exception; } @@ -20,7 +20,7 @@ package go.interfaces; import go.Seq; public interface I { - public int Rand(); + public int rand(); } @@ -33,7 +33,7 @@ package go.interfaces; import go.Seq; public interface I1 { - public void J(); + public void j(); } @@ -46,7 +46,7 @@ package go.interfaces; import go.Seq; public interface I2 { - public void G(); + public void g(); } @@ -59,7 +59,7 @@ package go.interfaces; import go.Seq; public interface I3 { - public I1 F(); + public I1 f(); } @@ -72,8 +72,8 @@ package go.interfaces; import go.Seq; public interface LargerI extends I, SameI { - public void AnotherFunc(); - public int Rand(); + public void anotherFunc(); + public int rand(); } @@ -86,7 +86,7 @@ package go.interfaces; import go.Seq; public interface SameI { - public int Rand(); + public int rand(); } @@ -99,7 +99,7 @@ package go.interfaces; import go.Seq; public interface WithParam { - public void HasParam(boolean p0); + public void hasParam(boolean p0); } @@ -114,7 +114,7 @@ import go.Seq; public abstract class Interfaces { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Interfaces() {} // uninstantiable @@ -122,52 +122,52 @@ public abstract class Interfaces { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyError extends Seq.Proxy implements Error { proxyError(Seq.Ref ref) { super(ref); } - public native void Err() throws Exception; + public native void err() throws Exception; } private static final class proxyI extends Seq.Proxy implements I { proxyI(Seq.Ref ref) { super(ref); } - public native int Rand(); + public native int rand(); } private static final class proxyI1 extends Seq.Proxy implements I1 { proxyI1(Seq.Ref ref) { super(ref); } - public native void J(); + public native void j(); } private static final class proxyI2 extends Seq.Proxy implements I2 { proxyI2(Seq.Ref ref) { super(ref); } - public native void G(); + public native void g(); } private static final class proxyI3 extends Seq.Proxy implements I3 { proxyI3(Seq.Ref ref) { super(ref); } - public native I1 F(); + public native I1 f(); } private static final class proxyLargerI extends Seq.Proxy implements LargerI { proxyLargerI(Seq.Ref ref) { super(ref); } - public native void AnotherFunc(); - public native int Rand(); + public native void anotherFunc(); + public native int rand(); } private static final class proxySameI extends Seq.Proxy implements SameI { proxySameI(Seq.Ref ref) { super(ref); } - public native int Rand(); + public native int rand(); } private static final class proxyWithParam extends Seq.Proxy implements WithParam { proxyWithParam(Seq.Ref ref) { super(ref); } - public native void HasParam(boolean p0); + public native void hasParam(boolean p0); } - public static native int Add3(I r); - public static native void CallErr(Error e) throws Exception; - public static native I Seven(); + public static native int add3(I r); + public static native void callErr(Error e) throws Exception; + public static native I seven(); } diff --git a/bind/testdata/issue10788.java.c.golden b/bind/testdata/issue10788.java.c.golden index 3a32f2e..d606049 100644 --- a/bind/testdata/issue10788.java.c.golden +++ b/bind/testdata/issue10788.java.c.golden @@ -17,7 +17,7 @@ jclass proxy_class_issue10788_TestStruct; jmethodID proxy_class_issue10788_TestStruct_cons; JNIEXPORT void JNICALL -Java_go_issue10788_Issue10788_init(JNIEnv *env, jclass _unused) { +Java_go_issue10788_Issue10788__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/issue10788/TestStruct"); proxy_class_issue10788_TestStruct = (*env)->NewGlobalRef(env, clazz); @@ -26,8 +26,8 @@ Java_go_issue10788_Issue10788_init(JNIEnv *env, jclass _unused) { 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"); - mid_TestInterface_MultipleUnnamedParams = (*env)->GetMethodID(env, clazz, "MultipleUnnamedParams", "(JLjava/lang/String;J)V"); + mid_TestInterface_DoSomeWork = (*env)->GetMethodID(env, clazz, "doSomeWork", "(Lgo/issue10788/TestStruct;)V"); + mid_TestInterface_MultipleUnnamedParams = (*env)->GetMethodID(env, clazz, "multipleUnnamedParams", "(JLjava/lang/String;J)V"); } @@ -47,7 +47,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_go_issue10788_Issue10788_00024proxyTestInterface_doSomeWork(JNIEnv* env, jobject this, jobject s) { int32_t o = go_seq_to_refnum(env, this); int32_t _s = go_seq_to_refnum(env, s); proxyissue10788_TestInterface_DoSomeWork(o, _s); @@ -62,7 +62,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_go_issue10788_Issue10788_00024proxyTestInterface_multipleUnnamedParams(JNIEnv* env, jobject this, jlong p0, jstring p1, jlong p2) { int32_t o = go_seq_to_refnum(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 30aa170..bc0836b 100644 --- a/bind/testdata/issue10788.java.golden +++ b/bind/testdata/issue10788.java.golden @@ -50,8 +50,8 @@ package go.issue10788; import go.Seq; public interface TestInterface { - public void DoSomeWork(TestStruct s); - public void MultipleUnnamedParams(long p0, String p1, long p2); + public void doSomeWork(TestStruct s); + public void multipleUnnamedParams(long p0, String p1, long p2); } @@ -66,7 +66,7 @@ import go.Seq; public abstract class Issue10788 { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Issue10788() {} // uninstantiable @@ -74,13 +74,13 @@ public abstract class Issue10788 { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyTestInterface extends Seq.Proxy implements TestInterface { proxyTestInterface(Seq.Ref ref) { super(ref); } - public native void DoSomeWork(TestStruct s); - public native void MultipleUnnamedParams(long p0, String p1, long p2); + public native void doSomeWork(TestStruct s); + public native void multipleUnnamedParams(long p0, String p1, long p2); } diff --git a/bind/testdata/issue12328.java.c.golden b/bind/testdata/issue12328.java.c.golden index ef74476..e871285 100644 --- a/bind/testdata/issue12328.java.c.golden +++ b/bind/testdata/issue12328.java.c.golden @@ -13,7 +13,7 @@ jclass proxy_class_issue12328_T; jmethodID proxy_class_issue12328_T_cons; JNIEXPORT void JNICALL -Java_go_issue12328_Issue12328_init(JNIEnv *env, jclass _unused) { +Java_go_issue12328_Issue12328__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/issue12328/T"); proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz); diff --git a/bind/testdata/issue12328.java.golden b/bind/testdata/issue12328.java.golden index ce378e1..52f0d70 100644 --- a/bind/testdata/issue12328.java.golden +++ b/bind/testdata/issue12328.java.golden @@ -52,7 +52,7 @@ import go.Seq; public abstract class Issue12328 { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Issue12328() {} // uninstantiable @@ -60,7 +60,7 @@ public abstract class Issue12328 { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); diff --git a/bind/testdata/issue12403.java.c.golden b/bind/testdata/issue12403.java.c.golden index 64eec04..b3eafcf 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_init(JNIEnv *env, jclass _unused) { +Java_go_issue12403_Issue12403__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/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"); - 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;"); + 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_go_issue12403_Issue12403_00024proxyParsable_fromJSON(JNIEnv* env, jobject this, jstring jstr) { int32_t o = go_seq_to_refnum(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_go_issue12403_Issue12403_00024proxyParsable_toJSON(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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 e268ecc..dde6ebe 100644 --- a/bind/testdata/issue12403.java.golden +++ b/bind/testdata/issue12403.java.golden @@ -7,8 +7,8 @@ package go.issue12403; import go.Seq; public interface Parsable { - public String FromJSON(String jstr); - public String ToJSON() throws Exception; + public String fromJSON(String jstr); + public String toJSON() throws Exception; } @@ -23,7 +23,7 @@ import go.Seq; public abstract class Issue12403 { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Issue12403() {} // uninstantiable @@ -31,13 +31,13 @@ public abstract class Issue12403 { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyParsable extends Seq.Proxy implements Parsable { proxyParsable(Seq.Ref ref) { super(ref); } - public native String FromJSON(String jstr); - public native String ToJSON() throws Exception; + public native String fromJSON(String jstr); + public native String toJSON() throws Exception; } diff --git a/bind/testdata/keywords.go b/bind/testdata/keywords.go new file mode 100644 index 0000000..46ecb52 --- /dev/null +++ b/bind/testdata/keywords.go @@ -0,0 +1,61 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package keywords + +type KeywordCaller interface { + Abstract() + Assert() + Boolean() + Break() + Byte() + Case() + Catch() + Char() + Class() + Const() + Continue() + Default() + Do() + Double() + Else() + Enum() + Extends() + Final() + Finally() + Float() + For() + Goto() + If() + Implements() + Import() + Instanceof() + Int() + Interface() + Long() + Native() + New() + Package() + Private() + Protected() + Public() + Return() + Short() + Static() + Strictfp() + Super() + Switch() + Synchronized() + This() + Throw() + Throws() + Transient() + Try() + Void() + Volatile() + While() + False() + Null() + True() +} diff --git a/bind/testdata/keywords.go.golden b/bind/testdata/keywords.go.golden new file mode 100644 index 0000000..58a7c3d --- /dev/null +++ b/bind/testdata/keywords.go.golden @@ -0,0 +1,609 @@ +// Package gomobile_bind is an autogenerated binder stub for package keywords. +// gobind -lang=go keywords +// +// File is generated by gobind. Do not edit. +package gomobile_bind + +/* +#include +#include +#include "seq.h" +#include "keywords.h" + +*/ +import "C" + +import ( + _seq "golang.org/x/mobile/bind/seq" + "keywords" +) + +// suppress the error if seq ends up unused +var _ = _seq.FromRefNum + +//export proxykeywords_KeywordCaller_Abstract +func proxykeywords_KeywordCaller_Abstract(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Abstract() +} + +//export proxykeywords_KeywordCaller_Assert +func proxykeywords_KeywordCaller_Assert(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Assert() +} + +//export proxykeywords_KeywordCaller_Boolean +func proxykeywords_KeywordCaller_Boolean(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Boolean() +} + +//export proxykeywords_KeywordCaller_Break +func proxykeywords_KeywordCaller_Break(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Break() +} + +//export proxykeywords_KeywordCaller_Byte +func proxykeywords_KeywordCaller_Byte(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Byte() +} + +//export proxykeywords_KeywordCaller_Case +func proxykeywords_KeywordCaller_Case(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Case() +} + +//export proxykeywords_KeywordCaller_Catch +func proxykeywords_KeywordCaller_Catch(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Catch() +} + +//export proxykeywords_KeywordCaller_Char +func proxykeywords_KeywordCaller_Char(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Char() +} + +//export proxykeywords_KeywordCaller_Class +func proxykeywords_KeywordCaller_Class(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Class() +} + +//export proxykeywords_KeywordCaller_Const +func proxykeywords_KeywordCaller_Const(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Const() +} + +//export proxykeywords_KeywordCaller_Continue +func proxykeywords_KeywordCaller_Continue(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Continue() +} + +//export proxykeywords_KeywordCaller_Default +func proxykeywords_KeywordCaller_Default(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Default() +} + +//export proxykeywords_KeywordCaller_Do +func proxykeywords_KeywordCaller_Do(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Do() +} + +//export proxykeywords_KeywordCaller_Double +func proxykeywords_KeywordCaller_Double(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Double() +} + +//export proxykeywords_KeywordCaller_Else +func proxykeywords_KeywordCaller_Else(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Else() +} + +//export proxykeywords_KeywordCaller_Enum +func proxykeywords_KeywordCaller_Enum(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Enum() +} + +//export proxykeywords_KeywordCaller_Extends +func proxykeywords_KeywordCaller_Extends(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Extends() +} + +//export proxykeywords_KeywordCaller_False +func proxykeywords_KeywordCaller_False(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.False() +} + +//export proxykeywords_KeywordCaller_Final +func proxykeywords_KeywordCaller_Final(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Final() +} + +//export proxykeywords_KeywordCaller_Finally +func proxykeywords_KeywordCaller_Finally(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Finally() +} + +//export proxykeywords_KeywordCaller_Float +func proxykeywords_KeywordCaller_Float(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Float() +} + +//export proxykeywords_KeywordCaller_For +func proxykeywords_KeywordCaller_For(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.For() +} + +//export proxykeywords_KeywordCaller_Goto +func proxykeywords_KeywordCaller_Goto(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Goto() +} + +//export proxykeywords_KeywordCaller_If +func proxykeywords_KeywordCaller_If(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.If() +} + +//export proxykeywords_KeywordCaller_Implements +func proxykeywords_KeywordCaller_Implements(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Implements() +} + +//export proxykeywords_KeywordCaller_Import +func proxykeywords_KeywordCaller_Import(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Import() +} + +//export proxykeywords_KeywordCaller_Instanceof +func proxykeywords_KeywordCaller_Instanceof(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Instanceof() +} + +//export proxykeywords_KeywordCaller_Int +func proxykeywords_KeywordCaller_Int(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Int() +} + +//export proxykeywords_KeywordCaller_Interface +func proxykeywords_KeywordCaller_Interface(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Interface() +} + +//export proxykeywords_KeywordCaller_Long +func proxykeywords_KeywordCaller_Long(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Long() +} + +//export proxykeywords_KeywordCaller_Native +func proxykeywords_KeywordCaller_Native(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Native() +} + +//export proxykeywords_KeywordCaller_New +func proxykeywords_KeywordCaller_New(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.New() +} + +//export proxykeywords_KeywordCaller_Null +func proxykeywords_KeywordCaller_Null(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Null() +} + +//export proxykeywords_KeywordCaller_Package +func proxykeywords_KeywordCaller_Package(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Package() +} + +//export proxykeywords_KeywordCaller_Private +func proxykeywords_KeywordCaller_Private(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Private() +} + +//export proxykeywords_KeywordCaller_Protected +func proxykeywords_KeywordCaller_Protected(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Protected() +} + +//export proxykeywords_KeywordCaller_Public +func proxykeywords_KeywordCaller_Public(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Public() +} + +//export proxykeywords_KeywordCaller_Return +func proxykeywords_KeywordCaller_Return(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Return() +} + +//export proxykeywords_KeywordCaller_Short +func proxykeywords_KeywordCaller_Short(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Short() +} + +//export proxykeywords_KeywordCaller_Static +func proxykeywords_KeywordCaller_Static(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Static() +} + +//export proxykeywords_KeywordCaller_Strictfp +func proxykeywords_KeywordCaller_Strictfp(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Strictfp() +} + +//export proxykeywords_KeywordCaller_Super +func proxykeywords_KeywordCaller_Super(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Super() +} + +//export proxykeywords_KeywordCaller_Switch +func proxykeywords_KeywordCaller_Switch(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Switch() +} + +//export proxykeywords_KeywordCaller_Synchronized +func proxykeywords_KeywordCaller_Synchronized(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Synchronized() +} + +//export proxykeywords_KeywordCaller_This +func proxykeywords_KeywordCaller_This(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.This() +} + +//export proxykeywords_KeywordCaller_Throw +func proxykeywords_KeywordCaller_Throw(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Throw() +} + +//export proxykeywords_KeywordCaller_Throws +func proxykeywords_KeywordCaller_Throws(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Throws() +} + +//export proxykeywords_KeywordCaller_Transient +func proxykeywords_KeywordCaller_Transient(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Transient() +} + +//export proxykeywords_KeywordCaller_True +func proxykeywords_KeywordCaller_True(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.True() +} + +//export proxykeywords_KeywordCaller_Try +func proxykeywords_KeywordCaller_Try(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Try() +} + +//export proxykeywords_KeywordCaller_Void +func proxykeywords_KeywordCaller_Void(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Void() +} + +//export proxykeywords_KeywordCaller_Volatile +func proxykeywords_KeywordCaller_Volatile(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.Volatile() +} + +//export proxykeywords_KeywordCaller_While +func proxykeywords_KeywordCaller_While(refnum C.int32_t) { + ref := _seq.FromRefNum(int32(refnum)) + v := ref.Get().(keywords.KeywordCaller) + v.While() +} + +type proxykeywords_KeywordCaller _seq.Ref + +func (p *proxykeywords_KeywordCaller) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } + +func (p *proxykeywords_KeywordCaller) Abstract() { + C.cproxykeywords_KeywordCaller_Abstract(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Assert() { + C.cproxykeywords_KeywordCaller_Assert(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Boolean() { + C.cproxykeywords_KeywordCaller_Boolean(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Break() { + C.cproxykeywords_KeywordCaller_Break(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Byte() { + C.cproxykeywords_KeywordCaller_Byte(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Case() { + C.cproxykeywords_KeywordCaller_Case(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Catch() { + C.cproxykeywords_KeywordCaller_Catch(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Char() { + C.cproxykeywords_KeywordCaller_Char(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Class() { + C.cproxykeywords_KeywordCaller_Class(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Const() { + C.cproxykeywords_KeywordCaller_Const(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Continue() { + C.cproxykeywords_KeywordCaller_Continue(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Default() { + C.cproxykeywords_KeywordCaller_Default(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Do() { + C.cproxykeywords_KeywordCaller_Do(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Double() { + C.cproxykeywords_KeywordCaller_Double(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Else() { + C.cproxykeywords_KeywordCaller_Else(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Enum() { + C.cproxykeywords_KeywordCaller_Enum(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Extends() { + C.cproxykeywords_KeywordCaller_Extends(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) False() { + C.cproxykeywords_KeywordCaller_False(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Final() { + C.cproxykeywords_KeywordCaller_Final(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Finally() { + C.cproxykeywords_KeywordCaller_Finally(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Float() { + C.cproxykeywords_KeywordCaller_Float(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) For() { + C.cproxykeywords_KeywordCaller_For(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Goto() { + C.cproxykeywords_KeywordCaller_Goto(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) If() { + C.cproxykeywords_KeywordCaller_If(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Implements() { + C.cproxykeywords_KeywordCaller_Implements(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Import() { + C.cproxykeywords_KeywordCaller_Import(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Instanceof() { + C.cproxykeywords_KeywordCaller_Instanceof(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Int() { + C.cproxykeywords_KeywordCaller_Int(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Interface() { + C.cproxykeywords_KeywordCaller_Interface(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Long() { + C.cproxykeywords_KeywordCaller_Long(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Native() { + C.cproxykeywords_KeywordCaller_Native(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) New() { + C.cproxykeywords_KeywordCaller_New(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Null() { + C.cproxykeywords_KeywordCaller_Null(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Package() { + C.cproxykeywords_KeywordCaller_Package(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Private() { + C.cproxykeywords_KeywordCaller_Private(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Protected() { + C.cproxykeywords_KeywordCaller_Protected(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Public() { + C.cproxykeywords_KeywordCaller_Public(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Return() { + C.cproxykeywords_KeywordCaller_Return(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Short() { + C.cproxykeywords_KeywordCaller_Short(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Static() { + C.cproxykeywords_KeywordCaller_Static(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Strictfp() { + C.cproxykeywords_KeywordCaller_Strictfp(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Super() { + C.cproxykeywords_KeywordCaller_Super(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Switch() { + C.cproxykeywords_KeywordCaller_Switch(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Synchronized() { + C.cproxykeywords_KeywordCaller_Synchronized(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) This() { + C.cproxykeywords_KeywordCaller_This(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Throw() { + C.cproxykeywords_KeywordCaller_Throw(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Throws() { + C.cproxykeywords_KeywordCaller_Throws(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Transient() { + C.cproxykeywords_KeywordCaller_Transient(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) True() { + C.cproxykeywords_KeywordCaller_True(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Try() { + C.cproxykeywords_KeywordCaller_Try(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Void() { + C.cproxykeywords_KeywordCaller_Void(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) Volatile() { + C.cproxykeywords_KeywordCaller_Volatile(C.int32_t(p.Bind_proxy_refnum__())) +} + +func (p *proxykeywords_KeywordCaller) While() { + C.cproxykeywords_KeywordCaller_While(C.int32_t(p.Bind_proxy_refnum__())) +} diff --git a/bind/testdata/keywords.java.c.golden b/bind/testdata/keywords.java.c.golden new file mode 100644 index 0000000..67e8b56 --- /dev/null +++ b/bind/testdata/keywords.java.c.golden @@ -0,0 +1,819 @@ +// JNI functions for the Go <=> Java bridge. +// gobind -lang=java keywords +// +// File is generated by gobind. Do not edit. + +#include +#include +#include "seq.h" +#include "_cgo_export.h" +#include "keywords.h" + +jclass proxy_class_keywords_KeywordCaller; +jmethodID proxy_class_keywords_KeywordCaller_cons; +static jmethodID mid_KeywordCaller_Abstract; +static jmethodID mid_KeywordCaller_Assert; +static jmethodID mid_KeywordCaller_Boolean; +static jmethodID mid_KeywordCaller_Break; +static jmethodID mid_KeywordCaller_Byte; +static jmethodID mid_KeywordCaller_Case; +static jmethodID mid_KeywordCaller_Catch; +static jmethodID mid_KeywordCaller_Char; +static jmethodID mid_KeywordCaller_Class; +static jmethodID mid_KeywordCaller_Const; +static jmethodID mid_KeywordCaller_Continue; +static jmethodID mid_KeywordCaller_Default; +static jmethodID mid_KeywordCaller_Do; +static jmethodID mid_KeywordCaller_Double; +static jmethodID mid_KeywordCaller_Else; +static jmethodID mid_KeywordCaller_Enum; +static jmethodID mid_KeywordCaller_Extends; +static jmethodID mid_KeywordCaller_False; +static jmethodID mid_KeywordCaller_Final; +static jmethodID mid_KeywordCaller_Finally; +static jmethodID mid_KeywordCaller_Float; +static jmethodID mid_KeywordCaller_For; +static jmethodID mid_KeywordCaller_Goto; +static jmethodID mid_KeywordCaller_If; +static jmethodID mid_KeywordCaller_Implements; +static jmethodID mid_KeywordCaller_Import; +static jmethodID mid_KeywordCaller_Instanceof; +static jmethodID mid_KeywordCaller_Int; +static jmethodID mid_KeywordCaller_Interface; +static jmethodID mid_KeywordCaller_Long; +static jmethodID mid_KeywordCaller_Native; +static jmethodID mid_KeywordCaller_New; +static jmethodID mid_KeywordCaller_Null; +static jmethodID mid_KeywordCaller_Package; +static jmethodID mid_KeywordCaller_Private; +static jmethodID mid_KeywordCaller_Protected; +static jmethodID mid_KeywordCaller_Public; +static jmethodID mid_KeywordCaller_Return; +static jmethodID mid_KeywordCaller_Short; +static jmethodID mid_KeywordCaller_Static; +static jmethodID mid_KeywordCaller_Strictfp; +static jmethodID mid_KeywordCaller_Super; +static jmethodID mid_KeywordCaller_Switch; +static jmethodID mid_KeywordCaller_Synchronized; +static jmethodID mid_KeywordCaller_This; +static jmethodID mid_KeywordCaller_Throw; +static jmethodID mid_KeywordCaller_Throws; +static jmethodID mid_KeywordCaller_Transient; +static jmethodID mid_KeywordCaller_True; +static jmethodID mid_KeywordCaller_Try; +static jmethodID mid_KeywordCaller_Void; +static jmethodID mid_KeywordCaller_Volatile; +static jmethodID mid_KeywordCaller_While; + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords__1init(JNIEnv *env, jclass _unused) { + jclass clazz; + clazz = (*env)->FindClass(env, "go/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"); + 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"); + mid_KeywordCaller_Break = (*env)->GetMethodID(env, clazz, "break_", "()V"); + mid_KeywordCaller_Byte = (*env)->GetMethodID(env, clazz, "byte_", "()V"); + mid_KeywordCaller_Case = (*env)->GetMethodID(env, clazz, "case_", "()V"); + mid_KeywordCaller_Catch = (*env)->GetMethodID(env, clazz, "catch_", "()V"); + mid_KeywordCaller_Char = (*env)->GetMethodID(env, clazz, "char_", "()V"); + mid_KeywordCaller_Class = (*env)->GetMethodID(env, clazz, "class_", "()V"); + mid_KeywordCaller_Const = (*env)->GetMethodID(env, clazz, "const_", "()V"); + mid_KeywordCaller_Continue = (*env)->GetMethodID(env, clazz, "continue_", "()V"); + mid_KeywordCaller_Default = (*env)->GetMethodID(env, clazz, "default_", "()V"); + mid_KeywordCaller_Do = (*env)->GetMethodID(env, clazz, "do_", "()V"); + mid_KeywordCaller_Double = (*env)->GetMethodID(env, clazz, "double_", "()V"); + mid_KeywordCaller_Else = (*env)->GetMethodID(env, clazz, "else_", "()V"); + mid_KeywordCaller_Enum = (*env)->GetMethodID(env, clazz, "enum_", "()V"); + mid_KeywordCaller_Extends = (*env)->GetMethodID(env, clazz, "extends_", "()V"); + mid_KeywordCaller_False = (*env)->GetMethodID(env, clazz, "false_", "()V"); + mid_KeywordCaller_Final = (*env)->GetMethodID(env, clazz, "final_", "()V"); + mid_KeywordCaller_Finally = (*env)->GetMethodID(env, clazz, "finally_", "()V"); + mid_KeywordCaller_Float = (*env)->GetMethodID(env, clazz, "float_", "()V"); + mid_KeywordCaller_For = (*env)->GetMethodID(env, clazz, "for_", "()V"); + mid_KeywordCaller_Goto = (*env)->GetMethodID(env, clazz, "goto_", "()V"); + mid_KeywordCaller_If = (*env)->GetMethodID(env, clazz, "if_", "()V"); + mid_KeywordCaller_Implements = (*env)->GetMethodID(env, clazz, "implements_", "()V"); + mid_KeywordCaller_Import = (*env)->GetMethodID(env, clazz, "import_", "()V"); + mid_KeywordCaller_Instanceof = (*env)->GetMethodID(env, clazz, "instanceof_", "()V"); + mid_KeywordCaller_Int = (*env)->GetMethodID(env, clazz, "int_", "()V"); + mid_KeywordCaller_Interface = (*env)->GetMethodID(env, clazz, "interface_", "()V"); + mid_KeywordCaller_Long = (*env)->GetMethodID(env, clazz, "long_", "()V"); + mid_KeywordCaller_Native = (*env)->GetMethodID(env, clazz, "native_", "()V"); + mid_KeywordCaller_New = (*env)->GetMethodID(env, clazz, "new_", "()V"); + mid_KeywordCaller_Null = (*env)->GetMethodID(env, clazz, "null_", "()V"); + mid_KeywordCaller_Package = (*env)->GetMethodID(env, clazz, "package_", "()V"); + mid_KeywordCaller_Private = (*env)->GetMethodID(env, clazz, "private_", "()V"); + mid_KeywordCaller_Protected = (*env)->GetMethodID(env, clazz, "protected_", "()V"); + mid_KeywordCaller_Public = (*env)->GetMethodID(env, clazz, "public_", "()V"); + mid_KeywordCaller_Return = (*env)->GetMethodID(env, clazz, "return_", "()V"); + mid_KeywordCaller_Short = (*env)->GetMethodID(env, clazz, "short_", "()V"); + mid_KeywordCaller_Static = (*env)->GetMethodID(env, clazz, "static_", "()V"); + mid_KeywordCaller_Strictfp = (*env)->GetMethodID(env, clazz, "strictfp_", "()V"); + mid_KeywordCaller_Super = (*env)->GetMethodID(env, clazz, "super_", "()V"); + mid_KeywordCaller_Switch = (*env)->GetMethodID(env, clazz, "switch_", "()V"); + mid_KeywordCaller_Synchronized = (*env)->GetMethodID(env, clazz, "synchronized_", "()V"); + mid_KeywordCaller_This = (*env)->GetMethodID(env, clazz, "this_", "()V"); + mid_KeywordCaller_Throw = (*env)->GetMethodID(env, clazz, "throw_", "()V"); + mid_KeywordCaller_Throws = (*env)->GetMethodID(env, clazz, "throws_", "()V"); + mid_KeywordCaller_Transient = (*env)->GetMethodID(env, clazz, "transient_", "()V"); + mid_KeywordCaller_True = (*env)->GetMethodID(env, clazz, "true_", "()V"); + mid_KeywordCaller_Try = (*env)->GetMethodID(env, clazz, "try_", "()V"); + mid_KeywordCaller_Void = (*env)->GetMethodID(env, clazz, "void_", "()V"); + mid_KeywordCaller_Volatile = (*env)->GetMethodID(env, clazz, "volatile_", "()V"); + mid_KeywordCaller_While = (*env)->GetMethodID(env, clazz, "while_", "()V"); + +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_abstract_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Abstract(o); +} + +void cproxykeywords_KeywordCaller_Abstract(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Abstract); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_assert_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Assert(o); +} + +void cproxykeywords_KeywordCaller_Assert(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Assert); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_boolean_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Boolean(o); +} + +void cproxykeywords_KeywordCaller_Boolean(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Boolean); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_break_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Break(o); +} + +void cproxykeywords_KeywordCaller_Break(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Break); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_byte_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Byte(o); +} + +void cproxykeywords_KeywordCaller_Byte(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Byte); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_case_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Case(o); +} + +void cproxykeywords_KeywordCaller_Case(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Case); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_catch_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Catch(o); +} + +void cproxykeywords_KeywordCaller_Catch(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Catch); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_char_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Char(o); +} + +void cproxykeywords_KeywordCaller_Char(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Char); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_class_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Class(o); +} + +void cproxykeywords_KeywordCaller_Class(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Class); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_const_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Const(o); +} + +void cproxykeywords_KeywordCaller_Const(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Const); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_continue_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Continue(o); +} + +void cproxykeywords_KeywordCaller_Continue(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Continue); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_default_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Default(o); +} + +void cproxykeywords_KeywordCaller_Default(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Default); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_do_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Do(o); +} + +void cproxykeywords_KeywordCaller_Do(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Do); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_double_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Double(o); +} + +void cproxykeywords_KeywordCaller_Double(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Double); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_else_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Else(o); +} + +void cproxykeywords_KeywordCaller_Else(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Else); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_enum_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Enum(o); +} + +void cproxykeywords_KeywordCaller_Enum(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Enum); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_extends_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Extends(o); +} + +void cproxykeywords_KeywordCaller_Extends(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Extends); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_false_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_False(o); +} + +void cproxykeywords_KeywordCaller_False(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_False); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_final_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Final(o); +} + +void cproxykeywords_KeywordCaller_Final(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Final); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_finally_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Finally(o); +} + +void cproxykeywords_KeywordCaller_Finally(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Finally); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_float_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Float(o); +} + +void cproxykeywords_KeywordCaller_Float(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Float); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_for_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_For(o); +} + +void cproxykeywords_KeywordCaller_For(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_For); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_goto_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Goto(o); +} + +void cproxykeywords_KeywordCaller_Goto(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Goto); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_if_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_If(o); +} + +void cproxykeywords_KeywordCaller_If(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_If); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_implements_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Implements(o); +} + +void cproxykeywords_KeywordCaller_Implements(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Implements); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_import_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Import(o); +} + +void cproxykeywords_KeywordCaller_Import(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Import); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_instanceof_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Instanceof(o); +} + +void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Instanceof); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_int_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Int(o); +} + +void cproxykeywords_KeywordCaller_Int(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Int); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_interface_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Interface(o); +} + +void cproxykeywords_KeywordCaller_Interface(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Interface); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_long_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Long(o); +} + +void cproxykeywords_KeywordCaller_Long(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Long); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_native_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Native(o); +} + +void cproxykeywords_KeywordCaller_Native(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Native); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_new_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_New(o); +} + +void cproxykeywords_KeywordCaller_New(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_New); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_null_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Null(o); +} + +void cproxykeywords_KeywordCaller_Null(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Null); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_package_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Package(o); +} + +void cproxykeywords_KeywordCaller_Package(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Package); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_private_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Private(o); +} + +void cproxykeywords_KeywordCaller_Private(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Private); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_protected_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Protected(o); +} + +void cproxykeywords_KeywordCaller_Protected(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Protected); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_public_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Public(o); +} + +void cproxykeywords_KeywordCaller_Public(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Public); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_return_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Return(o); +} + +void cproxykeywords_KeywordCaller_Return(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Return); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_short_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Short(o); +} + +void cproxykeywords_KeywordCaller_Short(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Short); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_static_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Static(o); +} + +void cproxykeywords_KeywordCaller_Static(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Static); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_strictfp_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Strictfp(o); +} + +void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Strictfp); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_super_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Super(o); +} + +void cproxykeywords_KeywordCaller_Super(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Super); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_switch_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Switch(o); +} + +void cproxykeywords_KeywordCaller_Switch(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Switch); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_synchronized_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Synchronized(o); +} + +void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Synchronized); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_this_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_This(o); +} + +void cproxykeywords_KeywordCaller_This(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_This); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_throw_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Throw(o); +} + +void cproxykeywords_KeywordCaller_Throw(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Throw); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_throws_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Throws(o); +} + +void cproxykeywords_KeywordCaller_Throws(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Throws); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_transient_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Transient(o); +} + +void cproxykeywords_KeywordCaller_Transient(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Transient); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_true_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_True(o); +} + +void cproxykeywords_KeywordCaller_True(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_True); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_try_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Try(o); +} + +void cproxykeywords_KeywordCaller_Try(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Try); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_void_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Void(o); +} + +void cproxykeywords_KeywordCaller_Void(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Void); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_volatile_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_Volatile(o); +} + +void cproxykeywords_KeywordCaller_Volatile(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_Volatile); + go_seq_pop_local_frame(env); +} + +JNIEXPORT void JNICALL +Java_go_keywords_Keywords_00024proxyKeywordCaller_while_1(JNIEnv* env, jobject this) { + int32_t o = go_seq_to_refnum(env, this); + proxykeywords_KeywordCaller_While(o); +} + +void cproxykeywords_KeywordCaller_While(int32_t refnum) { + JNIEnv *env = go_seq_push_local_frame(10); + jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons); + (*env)->CallVoidMethod(env, o, mid_KeywordCaller_While); + go_seq_pop_local_frame(env); +} + diff --git a/bind/testdata/keywords.java.golden b/bind/testdata/keywords.java.golden new file mode 100644 index 0000000..a62e4d3 --- /dev/null +++ b/bind/testdata/keywords.java.golden @@ -0,0 +1,146 @@ +// Java class go.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; + +import go.Seq; + +public interface KeywordCaller { + public void abstract_(); + public void assert_(); + public void boolean_(); + public void break_(); + public void byte_(); + public void case_(); + public void catch_(); + public void char_(); + public void class_(); + public void const_(); + public void continue_(); + public void default_(); + public void do_(); + public void double_(); + public void else_(); + public void enum_(); + public void extends_(); + public void false_(); + public void final_(); + public void finally_(); + public void float_(); + public void for_(); + public void goto_(); + public void if_(); + public void implements_(); + public void import_(); + public void instanceof_(); + public void int_(); + public void interface_(); + public void long_(); + public void native_(); + public void new_(); + public void null_(); + public void package_(); + public void private_(); + public void protected_(); + public void public_(); + public void return_(); + public void short_(); + public void static_(); + public void strictfp_(); + public void super_(); + public void switch_(); + public void synchronized_(); + public void this_(); + public void throw_(); + public void throws_(); + public void transient_(); + public void true_(); + public void try_(); + public void void_(); + public void volatile_(); + public void while_(); + +} + +// Java class go.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; + +import go.Seq; + +public abstract class Keywords { + static { + Seq.touch(); // for loading the native library + _init(); + } + + private Keywords() {} // uninstantiable + + // touch is called from other bound packages to initialize this package + public static void touch() {} + + private static native void _init(); + + private static final class proxyKeywordCaller extends Seq.Proxy implements KeywordCaller { + proxyKeywordCaller(Seq.Ref ref) { super(ref); } + + public native void abstract_(); + public native void assert_(); + public native void boolean_(); + public native void break_(); + public native void byte_(); + public native void case_(); + public native void catch_(); + public native void char_(); + public native void class_(); + public native void const_(); + public native void continue_(); + public native void default_(); + public native void do_(); + public native void double_(); + public native void else_(); + public native void enum_(); + public native void extends_(); + public native void false_(); + public native void final_(); + public native void finally_(); + public native void float_(); + public native void for_(); + public native void goto_(); + public native void if_(); + public native void implements_(); + public native void import_(); + public native void instanceof_(); + public native void int_(); + public native void interface_(); + public native void long_(); + public native void native_(); + public native void new_(); + public native void null_(); + public native void package_(); + public native void private_(); + public native void protected_(); + public native void public_(); + public native void return_(); + public native void short_(); + public native void static_(); + public native void strictfp_(); + public native void super_(); + public native void switch_(); + public native void synchronized_(); + public native void this_(); + public native void throw_(); + public native void throws_(); + public native void transient_(); + public native void true_(); + public native void try_(); + public native void void_(); + public native void volatile_(); + public native void while_(); + } + + +} diff --git a/bind/testdata/keywords.java.h.golden b/bind/testdata/keywords.java.h.golden new file mode 100644 index 0000000..23886d7 --- /dev/null +++ b/bind/testdata/keywords.java.h.golden @@ -0,0 +1,120 @@ +// JNI function headers for the Go <=> Java bridge. +// gobind -lang=java keywords +// +// File is generated by gobind. Do not edit. + +#ifndef __Keywords_H__ +#define __Keywords_H__ + +#include + +extern jclass proxy_class_keywords_KeywordCaller; +extern jmethodID proxy_class_keywords_KeywordCaller_cons; + +void cproxykeywords_KeywordCaller_Abstract(int32_t refnum); + +void cproxykeywords_KeywordCaller_Assert(int32_t refnum); + +void cproxykeywords_KeywordCaller_Boolean(int32_t refnum); + +void cproxykeywords_KeywordCaller_Break(int32_t refnum); + +void cproxykeywords_KeywordCaller_Byte(int32_t refnum); + +void cproxykeywords_KeywordCaller_Case(int32_t refnum); + +void cproxykeywords_KeywordCaller_Catch(int32_t refnum); + +void cproxykeywords_KeywordCaller_Char(int32_t refnum); + +void cproxykeywords_KeywordCaller_Class(int32_t refnum); + +void cproxykeywords_KeywordCaller_Const(int32_t refnum); + +void cproxykeywords_KeywordCaller_Continue(int32_t refnum); + +void cproxykeywords_KeywordCaller_Default(int32_t refnum); + +void cproxykeywords_KeywordCaller_Do(int32_t refnum); + +void cproxykeywords_KeywordCaller_Double(int32_t refnum); + +void cproxykeywords_KeywordCaller_Else(int32_t refnum); + +void cproxykeywords_KeywordCaller_Enum(int32_t refnum); + +void cproxykeywords_KeywordCaller_Extends(int32_t refnum); + +void cproxykeywords_KeywordCaller_False(int32_t refnum); + +void cproxykeywords_KeywordCaller_Final(int32_t refnum); + +void cproxykeywords_KeywordCaller_Finally(int32_t refnum); + +void cproxykeywords_KeywordCaller_Float(int32_t refnum); + +void cproxykeywords_KeywordCaller_For(int32_t refnum); + +void cproxykeywords_KeywordCaller_Goto(int32_t refnum); + +void cproxykeywords_KeywordCaller_If(int32_t refnum); + +void cproxykeywords_KeywordCaller_Implements(int32_t refnum); + +void cproxykeywords_KeywordCaller_Import(int32_t refnum); + +void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum); + +void cproxykeywords_KeywordCaller_Int(int32_t refnum); + +void cproxykeywords_KeywordCaller_Interface(int32_t refnum); + +void cproxykeywords_KeywordCaller_Long(int32_t refnum); + +void cproxykeywords_KeywordCaller_Native(int32_t refnum); + +void cproxykeywords_KeywordCaller_New(int32_t refnum); + +void cproxykeywords_KeywordCaller_Null(int32_t refnum); + +void cproxykeywords_KeywordCaller_Package(int32_t refnum); + +void cproxykeywords_KeywordCaller_Private(int32_t refnum); + +void cproxykeywords_KeywordCaller_Protected(int32_t refnum); + +void cproxykeywords_KeywordCaller_Public(int32_t refnum); + +void cproxykeywords_KeywordCaller_Return(int32_t refnum); + +void cproxykeywords_KeywordCaller_Short(int32_t refnum); + +void cproxykeywords_KeywordCaller_Static(int32_t refnum); + +void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum); + +void cproxykeywords_KeywordCaller_Super(int32_t refnum); + +void cproxykeywords_KeywordCaller_Switch(int32_t refnum); + +void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum); + +void cproxykeywords_KeywordCaller_This(int32_t refnum); + +void cproxykeywords_KeywordCaller_Throw(int32_t refnum); + +void cproxykeywords_KeywordCaller_Throws(int32_t refnum); + +void cproxykeywords_KeywordCaller_Transient(int32_t refnum); + +void cproxykeywords_KeywordCaller_True(int32_t refnum); + +void cproxykeywords_KeywordCaller_Try(int32_t refnum); + +void cproxykeywords_KeywordCaller_Void(int32_t refnum); + +void cproxykeywords_KeywordCaller_Volatile(int32_t refnum); + +void cproxykeywords_KeywordCaller_While(int32_t refnum); + +#endif diff --git a/bind/testdata/keywords.objc.go.h.golden b/bind/testdata/keywords.objc.go.h.golden new file mode 100644 index 0000000..ed1f241 --- /dev/null +++ b/bind/testdata/keywords.objc.go.h.golden @@ -0,0 +1,117 @@ +// Objective-C API for talking to keywords Go package. +// gobind -lang=objc keywords +// +// File is generated by gobind. Do not edit. + +#ifndef __keywords_H__ +#define __keywords_H__ + +#include +#include +void cproxykeywords_KeywordCaller_Abstract(int32_t refnum); + +void cproxykeywords_KeywordCaller_Assert(int32_t refnum); + +void cproxykeywords_KeywordCaller_Boolean(int32_t refnum); + +void cproxykeywords_KeywordCaller_Break(int32_t refnum); + +void cproxykeywords_KeywordCaller_Byte(int32_t refnum); + +void cproxykeywords_KeywordCaller_Case(int32_t refnum); + +void cproxykeywords_KeywordCaller_Catch(int32_t refnum); + +void cproxykeywords_KeywordCaller_Char(int32_t refnum); + +void cproxykeywords_KeywordCaller_Class(int32_t refnum); + +void cproxykeywords_KeywordCaller_Const(int32_t refnum); + +void cproxykeywords_KeywordCaller_Continue(int32_t refnum); + +void cproxykeywords_KeywordCaller_Default(int32_t refnum); + +void cproxykeywords_KeywordCaller_Do(int32_t refnum); + +void cproxykeywords_KeywordCaller_Double(int32_t refnum); + +void cproxykeywords_KeywordCaller_Else(int32_t refnum); + +void cproxykeywords_KeywordCaller_Enum(int32_t refnum); + +void cproxykeywords_KeywordCaller_Extends(int32_t refnum); + +void cproxykeywords_KeywordCaller_False(int32_t refnum); + +void cproxykeywords_KeywordCaller_Final(int32_t refnum); + +void cproxykeywords_KeywordCaller_Finally(int32_t refnum); + +void cproxykeywords_KeywordCaller_Float(int32_t refnum); + +void cproxykeywords_KeywordCaller_For(int32_t refnum); + +void cproxykeywords_KeywordCaller_Goto(int32_t refnum); + +void cproxykeywords_KeywordCaller_If(int32_t refnum); + +void cproxykeywords_KeywordCaller_Implements(int32_t refnum); + +void cproxykeywords_KeywordCaller_Import(int32_t refnum); + +void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum); + +void cproxykeywords_KeywordCaller_Int(int32_t refnum); + +void cproxykeywords_KeywordCaller_Interface(int32_t refnum); + +void cproxykeywords_KeywordCaller_Long(int32_t refnum); + +void cproxykeywords_KeywordCaller_Native(int32_t refnum); + +void cproxykeywords_KeywordCaller_New(int32_t refnum); + +void cproxykeywords_KeywordCaller_Null(int32_t refnum); + +void cproxykeywords_KeywordCaller_Package(int32_t refnum); + +void cproxykeywords_KeywordCaller_Private(int32_t refnum); + +void cproxykeywords_KeywordCaller_Protected(int32_t refnum); + +void cproxykeywords_KeywordCaller_Public(int32_t refnum); + +void cproxykeywords_KeywordCaller_Return(int32_t refnum); + +void cproxykeywords_KeywordCaller_Short(int32_t refnum); + +void cproxykeywords_KeywordCaller_Static(int32_t refnum); + +void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum); + +void cproxykeywords_KeywordCaller_Super(int32_t refnum); + +void cproxykeywords_KeywordCaller_Switch(int32_t refnum); + +void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum); + +void cproxykeywords_KeywordCaller_This(int32_t refnum); + +void cproxykeywords_KeywordCaller_Throw(int32_t refnum); + +void cproxykeywords_KeywordCaller_Throws(int32_t refnum); + +void cproxykeywords_KeywordCaller_Transient(int32_t refnum); + +void cproxykeywords_KeywordCaller_True(int32_t refnum); + +void cproxykeywords_KeywordCaller_Try(int32_t refnum); + +void cproxykeywords_KeywordCaller_Void(int32_t refnum); + +void cproxykeywords_KeywordCaller_Volatile(int32_t refnum); + +void cproxykeywords_KeywordCaller_While(int32_t refnum); + +#endif diff --git a/bind/testdata/keywords.objc.h.golden b/bind/testdata/keywords.objc.h.golden new file mode 100644 index 0000000..1672b7e --- /dev/null +++ b/bind/testdata/keywords.objc.h.golden @@ -0,0 +1,133 @@ +// Objective-C API for talking to keywords Go package. +// gobind -lang=objc keywords +// +// File is generated by gobind. Do not edit. + +#ifndef __GoKeywords_H__ +#define __GoKeywords_H__ + +#include +#include "GoUniverse.h" + +@protocol GoKeywordsKeywordCaller; +@class GoKeywordsKeywordCaller; + +@protocol GoKeywordsKeywordCaller +- (void)abstract; +- (void)assert; +- (void)boolean; +- (void)break; +- (void)byte; +- (void)case; +- (void)catch; +- (void)char; +- (void)class; +- (void)const; +- (void)continue; +- (void)default; +- (void)do; +- (void)double; +- (void)else; +- (void)enum; +- (void)extends; +- (void)false; +- (void)final; +- (void)finally; +- (void)float; +- (void)for; +- (void)goto; +- (void)if; +- (void)implements; +- (void)import; +- (void)instanceof; +- (void)int; +- (void)interface; +- (void)long; +- (void)native; +- (void)new; +- (void)null; +- (void)package; +- (void)private; +- (void)protected; +- (void)public; +- (void)return; +- (void)short; +- (void)static; +- (void)strictfp; +- (void)super; +- (void)switch; +- (void)synchronized; +- (void)this; +- (void)throw; +- (void)throws; +- (void)transient; +- (void)true; +- (void)try; +- (void)void; +- (void)volatile; +- (void)while; +@end + +@class GoKeywordsKeywordCaller; + +@interface GoKeywordsKeywordCaller : NSObject { +} +@property(strong, readonly) id _ref; + +- (id)initWithRef:(id)ref; +- (void)abstract; +- (void)assert; +- (void)boolean; +- (void)break; +- (void)byte; +- (void)case; +- (void)catch; +- (void)char; +- (void)class; +- (void)const; +- (void)continue; +- (void)default; +- (void)do; +- (void)double; +- (void)else; +- (void)enum; +- (void)extends; +- (void)false; +- (void)final; +- (void)finally; +- (void)float; +- (void)for; +- (void)goto; +- (void)if; +- (void)implements; +- (void)import; +- (void)instanceof; +- (void)int; +- (void)interface; +- (void)long; +- (void)native; +- (void)new; +- (void)null; +- (void)package; +- (void)private; +- (void)protected; +- (void)public; +- (void)return; +- (void)short; +- (void)static; +- (void)strictfp; +- (void)super; +- (void)switch; +- (void)synchronized; +- (void)this; +- (void)throw; +- (void)throws; +- (void)transient; +- (void)true; +- (void)try; +- (void)void; +- (void)volatile; +- (void)while; +@end + +#endif diff --git a/bind/testdata/keywords.objc.m.golden b/bind/testdata/keywords.objc.m.golden new file mode 100644 index 0000000..c115f8c --- /dev/null +++ b/bind/testdata/keywords.objc.m.golden @@ -0,0 +1,664 @@ +// Objective-C API for talking to keywords Go package. +// gobind -lang=objc keywords +// +// File is generated by gobind. Do not edit. + +#include +#include "seq.h" +#include "_cgo_export.h" +#include "GoKeywords.h" + +static NSString* errDomain = @"go.keywords"; + +@implementation GoKeywordsKeywordCaller { +} + +- (id)initWithRef:(id)ref { + self = [super init]; + if (self) { __ref = ref; } + return self; +} + +- (void)abstract { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Abstract(refnum); +} + +- (void)assert { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Assert(refnum); +} + +- (void)boolean { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Boolean(refnum); +} + +- (void)break { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Break(refnum); +} + +- (void)byte { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Byte(refnum); +} + +- (void)case { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Case(refnum); +} + +- (void)catch { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Catch(refnum); +} + +- (void)char { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Char(refnum); +} + +- (void)class { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Class(refnum); +} + +- (void)const { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Const(refnum); +} + +- (void)continue { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Continue(refnum); +} + +- (void)default { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Default(refnum); +} + +- (void)do { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Do(refnum); +} + +- (void)double { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Double(refnum); +} + +- (void)else { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Else(refnum); +} + +- (void)enum { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Enum(refnum); +} + +- (void)extends { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Extends(refnum); +} + +- (void)false { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_False(refnum); +} + +- (void)final { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Final(refnum); +} + +- (void)finally { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Finally(refnum); +} + +- (void)float { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Float(refnum); +} + +- (void)for { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_For(refnum); +} + +- (void)goto { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Goto(refnum); +} + +- (void)if { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_If(refnum); +} + +- (void)implements { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Implements(refnum); +} + +- (void)import { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Import(refnum); +} + +- (void)instanceof { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Instanceof(refnum); +} + +- (void)int { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Int(refnum); +} + +- (void)interface { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Interface(refnum); +} + +- (void)long { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Long(refnum); +} + +- (void)native { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Native(refnum); +} + +- (void)new { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_New(refnum); +} + +- (void)null { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Null(refnum); +} + +- (void)package { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Package(refnum); +} + +- (void)private { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Private(refnum); +} + +- (void)protected { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Protected(refnum); +} + +- (void)public { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Public(refnum); +} + +- (void)return { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Return(refnum); +} + +- (void)short { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Short(refnum); +} + +- (void)static { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Static(refnum); +} + +- (void)strictfp { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Strictfp(refnum); +} + +- (void)super { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Super(refnum); +} + +- (void)switch { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Switch(refnum); +} + +- (void)synchronized { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Synchronized(refnum); +} + +- (void)this { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_This(refnum); +} + +- (void)throw { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Throw(refnum); +} + +- (void)throws { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Throws(refnum); +} + +- (void)transient { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Transient(refnum); +} + +- (void)true { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_True(refnum); +} + +- (void)try { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Try(refnum); +} + +- (void)void { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Void(refnum); +} + +- (void)volatile { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_Volatile(refnum); +} + +- (void)while { + int32_t refnum = go_seq_go_to_refnum(self._ref); + proxykeywords_KeywordCaller_While(refnum); +} + +@end + + + +void cproxykeywords_KeywordCaller_Abstract(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o abstract]; + } +} + +void cproxykeywords_KeywordCaller_Assert(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o assert]; + } +} + +void cproxykeywords_KeywordCaller_Boolean(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o boolean]; + } +} + +void cproxykeywords_KeywordCaller_Break(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o break]; + } +} + +void cproxykeywords_KeywordCaller_Byte(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o byte]; + } +} + +void cproxykeywords_KeywordCaller_Case(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o case]; + } +} + +void cproxykeywords_KeywordCaller_Catch(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o catch]; + } +} + +void cproxykeywords_KeywordCaller_Char(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o char]; + } +} + +void cproxykeywords_KeywordCaller_Class(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o class]; + } +} + +void cproxykeywords_KeywordCaller_Const(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o const]; + } +} + +void cproxykeywords_KeywordCaller_Continue(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o continue]; + } +} + +void cproxykeywords_KeywordCaller_Default(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o default]; + } +} + +void cproxykeywords_KeywordCaller_Do(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o do]; + } +} + +void cproxykeywords_KeywordCaller_Double(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o double]; + } +} + +void cproxykeywords_KeywordCaller_Else(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o else]; + } +} + +void cproxykeywords_KeywordCaller_Enum(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o enum]; + } +} + +void cproxykeywords_KeywordCaller_Extends(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o extends]; + } +} + +void cproxykeywords_KeywordCaller_False(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o false]; + } +} + +void cproxykeywords_KeywordCaller_Final(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o final]; + } +} + +void cproxykeywords_KeywordCaller_Finally(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o finally]; + } +} + +void cproxykeywords_KeywordCaller_Float(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o float]; + } +} + +void cproxykeywords_KeywordCaller_For(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o for]; + } +} + +void cproxykeywords_KeywordCaller_Goto(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o goto]; + } +} + +void cproxykeywords_KeywordCaller_If(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o if]; + } +} + +void cproxykeywords_KeywordCaller_Implements(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o implements]; + } +} + +void cproxykeywords_KeywordCaller_Import(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o import]; + } +} + +void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o instanceof]; + } +} + +void cproxykeywords_KeywordCaller_Int(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o int]; + } +} + +void cproxykeywords_KeywordCaller_Interface(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o interface]; + } +} + +void cproxykeywords_KeywordCaller_Long(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o long]; + } +} + +void cproxykeywords_KeywordCaller_Native(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o native]; + } +} + +void cproxykeywords_KeywordCaller_New(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o new]; + } +} + +void cproxykeywords_KeywordCaller_Null(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o null]; + } +} + +void cproxykeywords_KeywordCaller_Package(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o package]; + } +} + +void cproxykeywords_KeywordCaller_Private(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o private]; + } +} + +void cproxykeywords_KeywordCaller_Protected(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o protected]; + } +} + +void cproxykeywords_KeywordCaller_Public(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o public]; + } +} + +void cproxykeywords_KeywordCaller_Return(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o return]; + } +} + +void cproxykeywords_KeywordCaller_Short(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o short]; + } +} + +void cproxykeywords_KeywordCaller_Static(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o static]; + } +} + +void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o strictfp]; + } +} + +void cproxykeywords_KeywordCaller_Super(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o super]; + } +} + +void cproxykeywords_KeywordCaller_Switch(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o switch]; + } +} + +void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o synchronized]; + } +} + +void cproxykeywords_KeywordCaller_This(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o this]; + } +} + +void cproxykeywords_KeywordCaller_Throw(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o throw]; + } +} + +void cproxykeywords_KeywordCaller_Throws(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o throws]; + } +} + +void cproxykeywords_KeywordCaller_Transient(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o transient]; + } +} + +void cproxykeywords_KeywordCaller_True(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o true]; + } +} + +void cproxykeywords_KeywordCaller_Try(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o try]; + } +} + +void cproxykeywords_KeywordCaller_Void(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o void]; + } +} + +void cproxykeywords_KeywordCaller_Volatile(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o volatile]; + } +} + +void cproxykeywords_KeywordCaller_While(int32_t refnum) { + @autoreleasepool { + GoKeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum); + [o while]; + } +} + +__attribute__((constructor)) static void init() { + init_seq(); +} diff --git a/bind/testdata/structs.java.c.golden b/bind/testdata/structs.java.c.golden index 91897d9..4dc5768 100644 --- a/bind/testdata/structs.java.c.golden +++ b/bind/testdata/structs.java.c.golden @@ -18,7 +18,7 @@ jclass proxy_class_structs_S2; jmethodID proxy_class_structs_S2_cons; JNIEXPORT void JNICALL -Java_go_structs_Structs_init(JNIEnv *env, jclass _unused) { +Java_go_structs_Structs__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/structs/S"); proxy_class_structs_S = (*env)->NewGlobalRef(env, clazz); @@ -30,12 +30,12 @@ Java_go_structs_Structs_init(JNIEnv *env, jclass _unused) { 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"); - mid_I_M = (*env)->GetMethodID(env, clazz, "M", "()V"); + mid_I_M = (*env)->GetMethodID(env, clazz, "m", "()V"); } JNIEXPORT jobject JNICALL -Java_go_structs_Structs_Identity(JNIEnv* env, jclass clazz, jobject s) { +Java_go_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_go_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,7 +53,7 @@ Java_go_structs_Structs_IdentityWithError(JNIEnv* env, jclass clazz, jobject s) } JNIEXPORT jobject JNICALL -Java_go_structs_S_Identity(JNIEnv* env, jobject this) { +Java_go_structs_S_identity(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(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); @@ -63,7 +63,7 @@ Java_go_structs_S_Identity(JNIEnv* env, jobject this) { } JNIEXPORT jdouble JNICALL -Java_go_structs_S_Sum(JNIEnv* env, jobject this) { +Java_go_structs_S_sum(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(env, this); double r0 = proxystructs_S_Sum(o); jdouble _r0 = (jdouble)r0; @@ -101,13 +101,13 @@ Java_go_structs_S_getY(JNIEnv *env, jobject this) { } JNIEXPORT void JNICALL -Java_go_structs_S2_M(JNIEnv* env, jobject this) { +Java_go_structs_S2_m(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(env, this); proxystructs_S2_M(o); } JNIEXPORT jstring JNICALL -Java_go_structs_S2_String(JNIEnv* env, jobject this) { +Java_go_structs_S2_string(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(env, this); nstring r0 = proxystructs_S2_String(o); jstring _r0 = go_seq_to_java_string(env, r0); @@ -115,7 +115,7 @@ Java_go_structs_S2_String(JNIEnv* env, jobject this) { } JNIEXPORT void JNICALL -Java_go_structs_Structs_00024proxyI_M(JNIEnv* env, jobject this) { +Java_go_structs_Structs_00024proxyI_m(JNIEnv* env, jobject this) { int32_t o = go_seq_to_refnum(env, this); proxystructs_I_M(o); } diff --git a/bind/testdata/structs.java.golden b/bind/testdata/structs.java.golden index 2b5a877..a83eb72 100644 --- a/bind/testdata/structs.java.golden +++ b/bind/testdata/structs.java.golden @@ -15,8 +15,8 @@ public final class S extends Seq.Proxy { public final native double getY(); public final native void setY(double v); - public native S Identity() throws Exception; - public native double Sum(); + public native S identity() throws Exception; + public native double sum(); @Override public boolean equals(Object o) { if (o == null || !(o instanceof S)) { return false; @@ -59,8 +59,8 @@ import go.Seq; public final class S2 extends Seq.Proxy implements I { private S2(go.Seq.Ref ref) { super(ref); } - public native void M(); - public native String String(); + public native void m(); + public native String string(); @Override public boolean equals(Object o) { if (o == null || !(o instanceof S2)) { return false; @@ -74,7 +74,7 @@ public final class S2 extends Seq.Proxy implements I { } @Override public String toString() { - return String(); + return string(); } } @@ -87,7 +87,7 @@ package go.structs; import go.Seq; public interface I { - public void M(); + public void m(); } @@ -102,7 +102,7 @@ import go.Seq; public abstract class Structs { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Structs() {} // uninstantiable @@ -110,15 +110,15 @@ public abstract class Structs { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyI extends Seq.Proxy implements I { proxyI(Seq.Ref ref) { super(ref); } - public native void M(); + public native void m(); } - public static native S Identity(S s); - public static native S IdentityWithError(S s) throws Exception; + public static native S identity(S s); + public static native S identityWithError(S s) throws Exception; } diff --git a/bind/testdata/try.java.c.golden b/bind/testdata/try.java.c.golden index f83c963..ab00426 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_init(JNIEnv *env, jclass _unused) { +Java_go_try__Try__1init(JNIEnv *env, jclass _unused) { jclass clazz; } JNIEXPORT jstring JNICALL -Java_go_try__Try_This(JNIEnv* env, jclass clazz) { +Java_go_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 940e67c..044e424 100644 --- a/bind/testdata/try.java.golden +++ b/bind/testdata/try.java.golden @@ -9,7 +9,7 @@ import go.Seq; public abstract class Try { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Try() {} // uninstantiable @@ -17,9 +17,9 @@ public abstract class Try { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); - public static native String This(); + public static native String this_(); } diff --git a/bind/testdata/vars.java.c.golden b/bind/testdata/vars.java.c.golden index 8bbdce1..dd690bc 100644 --- a/bind/testdata/vars.java.c.golden +++ b/bind/testdata/vars.java.c.golden @@ -15,7 +15,7 @@ jclass proxy_class_vars_S; jmethodID proxy_class_vars_S_cons; JNIEXPORT void JNICALL -Java_go_vars_Vars_init(JNIEnv *env, jclass _unused) { +Java_go_vars_Vars__1init(JNIEnv *env, jclass _unused) { jclass clazz; clazz = (*env)->FindClass(env, "go/vars/S"); proxy_class_vars_S = (*env)->NewGlobalRef(env, clazz); diff --git a/bind/testdata/vars.java.golden b/bind/testdata/vars.java.golden index a7af2db..f8d1f27 100644 --- a/bind/testdata/vars.java.golden +++ b/bind/testdata/vars.java.golden @@ -51,7 +51,7 @@ import go.Seq; public abstract class Vars { static { Seq.touch(); // for loading the native library - init(); + _init(); } private Vars() {} // uninstantiable @@ -59,7 +59,7 @@ public abstract class Vars { // touch is called from other bound packages to initialize this package public static void touch() {} - private static native void init(); + private static native void _init(); private static final class proxyI extends Seq.Proxy implements I { proxyI(Seq.Ref ref) { super(ref); } diff --git a/bind/testpkg/testpkg.go b/bind/testpkg/testpkg.go index 881a832..0df80e4 100644 --- a/bind/testpkg/testpkg.go +++ b/bind/testpkg/testpkg.go @@ -523,3 +523,13 @@ func EmptyError() error { func CallEmptyError(c EmptyErrorer) error { return c.EmptyError() } + +func Init() {} + +type InitCaller struct{} + +func NewInitCaller() *InitCaller { + return new(InitCaller) +} + +func (ic *InitCaller) Init() {}