Commit Graph

923 Commits

Author SHA1 Message Date
Bryan Duxbury
137fea686e THRIFT-1120. csharp: proto.WriteListEnd being called in the wrong place
Patch: guoyunfeng

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1086260 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 14:52:25 +00:00
Bryan Duxbury
3cf5daf9cf THRIFT-1111. html: The HTML generator does not distinguish between string and binary types
Patch: Adrian Muraru

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1085480 13f79535-47bb-0310-9956-ffa450edef68
2011-03-25 17:28:19 +00:00
Bryan Duxbury
1709d40b4f THRIFT-1107. py: improvement for compiler-generated python for 'None' object comparisons
This patch switches from 'x != None' to 'x is not None' for a small performance boost.

Patch: Will Pierce

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1084661 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 18:15:19 +00:00
Bryan Duxbury
f51a4ce89e THRIFT-1105. ocaml: OCaml generator does not prefix methods of included structs with their type
This patch fixes the ocaml generator to generate good code when the 'include' Thrift IDL directive is used.

Patch: Joel Raymont

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1084654 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 17:57:21 +00:00
Bryan Duxbury
ee7c7bb485 THRIFT-1050. java: Declaring an argument named 'manager' to a service method produces code that fails compile due to name conflicts with protected ivars in TAsyncClient
This patch adds a triple-underscore prefix to all the ivars in TAsyncClient, making it substantially more difficult to get a conflict.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1081868 13f79535-47bb-0310-9956-ffa450edef68
2011-03-15 17:25:23 +00:00
Bryan Duxbury
c9929306ba THRIFT-1092. py: generated validate() method has wrong indentation
Patch: Will Pierce

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1081862 13f79535-47bb-0310-9956-ffa450edef68
2011-03-15 17:10:15 +00:00
Roger Meier
da6e6ae918 THRIFT-1089 JavaScript Quality Assurance with lint
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1081707 13f79535-47bb-0310-9956-ffa450edef68
2011-03-15 09:55:33 +00:00
Roger Meier
8430d50c8f THRIFT-1014 JavaScript gjslint compatibility (only line too long warnings)
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1080553 13f79535-47bb-0310-9956-ffa450edef68
2011-03-11 12:38:54 +00:00
Bryan Duxbury
a6d31c57f0 THRIFT-627. cpp: should c++ have setters for optional fields?
Yes, it should.

Patch: Jake Farrell

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1080303 13f79535-47bb-0310-9956-ffa450edef68
2011-03-10 18:14:14 +00:00
Bryan Duxbury
bdca9f667f THRIFT-1069. general: Add command line option to prevent thrift from inserting gen-* directories
This patch adds a -out switch that allows for an absolute path to be set for outputting generated code.

Patch: Jake Farrell

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1076000 13f79535-47bb-0310-9956-ffa450edef68
2011-03-01 19:53:07 +00:00
Bryan Duxbury
ef6cbfd1ab THRIFT-1011. as3: Error generating package imports when using classes from other packages
Patch: Usman Ismail

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1075916 13f79535-47bb-0310-9956-ffa450edef68
2011-03-01 16:57:34 +00:00
Roger Meier
9db5e50b42 THRIFT-1070 C++ compiler and runtime have 32/64bit problems
Patch: Rich Salz


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1075121 13f79535-47bb-0310-9956-ffa450edef68
2011-02-27 19:24:45 +00:00
Christian Lavoie
afc6d8f650 THRIFT-625: Add support for 'Go'; provided by Aalok Shah.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1072478 13f79535-47bb-0310-9956-ffa450edef68
2011-02-20 02:39:19 +00:00
Roger Meier
dd0c328a45 THRIFT-1045 Support "included"ed thrift files
Patch: Henrique Mendonca


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1071366 13f79535-47bb-0310-9956-ffa450edef68
2011-02-16 19:25:05 +00:00
Bryan Duxbury
0fd37f0871 THRIFT-447. java: Make an abstract base Client class so we can generate less code
This patch introduces a handful of abstract, non-generated classes that allow us to generate much less code for service implementations.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1068487 13f79535-47bb-0310-9956-ffa450edef68
2011-02-08 17:26:37 +00:00
Christian Lavoie
b547141797 Apply THRIFT-993's patch from Rich Salz (reverting the oneway caching):
(THRIFT-993) Some improvements in C++ stubs for oneway operations



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1064303 13f79535-47bb-0310-9956-ffa450edef68
2011-01-27 21:05:45 +00:00
Bryan Duxbury
c8d533b65e THRIFT-1038. java: Generated Java code for structures containing binary fields (or collections thereof) are not serializable (in the Java sense) even though they implement java.io.Serializable
This patch causes Java Serialized Thrift structs to be serialized onto the stream via the Compact Protocol.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1063907 13f79535-47bb-0310-9956-ffa450edef68
2011-01-26 22:42:02 +00:00
Bryan Duxbury
d94cb081a1 THRIFT-998. java: Using valueOf for base types in getFieldValue
valueOf saves us on memory for 'small' primitive types and costs us nothing in other situations, so it's an all-around win.

Patch: Takashi Yonebayashi

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1063818 13f79535-47bb-0310-9956-ffa450edef68
2011-01-26 18:29:33 +00:00
Roger Meier
a99c7505e0 THRIFT-1036 Auto-generated C++ code fails to compile with "-Werror -Wextra -Wall" g++ compiler flags
Patch: Pavlin Radoslavov


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1062352 13f79535-47bb-0310-9956-ffa450edef68
2011-01-23 09:35:45 +00:00
Roger Meier
afb0c7f374 THRIFT-1045 Support "included"ed thrift files
Patch: Wade Simmons


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1062281 13f79535-47bb-0310-9956-ffa450edef68
2011-01-22 21:43:59 +00:00
Roger Meier
90443f4e11 THRIFT-1044 Fix JavaScript inheritance
Patch Wade Simmons


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1062279 13f79535-47bb-0310-9956-ffa450edef68
2011-01-22 21:35:48 +00:00
Roger Meier
4b3f1c3181 THRIFT-1043 Fix how the length of a map is calculated
Patch: Wade Simmons


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1062278 13f79535-47bb-0310-9956-ffa450edef68
2011-01-22 21:32:50 +00:00
Bryan Duxbury
fad8d6b109 THRIFT-125. OCaml libraries don't compile with 32-bit ocaml
Patch: Iain Proctor and John Bilings

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1058270 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 18:41:52 +00:00
T Jake Luciani
0c124bb94f THRIFT-1033: node.js target and lib
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1056613 13f79535-47bb-0310-9956-ffa450edef68
2011-01-08 03:49:16 +00:00
Roger Meier
e0cac988b6 THRIFT-1022 Typo cleanup patch
Patch: Anatol Pomozov


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1049968 13f79535-47bb-0310-9956-ffa450edef68
2010-12-16 13:15:49 +00:00
Bryan Duxbury
ed2dc5359e THRIFT-1020. ocaml: OCaml compiler generates invalid OCaml
This patch resolves problems with double constants and adds a copy method to generated structs.

Patch: Richard Low

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1045320 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 19:17:22 +00:00
Bryan Duxbury
932ce2b80a THRIFT-1013. java: generated java code may have name clashes with thrift library
This patch removes the imports for Thrift library classes and fully qualifies all references, guaranteeing there won't be any name clashes.

