Commit Graph

870 Commits

Author SHA1 Message Date
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
Bryan Duxbury
65f7e60b7b THRIFT-365. html: HTML compiler infinite loop
Trivial fix for 64-bit systems.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755413 13f79535-47bb-0310-9956-ffa450edef68
2009-03-17 21:55:36 +00:00
Bryan Duxbury
42336c19b2 THRIFT-368. java: setFieldValue should allow nulls for all field types
After this patch, setFieldValue will treat a set with a null as an unset.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@753337 13f79535-47bb-0310-9956-ffa450edef68
2009-03-13 18:28:40 +00:00
Bryan Duxbury
56c4836220 THRIFT-364. java: Use of enums in other namespaces breaks java generated code
This patch checks for different namespaces and prefixes appropriately.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@752696 13f79535-47bb-0310-9956-ffa450edef68
2009-03-11 23:40:57 +00:00
Bryan Duxbury
e3c3d19c7a THRIFT-359. java: nocamel style breaks generated services
This patch makes the generated code respect the nocamel option.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@751180 13f79535-47bb-0310-9956-ffa450edef68
2009-03-07 03:08:37 +00:00
Bryan Duxbury
f4d6fa408f THRIFT-358. ruby: Change how external thrift files' generated code is required
Generated code that relies on included thrift files now doesn't assume the path will be the same.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750667 13f79535-47bb-0310-9956-ffa450edef68
2009-03-05 23:11:37 +00:00
Kevin Clark
af99b5c398 THRIFT-352. rb: Implicit enums should be valid values
Author: Gary Tsang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750171 13f79535-47bb-0310-9956-ffa450edef68
2009-03-04 21:42:46 +00:00
Kevin Clark
c289608e19 THRIFT-353. rb: Capitalize module names on ruby generation
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750160 13f79535-47bb-0310-9956-ffa450edef68
2009-03-04 21:32:54 +00:00
Kevin Clark
120ff31d11 THRIFT-148. py: Add support for Twisted
Author: Esteve Fernandez

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@749510 13f79535-47bb-0310-9956-ffa450edef68
2009-03-03 02:25:50 +00:00
Bryan Duxbury
f4c71c73d0 THRIFT-116. java: Isset fields for non-primitive types unnecessary
Prior commit on this issue was missing a !.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@747090 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 17:49:24 +00:00
Bryan Duxbury
f9d105c519 THRIFT-116. java: Isset fields for non-primitive types unnecessary
Missed one of the cases where isset was being used on non-primitive fields.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@746429 13f79535-47bb-0310-9956-ffa450edef68
2009-02-21 01:57:46 +00:00
Bryan Duxbury
d11f2411e2 THRIFT-116. java: Isset fields for non-primitive types unnecessary
This patch gets rid of the __isset fields for non-primitives and updates ToStringTest and EqualityTest appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@746000 13f79535-47bb-0310-9956-ffa450edef68
2009-02-19 21:21:44 +00:00
David Reiss
554ea6f936 Make the PHP generator use non-hardcoded namespaces.
- Make the PHP generator use program->get_namespace("php")
  instead of program->get_php_namespace()
- Eliminate the explicit "php_namespace" in t_program.
- Deprecate the php_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745241 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:37 +00:00
David Reiss
32272d9bd8 Allow the Thrift compiler to be built without the PHP generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-php
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745240 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:30 +00:00
David Reiss
bba692833d Remove t_php_generator.h.
t_php_generator.h is no longer included anywhere, because
the PHP generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745239 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:28 +00:00
David Reiss
a9ea68b907 Make the PHP generator dynamic.
- Modify the PHP generator constructor to fit the new generic interface.
- Register the PHP genrator with the central registry.
- Deprecate the old way of invoking the PHP generator.
- main.cc no longer includes t_php_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745238 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:24 +00:00
David Reiss
92e10d8297 Make the XSD generator use non-hardcoded namespaces.
- Make the XSD generator use program->get_namespace("xsd")
  instead of program->get_xsd_namespace()
