THRIFT-670. java: Unions don't skip unrecognizable fields correctly
This patch adds a test and a fix for the bug.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@894924 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index 6731e5e..9cdb16d 100644
--- a/test/DebugProtoTest.thrift
+++ b/test/DebugProtoTest.thrift
@@ -299,6 +299,14 @@
6: SomeEnum enum_field;
}
+union TestUnionMinusStringField {
+ 2: i32 i32_field;
+ 3: OneOfEach struct_field;
+ 4: list<RandomStuff> struct_list;
+ 5: i32 other_i32_field;
+ 6: SomeEnum enum_field;
+}
+
union ComparableUnion {
1: string string_field;
2: binary binary_field;