Patch: Peter Schuller

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1043156 13f79535-47bb-0310-9956-ffa450edef68
2010-12-07 18:28:48 +00:00
Roger Meier
26f817a0c9 THRIFT-1010 Fix typo asigned -> assigned
Patch: Anatol Pomozov


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1040732 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30 19:46:56 +00:00
Roger Meier
6eeb21e917 THRIFT-1002 CodeStyle: t_c_glib_generator.cc
Patch: 	Anatol Pomozov


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1040415 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30 05:54:53 +00:00
Bryan Duxbury
a5eb848930 THRIFT-1008. java: byte[] accessors throw NPE on unset field
Further extra null check in accessors that use TBaseHelper.rightSize().

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038850 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24 22:30:38 +00:00
Christian Lavoie
af65f1b478 THRIFT-916: Commit a partial fix for flex-generated code infested with warnings on Mac OS X
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038844 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24 21:58:05 +00:00
Bryan Duxbury
1606f25616 THRIFT-1006. java: Impossible to correctly qualify an enum constant in an external thrift file
Be a little more sensitive to how we parse out dots; some java generator changes to make sure things stay consistent.

THRIFT-1005. java: Give unions byte[] signature methods to go along with their ByteBuffer counterparts

Some new constructors, getters, and setters to ease migration of unions to ByteBuffer style.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038399 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24 00:25:57 +00:00
Roger Meier
3b771a10f1 THRIFT-916 compile with -Wall -Wextra without warning on Debian Lenny
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1036250 13f79535-47bb-0310-9956-ffa450edef68
2010-11-17 22:11:26 +00:00
Roger Meier
be87ab28b0 THRIFT-992 add underline for fields
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1033715 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10 21:19:36 +00:00
Christian Lavoie
77215d8a35 THRIFT-916: Fix warnings in C++ when compiling with -Wall. In this case, in the flex output, in the new c_glib generator and an actual bug in the parser that couldn't actually trigger.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1032365 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07 19:42:48 +00:00
Christian Lavoie
600a88c6e2 THRIFT-991: Refactor Haskell code and generator. Part 1: clean up code generator style.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1032342 13f79535-47bb-0310-9956-ffa450edef68
2010-11-07 18:37:11 +00:00
Christian Lavoie
ae7f7fa57f THRIFT-950: Haskell bindings treat 'byte' as unsigned 8-bit int (Data.Word.Word8), java/cpp as signed (byte/int8_t). Fix Haskell.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1030243 13f79535-47bb-0310-9956-ffa450edef68
2010-11-02 21:42:53 +00:00
Roger Meier
213a664798 THRIFT-582 C(c_glib) implementation of Thrift
Patch: Anatol Pomozov and Michael Lum


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1027933 13f79535-47bb-0310-9956-ffa450edef68
2010-10-27 12:30:11 +00:00
Roger Meier
5e64d51efc THRIFT-916 t_java_generator.cc: remove compiler warnings for enumerations not handled in switch
Patch: Christian Lavoie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1023317 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 15:54:36 +00:00
Roger Meier
421dfbea63 THRIFT-807 JavaScript: Initialization of Base Types with 0 instead of null
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1023073 13f79535-47bb-0310-9956-ffa450edef68
2010-10-15 19:12:44 +00:00
Roger Meier
3b76fa3638 THRIFT-955 remove CharLowerBuff function for mingw based Thrift Compiler
=> no lowercase names and directories which was inconsistent for using across different platforms



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1022630 13f79535-47bb-0310-9956-ffa450edef68
2010-10-14 17:56:03 +00:00
Roger Meier
0069cc4a29 THRIFT-916 no errors on GNU/Linux when compiling with CXXFLAGS="-Wall -Wextra -pedantic"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1022220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-13 18:10:18 +00:00
Bryan Duxbury
b3d0aa0c82 THRIFT-946. java: Augment FieldValueMetaData so it differentiates 'string' and 'binary' fields.
This patch adds a new method to the FieldMetaData class that indicates binary or not.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 20:00:03 +00:00
David Reiss
ef6a1766ce THRIFT-927. php: Option to support modifying the PHP include path
Make the PHP generator recognize a new-style namespace called "php.path".
If it is present, it is segmented and used as a path to include the
generated code.  (It goes between "packages" and the Thrit file basename.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005172 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:55 +00:00
David Reiss
44ff76f514 THRIFT-925. cpp: Add _VALUES_TO_NAMES enum map
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005143 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:15 +00:00
David Reiss
64637511d2 THRIFT-924. php: Fix missing comma in generated PHP struct constants
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005142 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:13 +00:00
David Reiss
c3b3622158 THRIFT-922. cpp: Add profiling code to help conversion to C++ templates
Add some profiling code to track when potentially unnecessary virtual
calls are made in the thrift C++ serialization and deserialization code.
This can be used to help service implementors determine which places in
their code should be updated to use an appropriate thrift template
class.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005140 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:10 +00:00
David Reiss
2324871334 THRIFT-928. cpp: Thrift Server Client Stats
Add the ability for Thrift servers to monitor client connections.  It is
activated by #including server/TClientInfo.h and creating 1) a
TClientInfoCallHandler passed to the processor with setEventHandler()
and 2) a TClientInforServerHandler passed to the server with
setServerEventHandler().

The result vector, showing active connections, provides client address
and the thrift call it is executing (or last executed), the time
connected, and the number of calls made since connection.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005139 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:08 +00:00
David Reiss
b7762a032a THRIFT-922. cpp: Update C++ generator to emit templatized code
When the "templates" option is passed to the C++ generator, it now emits
templatized versions of the client and processor.  Generated types emit
templatized read() and write() functions.

This allows the generated code to invoke the correct non-virtual
TTransport and TProtocol implementations, resulting in faster
serialization and deserialization.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005138 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:00 +00:00
David Reiss
c6b4cab89c THRIFT-923. cpp: Add completion notification to async clients
Add a virtual function "completed__(bool)" to xxxCobClient that is
called by recv_xxx() after reception of a response (arg = true) or an
exception (arg = false). This allows the TAsyncClient to intercede at
that point, permitting, e.g., the load-balancing of persistent
connections that would otherwise remain bound to a single server.

A new "no_client_completion" flag inhibits generation of this mechanism.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005131 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:45 +00:00
David Reiss
f62126dbb3 THRIFT-928. cpp: Prefix function name with service name
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005130 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:43 +00:00
David Reiss
ef7200f6e8 THRIFT-928. cpp: Include request/response size in processor callbacks
Required updating transport interface.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005129 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:42 +00:00
David Reiss
18cd0f0334 THRIFT-928. cpp: Make clients call writeEnd on their transports before flush
Changing the order of these calls makes more sense from the perspective
of logical operations.  It also simplifies the upcoming stats collection
code.  No clients should be affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005128 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:39 +00:00
David Reiss
5ddabb8e3f THRIFT-923. cpp: Implement a fully nonblocking server and client
There are three major parts of this:
1/ New callback-style interfaces for for a few key Thrift components:
   TAsyncProcessor for servers and TAsyncChannel for clients.
2/ Concrete implementations of TAsyncChannel and a server for
   TAsyncProcessor based on evhttp.
