bind: support types with the same title name as their packages

If a Go struct or interface has the same name as its package class,
append an underscore to the generated Java class name.

Fixes golang/go#23327.

Change-Id: Ib680af35c956801073a0effb510a3ed9bbb8b9d1
Reviewed-on: https://go-review.googlesource.com/87656
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Elias Naur
2018-01-17 09:45:22 +00:00
parent 02851653b1
commit 0879aa9afa
19 changed files with 315 additions and 22 deletions
+9
View File
@@ -588,4 +588,13 @@ public class SeqTest extends InstrumentationTestCase {
public void testTags() {
assertEquals("Constant from a tagged file", 42, Testpkg.TaggedConst);
}
public void testClassNameWithPackageName() {
testpkg.Testpkg_ o = new secondpkg.Secondpkg_();
secondpkg.Secondpkg_ o2 = Secondpkg.newSecondpkg();
o2.m();
o2.setV("hi");
assertEquals(o2.getV(), "hi");
Testpkg.clashingParameterFromOtherPackage(o2);
}
}