- Eliminate the explicit "xsd_namespace" in t_program.
- Deprecate the xsd_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745237 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:19 +00:00
David Reiss
782cb67a3b Allow the Thrift compiler to be built without the XSD generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-xsd
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745236 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:13 +00:00
David Reiss
3ac5b6aa85 Remove t_xsd_generator.h.
t_xsd_generator.h is no longer included anywhere, because
the XSD generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745235 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:10 +00:00
David Reiss
4ba6710ea1 Make the XSD generator dynamic.
- Modify the XSD generator constructor to fit the new generic interface.
- Register the XSD genrator with the central registry.
- Deprecate the old way of invoking the XSD generator.
- main.cc no longer includes t_xsd_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745234 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:06 +00:00
David Reiss
f3b0db3735 Allow the Thrift compiler to be built without the Erlang generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-erl
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745233 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:01 +00:00
David Reiss
9f16d78553 Remove t_erl_generator.h.
t_erl_generator.h is no longer included anywhere, because
the Erlang generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745232 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:58 +00:00
David Reiss
a204783a06 Make the Erlang generator dynamic.
- Modify the Erlang generator constructor to fit the new generic interface.
- Register the Erlang genrator with the central registry.
- Deprecate the old way of invoking the Erlang generator.
- main.cc no longer includes t_erl_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745231 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:54 +00:00
David Reiss
bbbbe880a0 THRIFT-325. Include t_generator.h in main.cc
I'm about to remove all of the generator includes, but we'll still need
the generic header for the generator registry and interface.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745230 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:27:48 +00:00
David Reiss
d831a21773 THRIFT-309. Make Thrift's C# mapping .NET 2.0 (Mono 1.2.4) compatible
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743963 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 03:09:52 +00:00
Bryan Duxbury
30e1de9fd5 THRIFT-316. java: @Override isn't generated for hashCode() without the hash code builder
Fixed with a trivial reorganization of the hashCode method generation.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743046 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 18:36:56 +00:00
Bryan Duxbury
c707855048 THRIFT-318. java: Performance of HashSet for enumeration VALID_VALUES seems poor
Instead of a HashSet, enums will now use the special IntRangeSet implementation. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743037 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 18:10:57 +00:00
David Reiss
6ad6251951 java: Fix a minor formatting problem in the gen-code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@742192 13f79535-47bb-0310-9956-ffa450edef68
2009-02-08 22:46:38 +00:00
Bryan Duxbury
bb7826da70 THRIFT-10. java: Descriptors used during serialization should be immutable objects
-Descriptor classes all have final members, making them immutable.
-Generated structs now have static constant versions of their TStruct and TField descriptors, and will be used during writing.
-Protocols that can benefit use static constants for various common returned descriptors.
-A duplicate FieldMetaData.java that should have been removed previously was also removed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741984 13f79535-47bb-0310-9956-ffa450edef68
2009-02-08 00:12:38 +00:00
Bryan Duxbury
f28f82631a THRIFT-159. csharp: Compiler doesn't add package scope to exceptions in catch blocks and assigns to unused local var when reading
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741917 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 17:17:43 +00:00
David Reiss
a7fc092ee1 THRIFT-256. python: Fix inheritance of services in the same IDL file
The old version of type_name did not fully qualify parent service names
when they were defined in the same IDL file, but it is necessary because
they end up in different Python files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741833 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:09 +00:00
David Reiss
8cee47cf5e THRIFT-310. python: Generate valid code for empty services
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741832 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:05 +00:00
David Reiss
0b7d6fa5ee THRIFT-314. Purge reflection.limited
This was a feature designed to allow a Thrift server to report
information about its interface.  However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good.  Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:36:35 +00:00
Bryan Duxbury
d20a1d3619 THRIFT-303. java: Changes to __isset interface
This patch makes __isset always private and adds a method per field to set the __isset state when not using the bean-style generator.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741805 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 01:08:58 +00:00
Bryan Duxbury
3d0abc36a9 THRIFT-132. ruby: Ruby generator should use ::Thrift::Foo namespace form
All of the Thrift library includes now prefix with ::.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740377 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 19:18:57 +00:00
Bryan Duxbury
f5383b663e THRIFT-297. java: getFieldValue and setFieldValue should be abstract TBase methods
This patch makes getFieldValue, setFieldValue, and isSet TBase interface methods, and adds all the previously beans-only getters and setters to all Java generated classes. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740169 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 00:49:25 +00:00
Bryan Duxbury
056bcb6947 THRIFT-178. java, csharp, cpp: Final Keyword
The lexer has been changed to make "final" a non-reserved word, and the java, csharp, and cpp compilers now look for the final annotation and amend their class declarations appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739788 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 16:56:29 +00:00
David Reiss
c2c8ad8f0b THRIFT-259. html: Generate "extends" link for extended services
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739700 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 05:36:10 +00:00
David Reiss
4704d4383c THRIFT-285. python: Don't generate _result structs for async functions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739668 13f79535-47bb-0310-9956-ffa450edef68
2009-02-01 00:42:10 +00:00
T Jake Luciani
b5e6221eb5 THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739644 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 22:36:20 +00:00
Bryan Duxbury
796381d857 THRIFT-290. java: Metadata map doesn't properly reference external thrift file's types
The code generator now uses full namespaces to refer to the classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739045 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 22:13:56 +00:00
Bryan Duxbury
9f427ee0e1 THRIFT-288. java: Generated code iterates maps during write inefficiently
Newly generated code will now use entrySet instead of keySet when serializing maps. Existing generated classes does not need to be regenerated, though they won't reap the performance improvements unless they do.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738765 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 05:47:21 +00:00
Bryan Duxbury
1f6302fab0 THRIFT-218. java: When validation fails on serialization/deserialization, print out the invalid object
The error thrown when validation fails now contains the toString output.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738764 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 05:38:10 +00:00
Bryan Duxbury
986d705578 THRIFT-253. java: Enhance FieldMetaData
The code generator new creates a static map of field id to metadata for each field, including information like the field TType, class of embedded structs, required/optional/default, etc. Additionally, on loading, generated classes statically register their class and metadata map with the global FieldMetaData map, so you can get the metadata for any TBase-implementing class easily.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738708 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 01:51:08 +00:00
Bryan Duxbury
369417a5f1 THRIFT-239. java: Generate @Override annotations for all overrided methods
equals, toString, clone, and hashcode now all have a preceeding @Override annotation.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738270 13f79535-47bb-0310-9956-ffa450edef68
2009-01-27 22:09:33 +00:00
Bryan Duxbury
8bbd8447b9 THRIFT-223 Validate method should check that enum types are assigned valid values
Enum classes now get a VALID_VALUES Set that contains all of the acceptable values. Structs' validate() method has been extended to compare an enum field's value to the valid value set, but only if the __isset flag for that field is true, meaning that non-beans generated code will not perform this validity check unless the __isset flag is manually maintained.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@735910 13f79535-47bb-0310-9956-ffa450edef68
2009-01-20 01:54:14 +00:00
Bryan Duxbury
46b77c4be6 THRIFT-224 Validate method should check that enum types are assigned valid values
Each generated enumeration type will now have a VALID_VALUES Set as a static member that contains all the values of the enumeration.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@735167 13f79535-47bb-0310-9956-ffa450edef68
2009-01-16 22:34:40 +00:00
Bryan Duxbury
afa80ea73d THRIFT-34 Java libraries should be namespaced under org.apache.thrift, not com.facebook.thrift
Library classes and tests have been moved to the proper package and directory structure, and references to com.facebook.thrift where replaced with org.apache.thrift throughout the code. The fb303 contrib project still contains com.facebook packages.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734855 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 23:47:51 +00:00
David Reiss
46bb4aeb5e THRIFT-242. python: Used named arguments in __init__ instead of a dict
This is a wire-compatible but non-source-compatible change.
When initializing structures, you must use