3/ Async-style code generation for C++

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005127 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:37 +00:00
David Reiss
d7192063e1 THRIFT-928. cpp: Processor-level event callbacks
- Add a TProcessorEventHandler callback interface.
- Add methods to TProcessor to hold an instance of the interface.
- Add code to the compiler to make the processor call callbacks at key points.
- Add an optional processor event handler to the test server.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005126 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:33 +00:00
Bryan Duxbury
1df96ce22f THRIFT-945. java: TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.
This patch adds a test for the problem and fixes the issue by setting the current method after a call has been started.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004865 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:28:10 +00:00
David Reiss
41d3058dbf THRIFT-868. Make const values work properly with typdefs
Just requires calling get_true_type in the right spot.  Because "the
right spot" is under src/parse, get_true_type had to be moed from
t_generator to t_type.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004703 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 16:39:29 +00:00
David Reiss
9e7ba8cbac compiler: Move t_type::generate_fingerprint to a .cc file
Forcing all of the functions under src/parse to be defined in header
files is silly and sometimes painful.  Createa a "parse.cc" file for
functions that don't belong in header files.  To start, move
generate_fingerprint there, because it requires including md5.h.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004702 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 16:39:27 +00:00
Bryan Duxbury
a406b90fa2 THRIFT-787. compiler: Enums are not read correctly
This patch removes unnecessary enum value resolution code from all the individual generators. It's been unnecessary since forever ago when we made the compiler force the global resolution of values.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001966 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 23:37:44 +00:00
Anthony F. Molinaro
71a58a8764 THRIFT-918 : better haskell tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001883 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 19:27:40 +00:00
Anthony F. Molinaro
daef1c8ed0 THRIFT-743: seems to compile and doesn't break other tests, so seems fine for now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001353 13f79535-47bb-0310-9956-ffa450edef68
2010-09-26 04:25:36 +00:00
T Jake Luciani
6461d56d02 THRIFT-911: fix for trailing commas in sets, lists, maps, consts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999728 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 02:33:06 +00:00
Bryan Duxbury
75a33e858f THRIFT-906. hs: Improve type mappings
This patch fixes the type mappings to be more sane. It *will* break existing code, but the breakages should be well worth it.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999700 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 00:48:56 +00:00
Bryan Duxbury
1237dcb099 THRIFT-880. javame: JavaME code generator and runtime library
This patch adds a new generator and library that produces code suitable for use in JavaME environments.

Patch: David Engberg

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999022 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:49:09 +00:00
Bryan Duxbury
f38b2f10fb THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
Forgot a small chunk of the previous patch.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999019 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:41:40 +00:00
Bryan Duxbury
e59a80fbf9 THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
This patch makes the bindings compile with pedantic warning levels, and individually declares each required language extension.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998955 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 15:21:37 +00:00
Bryan Duxbury
d920765c66 THRIFT-882. java: deep copy of binary fields does not copy ByteBuffer characteristics (arrayOffset, position)
This patch ensures that binary fields are copied correctly.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998275 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 19:27:36 +00:00
David Reiss
bdd6261b33 Fix enum value lookups in C++
The recent enum change was causing enums to break if used as constant
values by the C++ generator.  The problem was that we were searching for
the fully-qualified constant name (enum_name.VALUE_NAME) in the enum
values.  This didn't affect Java because it just uses symbolic names in
the generated code.  Fix it by grabbing the base name before doing the
search.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996610 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:14 +00:00
David Reiss
8d7667c27f Don't segfault if t_enum::get_constant_by_name fails
The recent enum change was causing t_enum::get_constant_by_name to fail
in t_const_value::get_integer.  This was causing a difficult-to-debug
segfault.  Check for failure and throw an exeception.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996609 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:13 +00:00
Bryan Duxbury
d4235e0a47 THRIFT-870. java: Java constants don't get Javadoc comments
Fix a trivial oversight.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996592 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 16:28:53 +00:00
Bryan Duxbury
a7420b6593 THRIFT-894. java: Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version
This patch causes the underlying ByteBuffer that backs a binary field to be hidden behind a default accessor that provides a byte[] interface. This should allow users who skipped 0.4 to update their generated code without breaking any of their other code. A new accessor has been added that allows a way down to the underlying ByteBuffer for those experts who want to take advantage.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996579 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 15:42:36 +00:00
Bryan Duxbury
76ecb91c3d THRIFT-897. compiler: Don't allow unqualified enum constant access
Fix some confusion in the java generator about adding the class name.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996327 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:29:38 +00:00
Bryan Duxbury
cb0218f5c8 THRIFT-897. compiler: Don't allow unqualified enum constant references
Missed a spot.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996325 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:22:21 +00:00
Bryan Duxbury
9f0a786dad THRIFT-897. compiler: Don't allow unqualified constant access to enum values
This patch makes it illegal to refer to enum values by just their names in the IDL. Now, you must also provide the enum type's name as well.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996320 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 14:38:36 +00:00
David Reiss
b6c50e5658 THRIFT-895. cpp: By default, generate enums as class-scoped enums
Most of the other Thrift languages either have enum values that are
scoped to the type or emulate enums in that way.  Now C++ does the same
by default.  "enum Foo" in a .thrift file will be generated as Foo::type
so the values can be called Foo::value1, etc.  The "pure_enums" compiler
option restores the old behavior.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996015 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 23:00:40 +00:00
Bryan Duxbury
04650afb87 THRIFT-544. erl: multiple enums with the same key generate invalid code
This adds the enum name to the generated constants to avoid collisions.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995924 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 18:49:53 +00:00
Bryan Duxbury
bbff4a8e7e Fix to the catch-all namespace commit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992458 13f79535-47bb-0310-9956-ffa450edef68
2010-09-03 20:36:02 +00:00
David Reiss
fb790d7262 Allow "*" as a catch-all namespace.
In an IDL file, you can can now declare "namespace * foo",
which will apply to any language not explicitly specified.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992012 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 16:41:45 +00:00
Bryan Duxbury
c377c32168 THRIFT-257. py: Support validation of required fields
Patch: Esteve Fernandez

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991987 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 15:37:19 +00:00
Bryan Duxbury
c43ec6247a THRIFT-634. csharp: C# Compiler Generates Incorrect Code For Fields which begin with an uppercase letter
Added a '_' to the backing field, and changed all the field references to refer to the property instead.

Patch: Jon S Akhtar

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991960 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:58:51 +00:00
Bryan Duxbury
1316ed9d16 THRIFT-673. py: Generated Python code has whitespace issues
This patch trims several forms of trailing whitespace.

Patch: Ian Eure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991945 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:20:01 +00:00
Bryan Duxbury
727d67dcfa THRIFT-721. py: THttpClient ignores url parameters
Respect query string in THttpClient and generated remotes. Also, add an error message on unknown methods.

Patch: Thomas Kho

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991786 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 01:00:19 +00:00
Bryan Duxbury
773b8dbf30 THRIFT-805. cocoa: Don't generate process_XXXX methods for oneway methods
Patch: Brad Taylor

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991783 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:43:16 +00:00
Bryan Duxbury
e02d6118bf THRIFT-838. cocoa: Generated Cocoa classes have useless @dynamic declarations
This patch removes the @dynamic properties.

Patch: Kevin Ballard

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991779 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:29:08 +00:00
Bryan Duxbury
cd9f200b9d THRIFT-884. html: HTML Generator: add Key attribute to the Data Types Tables
This patch adds the Key attribute to the Data Types Tables.

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991775 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:12:22 +00:00
Bryan Duxbury
0f4078dbf5 THRIFT-860. ocaml: copy method and reset method
The attached patch provides the class copying and reset-to-default values methods.

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991774 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:07:20 +00:00
David Reiss
5ad126044d THRIFT-874. Include missing time.h in two compiler files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991255 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:30 +00:00
David Reiss
4563acdd23 THRIFT-865. Make Thrift buildable without libfl
yywrap is only needed if we need one lexer context to traverse multiple
input files.  This feature isn't used by Thrift, so we disable it with
"option noyywrap".  With yywrap disabled, there is no need to link to
libfl if flex is the lex implementation used.

