Issue Details (XML | Word | Printable)

Key: THRIFT-409
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Bryan Duxbury
Reporter: Bryan Duxbury
Votes: 0
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Thrift

Add "union" to Thrift

Created: 26/Mar/09 06:06 PM   Updated: 01/Sep/09 11:04 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.2

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works one_rule.diff 2009-04-15 09:49 PM David Reiss 2 kB
Text File Licensed for inclusion in ASF works thrift-409-v2.patch 2009-07-29 06:12 PM Bryan Duxbury 33 kB
Text File Licensed for inclusion in ASF works thrift-409-v3.patch 2009-07-29 06:44 PM Bryan Duxbury 31 kB
Text File Licensed for inclusion in ASF works thrift-409-v4.patch 2009-08-05 07:20 PM Bryan Duxbury 32 kB
Text File Licensed for inclusion in ASF works thrift-409-v5.patch 2009-08-08 12:48 AM Bryan Duxbury 34 kB
Text File Licensed for inclusion in ASF works thrift-409-v6.patch 2009-08-11 10:52 PM Bryan Duxbury 35 kB
Text File Licensed for inclusion in ASF works thrift-409-v7.patch 2009-08-12 05:01 PM Bryan Duxbury 36 kB
Text File Licensed for inclusion in ASF works thrift-409-v8.patch 2009-08-26 08:01 PM Bryan Duxbury 36 kB
Text File Licensed for inclusion in ASF works thrift-409-v9.patch 2009-09-01 10:08 PM Bryan Duxbury 36 kB
Text File Licensed for inclusion in ASF works thrift-409.patch 2009-04-15 08:37 PM Bryan Duxbury 31 kB

Patch Info: Patch Available
Resolution Date: 01/Sep/09 11:04 PM


 Description  « Hide
It would be very helpful to have a "union" construct in Thrift. Let's decide on the design and then break up into sub-issues to add this feature.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #810300 Tue Sep 01 23:03:47 UTC 2009 bryanduxbury THRIFT-409. java: Add "union" to Thrift

This patch introduces new IDL syntax for creating Unions, explicityly single-valued structs. While the parser changes are portable, this patch only includes the actual generated code changes for the Java library. Other libraries can continue to generate a struct with the same fields and remain compatible until they are able to implement the full shebang.
Files Changed
MODIFY /incubator/thrift/trunk/compiler/cpp/src/thrifty.yy
MODIFY /incubator/thrift/trunk/lib/java/src/org/apache/thrift/TBase.java
MODIFY /incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
MODIFY /incubator/thrift/trunk/test/DebugProtoTest.thrift
MODIFY /incubator/thrift/trunk/lib/java/build.xml
MODIFY /incubator/thrift/trunk/compiler/cpp/src/parse/t_struct.h
ADD /incubator/thrift/trunk/lib/java/src/org/apache/thrift/TUnion.java
MODIFY /incubator/thrift/trunk/compiler/cpp/src/generate/t_generator.cc
MODIFY /incubator/thrift/trunk/compiler/cpp/src/thriftl.ll
ADD /incubator/thrift/trunk/lib/java/test/org/apache/thrift/test/UnionTest.java