Foo(bar=1, baz="qux")
Foo(**{"bar": 1, "baz": "qux"})

instead of

Foo({"bar": 1, "baz": "qux"})


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734536 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 22:34:15 +00:00
David Reiss
7bcf866c16 THRIFT-249. java: Add @param lines to function docstrings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732116 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 20:54:27 +00:00
David Reiss
c654416843 THRIFT-129. csharp: Make all Thrift structures extend TBase
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732081 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:33 +00:00
David Reiss
b0f31ef92f THRIFT-46. csharp: Throw the correct exception for an unknown method
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732080 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:29 +00:00
David Reiss
6319133cac THRIFT-25. csharp: Various compiler and library improvements
Compiler:
- Thrift structures are serializable.
- The member fields of thrift structures are now private and only accessible
  through Properties, which keep the appropriate __isset up to date.

Library
- Addition of TBufferedTransport, which can be used to wrap other Transports.
- Addition of TThreadedServer, which manually manages threads instead of
  relying on .NET ThreadPool.
- Servers use a log delegate that defaults to System.Console but allows
  servers to use log4net without introducing the dependency.

ThriftTest Visual Studio Project
- Test client and server that use ThriftTest.thrift. The project references
  thrift.exe and Thrift.dll from the subversion tree and automatically builds
  generated code. This makes it very easy to test changes in both the compiler
  and library.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732079 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:22 +00:00
Kevin Clark
d6b7182df5 THRIFT-246. rb: Generate #struct_fields rather than reflect.
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731806 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 01:34:28 +00:00