With this patch, release tarballs can be built without lex.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991254 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:29 +00:00
David Reiss
ef5e81b1ac THRIFT-507. Only use Boost for building the C++ library
- Make AX_BOOST_BASE warn instead of fataling if Boost is not found.
- If Boost is not found, disable compilation of the C++ library.
- Do not use CPPFLAGS or LDFLAGS from Boost when building the compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991253 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:28 +00:00
David Reiss
aca320d395 THRIFT-507. Stop using boost::lexical_cast in the compiler
We were using boost::lexical_cast to convert an integer to a string,
but using a stringstream is only slightly more complicated.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991252 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:26 +00:00
David Reiss
38f8959779 THRIFT-507. ruby: Stop using boost::tokenizer
Previously, the Ruby generated used boost::tokenizer to produce a
vector of namespace components from a dot-delimited namespace string.
We can do this manually with only a slight increase in complexity.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991251 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:25 +00:00
David Reiss
bfab32a3b3 THRIFT-507. smalltalk: Remove an unnecessary include (boost/tokenizer)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991250 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:24 +00:00
David Reiss
eb207273ea erlang: Make the gen-code return a special value for bogus functions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990978 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:27 +00:00
David Reiss
f32d0fb900 Rollback a few recent Erlang changes to fix blame data
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data.  I'll recommit r987018 as a sequence of patches and r988722
as its own rev.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:00 +00:00
Bryan Duxbury
4d8a9cd569 THRIFT-877. compiler: smalltalk namespace doesn't work
This patch adds a special case to map 'smalltalk' to 'st' when checking for valid namespace declarations.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990866 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 17:09:58 +00:00
David Reiss
e3ba3490de Clean up some style from r987565
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@989948 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 21:49:45 +00:00
Bryan Duxbury
66467a7779 THRIFT-693. java: Thrift compiler generated java code that throws compiler warnings about deprecated methods.
This patch removes the deprecated methods from TBase and makes some generator changes to accommodate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987805 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 17:48:18 +00:00
Bryan Duxbury
c39817c9a7 THRIFT-859. py: Allow py:twisted to be generated in different namespace than py
This patch adds support for the 'twisted' sub-namespace to the python code generator.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987566 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:45:13 +00:00
Bryan Duxbury
681f5eae6d compiler: make a standard way for language generators to accept sub-namespaces
This patch adds a new method to t_generator that allows the compiler to avoid special cases in checking for sub-namespaces in the Thrift IDL.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987565 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:42:04 +00:00
Bryan Duxbury
d3879f80c6 THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients
The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.

Patch: David Reiss (assist to Anthony Molinaro)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 05:06:02 +00:00
Bryan Duxbury
4d0e2b48bf THRIFT-852. Missing newline causes many compiler warnings
This patch adds a newline to the end of t_generator_registry.h

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985771 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 22:57:07 +00:00
Bryan Duxbury
66c334792b THRIFT-827. ocaml: OCaml generator to take default values into account
A patch to the OCaml generator which uses default values defined in the .thrift file to initialize the members of the generated class. 

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985041 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:37:47 +00:00
David Reiss
e2350512c9 THRIFT-676. cpp: Move __isset definition for SWIG-compatibility
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984979 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 21:15:04 +00:00
Bryan Duxbury
07b2ed1df5 THRIFT-832. html: HTML generator shows unspecified struct fields as 'required'
This patch causes required/optional/default to reported appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984868 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 17:21:06 +00:00
Bryan Duxbury
34b530f099 THRIFT-570. Thrift compiler does not error when duplicate method names are present
This patch causes the compiler to throw an exception when duplicate method names are found.

Patch: Bruce Simpson

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984628 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 01:48:51 +00:00
Bryan Duxbury
f5abd26858 THRIFT-830. java: Switch binary field implementation from byte[] to ByteBuffer
This patch switches the implementation of binary fields to ByteBuffer in the Java generated code, yielding up to 2.5x speed boost.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982839 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 00:18:25 +00:00
Bryan Duxbury
7f3285eddb THRIFT-434. ruby compiler should warn when a reserved word is used
This patch adds a bunch of new reserved words to the lexer.

Patch: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982827 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:28:14 +00:00
Bryan Duxbury
8fc413fbfd THRIFT-554. multiple enums with the same key generate invalid code
This patch causes multiple enums with the same name to trigger a parser error.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982825 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:23:04 +00:00
Bryan Duxbury
20dbec7cfe THRIFT-782. perl: Perl code for writing containers doesn't count length of write*Begin or write*End
This patch adds appropriate accounting of the start and end bytes when writing out container types.
Patch: Conrad Hughes

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982812 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 22:28:13 +00:00
Bryan Duxbury
5226eeaaaa THRIFT-751. java: Add clear() method to TBase
This patch adds a clear() method to the TBase interface and causes the compiler to generate implementations.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982774 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 20:44:53 +00:00
Bryan Duxbury
c412a2fad4 THRIFT-133. add missing file to makefile.am
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982359 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04 18:51:57 +00:00
Bryan Duxbury
c687712d18 THRIFT-133. fix a small bug with smalltalk.prefix and smalltalk.package namespaces.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980538 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 18:39:06 +00:00
Bryan Duxbury
e0ac3abd53 THRIFT-133. 'namespace ruby' should error out, or be an alias to 'namespace rb'
This patch causes 'namespace ruby' (or any unrecognized generator name) to produce an error.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980498 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 16:24:41 +00:00
David Reiss
95c005a7c6 THRIFT-395. python: Add option to treat strings as UTF-8 unicode
Add the "utf8strings" option to the Python generator.  If set, all
Thrift strings (not binary) will be expected to be unicode objects, not
str.  They will be encoded as UTF-8 before serialization and decoded as
UTF-8 after deserialization.

The accelerator module for TBinaryProtocol is not affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@959516 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 05:36:25 +00:00
Bryan Duxbury
162b3ac646 THRFIT-804. java: CompareTo is broken for unions set to map, set, or list
This patch fixes TUnion's compareTo, and factors out the standard part of the comparison to TBaseHelper.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957350 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 21:17:48 +00:00
Bryan Duxbury
656683c776 THRIFT-808. Segfault when constant declaration references a struct field that doesn't exist
This patch causes a useful error to be printed instead of an anonymous segfault.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957270 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 16:57:51 +00:00
Bryan Duxbury
2e1aab5db7 THRIFT-767. rb: ruby compiler does not keep comments for enum values
This patch makes sure that we print an rdoc comment above each of the enum values.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957268 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 16:54:17 +00:00
Bryan Duxbury
d58ccec660 THRIFT-768. java: Async client for Java
This patch adds an implementation of a fully-asynchronous client that makes use of NIO. Stubs for the async method calls are generated along with the existing synchronous ones.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@948492 13f79535-47bb-0310-9956-ffa450edef68
2010-05-26 16:34:48 +00:00
Bryan Duxbury
c8ee35805d revert an unintentional commit to the java generator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940861 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 14:01:14 +00:00
Bryan Duxbury
a1e268c54b THRIFT-770. build: Get 'make dist' to work without first compiling source code
This patch ditches the old print_version.sh method and instead generates the compiler's version.h via the Makefile.

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940630 13f79535-47bb-0310-9956-ffa450edef68
2010-05-03 21:33:00 +00:00
Bryan Duxbury
6a68187338 THRIFT-647. php: PHP library is missing install target
This patch adds a 'make install' target to a new PHP makefile. 

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940325 13f79535-47bb-0310-9956-ffa450edef68
2010-05-02 22:39:31 +00:00
Bryan Duxbury
97d21c853d THRIFT-760. java: Generated client code does not set or check the sequence ID in messages
The Java generated clients weren't paying attention to sequence ids. Now they are\!

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@938169 13f79535-47bb-0310-9956-ffa450edef68
2010-04-26 18:16:46 +00:00
Bryan Duxbury
0137af6bf1 THRIFT-611. Under Windows when compiling using MinGW, includes are incorrectly resolved due to '/' <-> '\' havoc.
This patch ensures the proper slashes are used based on the platform.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@937070 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 21:21:46 +00:00
Bryan Duxbury
321eb7a2bd THRIFT-518. as3: Add the AS3 generator and library
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@937067 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 21:17:39 +00:00
Bryan Duxbury
15e2930ccf THRIFT-761. java: Include the symbolic name of a typedef field in the field metadata
This patch adds a new isTypedef() method to FieldValueMetaData and converts MetaDataTest to a testcase in TestStruct.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936588 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 01:05:02 +00:00
Bryan Duxbury
60229785cb THRIFT-763. java: Variable capture bug in generated struct compareTo
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936583 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 00:27:41 +00:00
Bryan Duxbury
0fab12e968 THRIFT-759. java: Make TBase implement Comparable
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936581 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 00:22:34 +00:00
Bryan Duxbury
49b38015a6 THRIFT-753. java: Don't look up TFieldIdEnum values with a map
Instead of using a generated map, use a big switch statement.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930618 13f79535-47bb-0310-9956-ffa450edef68
2010-04-04 04:01:07 +00:00
Bryan Duxbury
b1f7f7973b THRIFT-746. java: Generated services Iface/Client inner classes do not derive from base classes
This patch causes all generated Client classes to inherit from TServiceClient, an interface that provides a way to get the protocols the Client is using. Also, it causes a new TServiceClientFactory implementation to generated for each Service, which provides a generic, reflection-free way to get Clients. These changes make it easier to build generic pools of Client objects.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930601 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 23:19:52 +00:00
Bryan Duxbury
ea7910faf3 THRIFT-663. java: JavaBean code generator produces incorrect setter methods
This patch causes the beans option to suppress the builder-style setter methods. It also adds a new 'private-members' option that leaves the builder-style methods, but makes the actual instance variables private.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930474 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 05:04:48 +00:00
Bryan Duxbury
5557beffae THRIFT-723: java: Thrift buffers with set and map types in Java should implement Comparable
This makes structs that contain sets and maps in their hierarchy Comparable.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928944 13f79535-47bb-0310-9956-ffa450edef68
2010-03-29 23:57:09 +00:00
Bryan Duxbury
15b7b28794 THRIFT-701. java: Generated classes take up more space in jar than needed
Use a static {} block instead of an anonymous inner class to define metaDataMap. This saves some space in jars generated by avoiding the internal class.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@926466 13f79535-47bb-0310-9956-ffa450edef68
2010-03-23 05:39:18 +00:00
Bryan Duxbury
3f4ca0e8fd THRIFT-734. java: Can't use primitive types in service definitions for bean generated code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@923566 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 03:13:26 +00:00
David Reiss
ac110e4f1c cpp: Eliminate circular dependency between thrift libraries
Previously, Thrift.cpp contained TApplicationException, which was using
TProtocol methods, defined in TProtocol.h.  This caused a circular
dependency since libprotocol depends on Thrift.h.  This change moves
TApplicationException into its own file.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920682 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:20:07 +00:00
David Reiss
e574a065a9 THRIFT-660. php: Use the accelerator to write return values from servers
Previously, we only used the acclerator module for clients to
write calls and read returns.  Now PHP servers will use it for
writing returns.  We cannot use it to read calls on the server side
(without modifications), because the module requires that
the structure type be known before reading the message header.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920663 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:22 +00:00
David Reiss
4dd7801e90 THRIFT-655. Allow structs to be typedef'ed
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920657 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:08 +00:00
David Reiss
53c10e09e1 THRIFT-564. Support arbitrary annotations on struct fields
This is subtly different from a type annotation, since some bits of
metadata only make sense in the context of a single structure field,
like whether the field is required, or whether the C++ code should use
a pointer for it.

This change doesn't define any meaningful annotations.  It just sets up
the parsing infrastructure.

I have no idea if $10 will work with older versions of yacc.  It seems
to work fine with bison.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@919325 13f79535-47bb-0310-9956-ffa450edef68
2010-03-05 07:51:51 +00:00
Bryan Duxbury
4e7cf25b95 THRIFT-716. java: Field names can conflict with local variables in code for unions
This patch resolves the name clash issue by removing the unnecessary parameters from the generated method and using the protected variables directly instead.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@917130 13f79535-47bb-0310-9956-ffa450edef68
2010-02-28 05:19:38 +00:00
Bryan Duxbury
53cba3cfa2 THRIFT-689. java: Notify client of recoverable protocol errors on java server
When a protocol error occurs, the server will now send back a message containing the exception. Clients should be able to detect and rethrow these exceptions as appropriate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@916825 13f79535-47bb-0310-9956-ffa450edef68
2010-02-26 21:38:42 +00:00
Bryan Duxbury
dee6d4260c THRIFT-713. java: Java compareTo method throws NPE when any field isn't set.
This patch fixes a somewhat egregious bug in the generated compareTo for non-union structs and avoids possible NPEs.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@915499 13f79535-47bb-0310-9956-ffa450edef68
2010-02-23 19:06:25 +00:00
Bryan Duxbury
a34a4be080 remove an erroneously added newline in ruby generated structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911957 13f79535-47bb-0310-9956-ffa450edef68
2010-02-19 20:00:55 +00:00
Bryan Duxbury
39dadd6656 THRIFT-712. rb: Inspect should print binary fields as hex instead of escaped string
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911610 13f79535-47bb-0310-9956-ffa450edef68
2010-02-18 22:00:45 +00:00
Bryan Duxbury
0e4920c6b8 THRIFT-708. rb: Is set checking methods
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911557 13f79535-47bb-0310-9956-ffa450edef68
2010-02-18 20:28:27 +00:00
Bryan Duxbury
cd43a06405 THRIFT-703. Attempting to hash an unset union struct results in NPE
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911162 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 20:01:29 +00:00
Bryan Duxbury
33e190cd15 THRIFT-697. Union support in Ruby
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@910700 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 21:19:01 +00:00
T Jake Luciani
322caa2f92 THRIFT-550: Added javascript support
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@910158 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 03:24:55 +00:00
David Reiss
ba4bf4d512 THRIFT-691. haskell: Don't block required prelude definitions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@903393 13f79535-47bb-0310-9956-ffa450edef68
2010-01-26 20:06:36 +00:00
David Reiss
3bb5e0581a THRIFT-683. Remove profanity
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@902941 13f79535-47bb-0310-9956-ffa450edef68
2010-01-25 19:31:31 +00:00
Todd Lipcon
b6f4e56bb0 THRIFT-643. smalltalk: Generated code doesnt load on Squeak3.10.2-7179-basic and PharoCore-1.0-10491rc1 images
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@900660 13f79535-47bb-0310-9956-ffa450edef68
2010-01-19 05:18:55 +00:00
Bryan Duxbury
c4ad9be578 THRIFT-675. java: Generated findByValue() should just switch on value instead of mapping
This patch removes the map-based enum value lookup and replaces it with a static switch statement.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@899911 13f79535-47bb-0310-9956-ffa450edef68
2010-01-16 09:13:20 +00:00
Bryan Duxbury
9bfacd3680 THRIFT-678. html: HTML generator should include per-field docstrings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@899722 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 17:27:52 +00:00
Bryan Duxbury
55b38bc3af THRIFT-674. java: Generated read() should just switch directly on field.id
This patch gets rid of an unnecessary map lookup and null check in generated structs' read method, amounting a noticeable performance improvement.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@899721 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 17:20:04 +00:00
David Reiss
752529e9b4 THRIFT-560. haskell: Move to ByteString and compiler fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@898012 13f79535-47bb-0310-9956-ffa450edef68
2010-01-11 19:12:56 +00:00
Bryan Duxbury
c2ec7cae04 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
2009-12-31 18:59:15 +00:00
Bryan Duxbury
986d50fc71 THRIFT-668. java: Using a map in an exception type will generate a class that does not implement Comperable-> that will generate a stub that does not compile
The compiler was incorrectly assuming that exceptions were comparable. Now, exceptions are treated just like structs.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@894919 13f79535-47bb-0310-9956-ffa450edef68
2009-12-31 18:18:00 +00:00
Bryan Duxbury
2d80470bcb THRIFT-632. java: Constants of enum types don't behave well
This patch causes constants of all types to be resolved differently by the compiler, and makes it so that constants of enum types contain a reference to the enum type so that code generators can produce the correct names.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@892358 13f79535-47bb-0310-9956-ffa450edef68
2009-12-18 19:41:11 +00:00
Bryan Duxbury
e533bace3d THRIFT-653. java: Fix toString method for enums
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@892357 13f79535-47bb-0310-9956-ffa450edef68
2009-12-18 19:34:25 +00:00
Todd Lipcon
53ae9f39d5 THRIFT-622. Add appropriate licensing information to get Thrift ready for a release.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@887812 13f79535-47bb-0310-9956-ffa450edef68
2009-12-07 00:42:38 +00:00
Bryan Duxbury
9af23d9327 THRIFT-551. java: Enumeration doesn't generate real enum in Java
This patch makes the compiler generate actual Enum classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@882211 13f79535-47bb-0310-9956-ffa450edef68
2009-11-19 17:26:38 +00:00
Bryan Duxbury
e476480691 THRIFT-628. java: Hash code method for _Fields objects does not behave as expected
This patch switches to using the hashcode of the actual field id, instead of the field id enumeration.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@881559 13f79535-47bb-0310-9956-ffa450edef68
2009-11-17 21:56:43 +00:00
David Reiss
559a49f03c THRIFT-621. cpp: Fix generated files using "apache" namespaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@835739 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 04:52:10 +00:00
Bryan Duxbury
aa9fb5dc9d THRIFT-623. java: Use a Java enum to represent field ids in generated structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@835538 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 20:52:25 +00:00
Bryan Duxbury
e2e4ea1dcf THRIFT-624. java: compareTo is broken for Unions with binary fields
This patch adds a special case for byte[] values in TUnion. It also fixes a related bug in TBaseHelper for comparing two byte arrays.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@835065 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 21:01:35 +00:00
Bryan Duxbury
2845b16eb2 THRIFT-565. java: Structs containing typedefs for incomparable objects will be considered comparable
This patch causes the compiler to fully unwrap typedefs when determining comparability.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@834119 13f79535-47bb-0310-9956-ffa450edef68
2009-11-09 15:55:22 +00:00
Andrew McGeachie
3533dcbef8 THRIFT-613. Make generated objects implement the NSCoding protocol.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@832507 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 18:52:15 +00:00
Andrew McGeachie
72751724b5 THRIFT-521. Change @synthesize property declarations to @dynamic for happy compiling on OS X 10.6 as well as 10.5
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@830326 13f79535-47bb-0310-9956-ffa450edef68
2009-10-27 20:23:02 +00:00
David Reiss
8266e012c5 pynames
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@827893 13f79535-47bb-0310-9956-ffa450edef68
2009-10-21 06:09:16 +00:00
Bryan Duxbury
72fd472476 THRIFT-589. java: Add Field Name to Field ID Mapping
Java Thrift structs now have a static mapping of field name to field ID.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@825371 13f79535-47bb-0310-9956-ffa450edef68
2009-10-15 01:24:26 +00:00
Bryan Duxbury
364902eb56 THRIFT-529. java: Change generated constructors so that application code evolves better
Optional fields are now excluded from constructors.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@820857 13f79535-47bb-0310-9956-ffa450edef68
2009-10-02 00:56:53 +00:00
Bryan Duxbury
f18202fbd0 THRIFT-477. java: remove extra methods generated for collections
I have rolled back the patch originally applied in this issue.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@820831 13f79535-47bb-0310-9956-ffa450edef68
2009-10-01 22:52:25 +00:00
Bryan Duxbury
315a5dbe29 THRIFT-588. java: Generated .equals method throws NPE for thrift object
If other is null, then they're not equal.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@818998 13f79535-47bb-0310-9956-ffa450edef68
2009-09-25 20:28:35 +00:00
Bryan Duxbury
db40d26f4a THRIFT-572. java: Union compareTo is broken
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@817317 13f79535-47bb-0310-9956-ffa450edef68
2009-09-21 16:52:48 +00:00
Esteve Fernandez
0e8e6099e2 generate Twisted code in a separate directory (gen-py.twisted)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@816340 13f79535-47bb-0310-9956-ffa450edef68
2009-09-17 19:19:11 +00:00
David Reiss
bb97bef0a1 THRIFT-584. php: Generate a better directory structure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@815878 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 16:57:05 +00:00
David Reiss
a0bf2c1e08 THRIFT-583. python: Allow new-style classes for Interfaces
The original new-style class only affected structs, enums, and
exceptions.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@815874 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 16:50:00 +00:00
David Reiss
45603e9c6c THRIFT-575. Allow required fields in function parameters
r665255 was a bit too aggressive.  "optional" was causing confusion,
but there doesn't seem to be any harm in allowing "required".

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810713 13f79535-47bb-0310-9956-ffa450edef68
2009-09-02 22:15:55 +00:00
Bryan Duxbury
ab3666e6ca 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.




git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810300 13f79535-47bb-0310-9956-ffa450edef68
2009-09-01 23:03:47 +00:00
David Reiss
db5d589457 Minor whitespace fixes in the Java generator and gen-code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@810255 13f79535-47bb-0310-9956-ffa450edef68
2009-09-01 21:36:46 +00:00
David Reiss
af81de0123 Revert r806014 "THRIFT-562. java: Java is inconsistent ..."
- It changed the semantics of default-presence fields.
- It messed up calls that accept exceptions.
- Full details on issue.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@808609 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 20:27:09 +00:00
Bryan Duxbury
2c8cd944e5 THRIFT-562. java: Java is inconsistent checking for required fields
This patch makes the compiler act consistently regarding what it means to be required or optional. Additionally, it cleans up the tests to actually use the Fixtures class all over.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@806014 13f79535-47bb-0310-9956-ffa450edef68
2009-08-20 01:00:18 +00:00
Bryan Duxbury
c27cda57a0 THRIFT-558. java: Replace use of log4j by commons-logging in Java library and generated Java code
This patch switches Thrift to use slf4j instead of log4j. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@804349 13f79535-47bb-0310-9956-ffa450edef68
2009-08-14 20:04:15 +00:00
Mark Slee
f5a0b3dfc8 THRIFT-561: Add "register" to list of reserved keywords
Reviewed By: dreiss



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@803997 13f79535-47bb-0310-9956-ffa450edef68
2009-08-13 19:21:40 +00:00
Bryan Duxbury
3efce23369 THRIFT-115. java: Isset structure has a large memory footprint
Instead of the old __isset structure, there is now a bit vector for fields that require an isset flag. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@800510 13f79535-47bb-0310-9956-ffa450edef68
2009-08-03 19:37:26 +00:00
T Jake Luciani
4184e2be54 THRIFT-554: Perl improper namespace check for exception handling and writeMessageEnd missing on processor calls
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799484 13f79535-47bb-0310-9956-ffa450edef68
2009-07-31 01:31:00 +00:00
Bryan Duxbury
684b4f9aee THRIFT-144. java: Generated classes should implement Comparable
If generated structs don't contain any incomparable child members, they implement Comparable.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799474 13f79535-47bb-0310-9956-ffa450edef68
2009-07-31 00:12:21 +00:00
Bryan Duxbury
ba71f8c7fc THRIFT-540. java: Have set methods return reference to self
Issue title says it all, really.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799130 13f79535-47bb-0310-9956-ffa450edef68
2009-07-29 23:47:38 +00:00
Bryan Duxbury
3d5db203d5 THRIFT-479. java: Add javadocs for enum types
Fields now reference their enum class name in javadoc. Also, generated enum classes's members are now javadoc'd.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799128 13f79535-47bb-0310-9956-ffa450edef68
2009-07-29 23:44:44 +00:00
Bryan Duxbury
52297d5e2c THRIFT-477. java: remove extra methods generated for collections
This patch removes the special extra methods for collections.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799036 13f79535-47bb-0310-9956-ffa450edef68
2009-07-29 19:46:00 +00:00
David Reiss
c8e300533c THRIFT-413. Suppport for annotations on base types
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@798219 13f79535-47bb-0310-9956-ffa450edef68
2009-07-27 17:02:42 +00:00
Andrew McGeachie
0c8957114a THRIFT-280. Server-side Cocoa implementation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796538 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 21:14:19 +00:00
Andrew McGeachie
6efefc023a THRIFT-59. Make sure we don't over-release strings after we deserialize them.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796518 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 20:14:31 +00:00
Andrew McGeachie
38e1a10c0d THRIFT-545. Fix mem leak in generated 'description' method
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796391 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 17:22:03 +00:00
Andrew McGeachie
f2e03ba2e3 THRIFT-521. Generate objective-c 2.0 propery declarations on iphone and OS X 10.5 and greater.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796377 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 16:51:49 +00:00
Andrew McGeachie
7564925daa THRIFT-520. Fix generation of cocoa constants when a namespace prefix is set.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796356 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 16:12:33 +00:00
Andrew McGeachie
645d7b8d50 THRIFT-344. Add a 'log_unexpected' option to the cocoa generator. off by default. when supplied, unexpected field IDs and types are logged when reading a struct.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796347 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 15:30:16 +00:00
Andrew McGeachie
6db89f2978 THRIFT-343. Import <Foundation/Foundation.h> instead of <Cocoa/Cocoa.h> to support iPhone
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796327 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 14:45:12 +00:00
Andrew McGeachie
330cfc13bc THRIFT-59. Fix memory leak by releasing allocated objects after assigning to container.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@796320 13f79535-47bb-0310-9956-ffa450edef68
2009-07-21 14:33:17 +00:00
T Jake Luciani
f1fd2954b5 THRIFT-542: Perl compiler uses invalid method 'method_exists' and subsequent test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@794938 13f79535-47bb-0310-9956-ffa450edef68
2009-07-17 01:34:50 +00:00
Bryan Duxbury
8f5827358b THRIFT-543. java: Generate normal style java files should respect the "optional" keyword when serializing
As the summary suggests, this patch causes "optional" fields to be skipped if they are unset, even if they are primitives. As this patch is for the non-beans style generator, the user is expected to maintain the set/unset status themselves.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@793778 13f79535-47bb-0310-9956-ffa450edef68
2009-07-14 01:42:09 +00:00
Bryan Duxbury
281d9dacb6 THRIFT-204. csharp: C# Partial Classes
C# structs are now generated as partial classes so they can be extended without wrapping.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@790730 13f79535-47bb-0310-9956-ffa450edef68
2009-07-02 20:15:05 +00:00
Bryan Duxbury
6fcaf84287 THRIFT-526. rb: Generated Ruby enums have no good way to get the names back out once you have a number.
enums generated in Ruby will now have a static map of enum values to names.

Patch by Adam Coffman (with slight modifications).



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@788098 13f79535-47bb-0310-9956-ffa450edef68
2009-06-24 17:55:53 +00:00
David Reiss
3d6babc05c THRIFT-524. erlang: Decapitalize file names in include directives
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@786334 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 23:30:03 +00:00
Bryan Duxbury
ef73b0e67a THRIFT-378. java: Java servers do not turn internal errors into thrift exceptions
This patch causes Java servers to log internal server errors and return an INTERNAL_ERROR exception instead of just closing the connection.

Author: Jonathan Ellis



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@785713 13f79535-47bb-0310-9956-ffa450edef68
2009-06-17 16:43:25 +00:00
Bryan Duxbury
9e34741004 THRIFT-489. java: Java enum validation only validates explicitly assigned values
This patch puts all of an enum's values into the valid values set, fixing validation. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@780091 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 20:15:02 +00:00
Bryan Duxbury
32194ab442 THRIFT-501. rb: File.dirname(...) requires cause warnings in some scenarios
This patch removes the File.dirname usage. Instead, you should put the directory that contains your _types.rb into the load path.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@776800 13f79535-47bb-0310-9956-ffa450edef68
2009-05-20 18:22:19 +00:00
Bryan Duxbury
1cc7a1369e THRIFT-485. rb: Generated validate methods that reference external thrift files' types are not referenced correctly
This patch fully qualifies type names in two spots.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@771964 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 18:50:26 +00:00
Andrew McGeachie
853bdfea38 THRIFT-60. Make generated constants object extend NSObject.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@771514 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 00:44:48 +00:00
David Reiss
4f3192093d THRIFT-471. python: Generated exceptions should implement __str__
This makes Python stack dumps properly show the exception content.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@770002 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 23:35:01 +00:00
David Reiss
1cc8995c14 THRIFT-463. python: Fix thrift_spec ordering bug from r760201
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@769123 13f79535-47bb-0310-9956-ffa450edef68
2009-04-27 19:36:50 +00:00
T Jake Luciani
fae0e78158 THRIFT-460: fixes constant structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@766933 13f79535-47bb-0310-9956-ffa450edef68
2009-04-21 00:50:11 +00:00
Bryan Duxbury
4650144f52 THRIFT-451. rb: ruby structs use lowercase enum while modules are capitalized
This patch updates the full_type_name call so it capitalizes a type before it's appended to the module prefix. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@764549 13f79535-47bb-0310-9956-ffa450edef68
2009-04-13 18:12:07 +00:00
Bryan Duxbury
256f704d9d THRIFT-445. rb: client and processor do not inherit from the proper namespace scope
This patch adds namespace support to a client and processor extended from an included thrift def with its own namespace. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@764540 13f79535-47bb-0310-9956-ffa450edef68
2009-04-13 17:48:23 +00:00
Bryan Duxbury
ff219acb6c THRIFT-236. Structs should be serialized in a consistent order
2nd try at this issue. This time, we will use numeric field order ONLY for the serialization portion, instead of globally. This should make it much easier to produce the correctly ordered output in all cases. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@764072 13f79535-47bb-0310-9956-ffa450edef68
2009-04-10 21:51:00 +00:00
David Reiss
ebb6cc4cf1 THRIFT-445. Revert r760201 "THRIFT-236. Sort fields in id order during parsing"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763786 13f79535-47bb-0310-9956-ffa450edef68
2009-04-09 20:02:56 +00:00
Bryan Duxbury
def30a6072 THRIFT-387. Add appropriate Apache header to all code files
This hits all the documentation and some misc code files that have avoided the license up to this point.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763048 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 00:19:37 +00:00
Bryan Duxbury
0781f2b549 THRIFT-407. hs: Refactor and improve Haskell-related code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763031 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 23:29:42 +00:00
Kevin Clark
ffd4bafc7f THRIFT-431. rb: Capitalize namespace values
Author: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763022 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 22:47:34 +00:00
David Reiss
2bcf3995ef THRIFT-427. java: Fix print_const_value
Simplify it a bit in the process, because the beans-style setters
are produced even in non-beans mode, and they handle isset internally.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@762956 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 20:51:37 +00:00
Kevin Clark
19f8d1febe Thrift-421. rb: Underscore output file names and require file statments
Breaks compatiblity

Author: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@762907 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 19:09:28 +00:00
Bryan Duxbury
9b1f5a6f1a THRIFT-422. rb: scope all references to the Thrift module
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@762620 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 04:40:50 +00:00
Bryan Duxbury
d1d1542e1e THRIFT-276. rb: Ruby libraries should have one class per file
This monster of a patch moves all the classes into their own files and specs as appropriate. Additionally, it concentrates all the requires into thrift.rb, removing the need to require any other file. (Changes were made to the compiler to reflect this reduced requirement.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761849 13f79535-47bb-0310-9956-ffa450edef68
2009-04-04 00:58:03 +00:00
Bryan Duxbury
a145b4d58a THRIFT-423. -strict should turn omitted field ids into compile error
Issue name says it all.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761736 13f79535-47bb-0310-9956-ffa450edef68
2009-04-03 17:29:25 +00:00
David Reiss
7247b8cfd6 cpp: Fix compiler and library compilation with newer glibc
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761464 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 23:05:40 +00:00
David Reiss
bb4613629b THRIFT-420. Warn on implicit (negative) structure field ids
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761391 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 19:23:59 +00:00
David Reiss
deda141392 THRIFT-388. Create a "ONEWAY" message type that is an alias for "CALL"
Pave the way for a new message type for oneway function calls.
For now, just define the constant in all languages and make
server implementations treat it the same way as a normal call.
Only C++ and Erlang currently check the message type (on the
server side).

There is a little bit of redundancy in the Erlang code, but
the alternative is a bit gross, and this split-up will be
necessary eventually when we start handling one-way calls
differently.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761389 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 19:22:31 +00:00
David Reiss
566a987dac THRIFT-236. Sort fields in id order during parsing
This effectively eliminates the notion of "IDL-order".
All structs have their fields sorted in increasing order of field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760201 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 22:24:30 +00:00
David Reiss
ea2cba8ba8 THRIFT-387. Add license headers to a bunch of files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760189 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 21:35:00 +00:00
David Reiss
64f87529db THRIFT-412. python: Fix some syntacticaly-incorrect code generation
r758558 introduced a but that caused some of the generated docstrings
to be indented incorrectly, resulting in syntactically invalid code.
This commit fixes the indentation.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760118 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 19:31:36 +00:00
David Reiss
82e6fc0266 THRIFT-153. Proper handling of strings with escapes (in IDL)
- Recognize and parse escape characters in .thrift files.
- Escape strings used as constants in generated source files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758922 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:32:36 +00:00
David Reiss
4a05434d0b Make vim recognize that "thriftl.ll" is Lex source
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758921 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:32:27 +00:00
David Reiss
885c82d75a THRIFT-282. Generate doccstrings for Python classes
Docstrings are generated for
  - enums (but not enum members)
  - structures and structure fields
  - service interfaces
  - functions and function arguments


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758558 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 08:40:55 +00:00
David Reiss
39aa00d2e0 THRIFT-282. Move generate_docstring_comment to t_generator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758556 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 08:40:18 +00:00
David Reiss
cecbed81c8 THRIFT-136. s/async/oneway/ in the Thrift IDL
This is the real change.  The lexer now recognizes "oneway"
and warns on "async".  All example and test IDLs have been
updated, as have the syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757994 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:02:22 +00:00
David Reiss
fe931d1526 THRIFT-136. s/async/oneway/ in Erlang
This is kind of a bummer because it requires a simultaneous
code regeneration and library upgrade, and possibly also a
server restart.  I'm not sure if it is worth it, since the
only benefit is a little code clarity.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757993 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:02:08 +00:00
David Reiss
6ce401dd55 THRIFT-136. s/async/oneway/ in misc places
This is mostly an internal-only change.
It affects docstrings, messages, variables, test cases, etc.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757992 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:58 +00:00
David Reiss
c51986f438 THRIFT-136. s/async/oneway/ in comments
This is an internal-only change.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757990 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:25 +00:00
David Reiss
473292500d THRIFT-136. s/async/oneway/ in compiler variables
This is an internal-only change.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757989 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:02 +00:00
David Reiss
6985a4205b THRIFT-136. s/async/oneway/ in lexer and parser variables
This is an internal-only change.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757988 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:00:47 +00:00
Kevin Clark
4798a7ad12 THRIFT-399. hs: Fix set and number issues in generated constant code
Author: Spiridon Eliopoulos


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757864 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:56:19 +00:00
Kevin Clark
38c8b5b92a THRIFT-398. hs: Remove unnecessary parens from generated type annotations
Author: Spiridon Eliopoulos


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757825 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 14:51:51 +00:00
Kevin Clark
db3a83a799 THRIFT-397. hs: Remove unnecessary redefinition of generate_program()
Author: Spiridon Eliopoulos


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757824 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 14:47:31 +00:00
Bryan Duxbury
2ad9eb7c5e THRIFT-382. java: Unused imports in generated code
Regrouped some of the imports and removed ones that will never be used.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757623 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 00:43:33 +00:00
Bryan Duxbury
f3c83cf88e THRIFT-385. hs: 64-bit integer and double types incorrectly serialized on 32-bit platforms
Use 64-bit types where appropriate.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757619 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 00:34:16 +00:00
Bryan Duxbury
ff58a9aecd THRIFT-266. erlang: Erlang atoms must always start with lower-case character
Forces first char of atom to lowercase for struct fields.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757617 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 00:28:40 +00:00
Bryan Duxbury
13083d6d52 THRIFT-294. Remove @author tags
They're gone. Don't add any new ones!



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756307 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 02:19:46 +00:00
Bryan Duxbury
afa1b47e60 THRIFT-245. rb: FIELDS constant should contain name of enumerated type for enum fields
This patch adds the :enum_class key to FIELDS entries that are enums. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756295 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 01:51:16 +00:00
David Reiss
1f804a80c2 THRIFT-384. csharp: Fix handling of fields named "value"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756179 13f79535-47bb-0310-9956-ffa450edef68
2009-03-19 20:33:15 +00:00
David Reiss
00a8dd633c THRIFT-361. Use separate negative id counters for arguments and exceptions
NOTE:
This will break wire-compatibility, but only with functions that have
both negative-id arguments and negative id-exceptions, and only in the
exceptional case.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755870 13f79535-47bb-0310-9956-ffa450edef68
2009-03-19 08:14:12 +00:00
Bryan Duxbury
3696d643d0 THRIFT-379. java: Print enum value names
This patch adds a new generated map of enum values to their respective names to each generated enum class, and then consumes that in the toString method to print the names when possible.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755464 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 03:14:56 +00:00
Bryan Duxbury
97592b40b1 THRIFT-278. java: #validate exceptions should contain the offending value
This patch causes validate to throw exceptions that contain the bad field value as well as the field name. I had to modify it slightly from the patch on the issue to conform with the new style isset checks.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755454 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 01:50:50 +00:00