Commit Graph

781 Commits

Author SHA1 Message Date
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
Kevin Clark
41baeaba96 THRIFT-157. rb: Quote strings and qualify class names properly
Author: Dave Engberg


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731763 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:10:17 +00:00
David Reiss
8eaebfedc1 THRIFT-235. java: Explicitly cast integer constants to double
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731723 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:03:01 +00:00
David Reiss
25be92bf0d THRIFT-222. java: Better exposure if __isset in beans style
- Generate an isSet method for each field to test its set-ness.
- Generate a generic isSet method that checks by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731722 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:58 +00:00
David Reiss
2db737df8f java: Add a helper function to implement nocamel style
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731721 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:55 +00:00
David Reiss
b936ffdbd1 THRIFT-191. java: Create a static field id -> name map for each struct
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731720 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:52 +00:00
David Reiss
5455f00348 THRIFT-138. java: Fix copy constructor for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731719 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:48 +00:00
David Reiss
888f88b05d THRIFT-241. python: Generate a better implementation of __repr__
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731685 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 20:14:52 +00:00
T Jake Luciani
41687fc6cf THRIFT-193: Patch for proper namespace support in perl compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728863 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:45:43 +00:00
David Reiss
a8efac862a THRIFT-225. java/cpp: Handle non-i32 integer constants properly
Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:28:13 +00:00
David Reiss
a230999667 THRIFT-121. Support arbitrary type annotations
Adds syntax for attaching arbitrary key/value pairs to types.
These annotations can be accessed by individual generators to alter
the code they produce.

This version supports annotations on container types and structures.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@724954 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 01:52:48 +00:00
David Reiss
603d50437c THRIFT-138. java: Create deep-copy constructors for Thrift structs
- Create a copy constructor for every Thrift struct.  The constructor
  performs a deep copy on the argument, resulting in no shared state.
- Make thrift structions implement Cloneable and implement .clone()
  using the copy constructor.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:06:31 +00:00
David Reiss
fd71808e35 THRIFT-142. java: Better handling of required fields
- On reading, behave the same way as the C++ code:
  throw an exception if a required field is missing.
- In addition, throw an exception if a required field is missing
  when writing.  For the JavaBeans code, this means that __isset
  is false (because it is maintained automatically).  For non-beans
  code, this means that the field is null.  Non-nullable fields are
  not checked in non-beans code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719727 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:55:52 +00:00
David Reiss
e31b77e90e THRIFT-194. cpp: Properlyl namespace exception types in catch
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719721 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:36:41 +00:00
David Reiss
30a9360e3f THRIFT-172. java: Improve toString output for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719720 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:31:36 +00:00
David Reiss
7f5e184785 THRIFT-139. java: Fix indentation in beans mode
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719701 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 20:25:14 +00:00
David Reiss
466b3fafcd Remove compiler/cpp/version.h in "make clean"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719380 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 21:24:32 +00:00
Kevin Clark
031baf7086 Merge branch 'THRIFT-143'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714070 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:11:39 +00:00
Kevin Clark
159383f789 rb: raise if an object is serialized without required fields [THRIFT-143]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712945 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 05:46:04 +00:00
Kevin Clark
cfca336fad rb: Add docstrings to generated ruby code [THRIFT-147]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709309 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 00:32:25 +00:00
David Reiss
f33e03c6fa THRIFT-179. java: Include per-field docstrings in generated code
This also involves refactoring a bit of the functionality into
t_oop_generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708737 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:49 +00:00
David Reiss
f011bd4312 Make t_field inherit from t_doc instead of reimplementing it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708736 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:45 +00:00
David Reiss
66f5e9ba0b Make a pointer const to fix a warning
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@707213 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 22:07:03 +00:00
David Reiss
80096e278c Add a missing include to fix compilation on Ubuntu 8.10
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@707212 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 22:07:00 +00:00
David Reiss
dc0aada961 THRIFT-173. Commit the html generator
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@706466 13f79535-47bb-0310-9956-ffa450edef68
2008-10-21 00:09:23 +00:00
Kevin Clark
7dc7f75e7c rb: Create constants for field ids in generated structs [THRIFT-165]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705330 13f79535-47bb-0310-9956-ffa450edef68
2008-10-16 19:15:20 +00:00
David Reiss
31997ca9ee THRIFT-139. java: Expose field ids in more useful ways
- Define constants in each structure class that provide access to the
  field ids by name (at compile time).  Use them for (de)serialization.
- For beans-mode code, generate a generic getter and setter for accessing
  fields by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@703028 13f79535-47bb-0310-9956-ffa450edef68
2008-10-09 00:08:46 +00:00
David Reiss
a0b4409f57 THRIFT-152. java: Set isset appropriately in structure constructors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@702697 13f79535-47bb-0310-9956-ffa450edef68
2008-10-08 04:49:25 +00:00
David Reiss
8684554e29 THRIFT-119. java: structs' toString omits unset optional fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700860 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 18:32:47 +00:00
David Reiss
931d69be9e THRIFT-120. java: Make the nocamel option work for more methods
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700668 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 03:24:54 +00:00
David Reiss
5af01bcbdc THRIFT-100. java: Set __isset better in beans style
When setX(null) is called on a structure, set __isset.x to false.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700667 13f79535-47bb-0310-9956-ffa450edef68
2008-10-01 03:24:50 +00:00
Mark Slee
6341d13a1f Python generator exception namespacing, THRIFT-150
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@700277 13f79535-47bb-0310-9956-ffa450edef68
2008-09-29 22:01:30 +00:00
Kevin Clark
5ad6d4a7e3 rb: Add pretty inspect, optional field hint for Thrift::Struct
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@689193 13f79535-47bb-0310-9956-ffa450edef68
2008-08-26 20:02:07 +00:00
David Reiss
400a543b04 THRIFT-91. cpp: Fix compilation on Fedora Core 9
It turns out that __STDC_LIMIT_MACROS is not portable.
Include limits.h at least until cstdint becomes mainstream.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679885 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 19:48:39 +00:00
David Reiss
70e329f0b8 java: Add nocamel option to not CamelCase field accessors [THRIFT-42]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@676699 13f79535-47bb-0310-9956-ffa450edef68
2008-07-14 19:35:50 +00:00
David Reiss
aabfa63c47 (THRIFT-40) Remove stray \n's from the generated version.h
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672945 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 22:27:29 +00:00
David Reiss
4d8edc5269 (THRIFT-40) Fix compilation and version string on OS X.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672943 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 21:55:52 +00:00
David Reiss
f14541626d Partial handlling of 64-bit integer constants.
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.

I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work.  However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:45:47 +00:00
David Reiss
dd08f6d5a5 (THRIFT-40) Add -version switch to the compiler to show the Thrift version
The version is determined by configure.ac. After this version is shown the
revision. For subversion, it is simply the current revision as given by
`svnversion`. For git, the latest svn revision that HEAD includes is shown,
followed by the offset of HEAD from that commit, followed by a truncated sha1
for HEAD. If the offset is 0, the offset and sha1 are omitted.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672900 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:24:24 +00:00
Kevin Clark
2bd3a30b91 rb: Use File.dirname(__FILE__) in generated requires [THRIFT-57]
This means you no longer have to put the gen-rb folder in $:

Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 17:49:49 +00:00
Kevin Clark
3836f9ba35 rb: require 'thrift' first in generated service definitions [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:51 +00:00
Kevin Clark
23193757bc rb: Implement type-checking in Thrift::Struct.new and field accessors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669015 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:07 +00:00
Kevin Clark
8d79e3f954 Convert fields of type Thrift::Types::SET to use the Set library.
Also teach Thrift::Struct how to compare itself with ==


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668959 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:15 +00:00
Kevin Clark
18e21565b3 Fix the requires generated by the compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668934 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:03:17 +00:00
Kevin Clark
2960044415 rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:13 +00:00
David Reiss
4d1c712ad1 Eliminate some trailing whitespace from the generated Python code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666492 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:18:03 +00:00
David Reiss
ab55ed53e3 Include limits.h in the compiler for PATH_MAX
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666491 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:17:00 +00:00
David Reiss
cc0c9e98b5 Clean up some bad/missed merges from the alterl merge.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666486 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:29 +00:00
David Reiss
e20b972088 [erl] fix generator to use unexpanded structs for reply_types on functions
This fixes a bug where thrift_client would return a tuple rather than a tagged record when the called function returned a struct.

Test plan:
  in tutorial client:
    Log: {sharedStruct,1,<<"RARG">>}
  instead of:
    Log: {1,<<"RARG">>}


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666482 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:54 +00:00
David Reiss
9f2a5d7799 Rename "alterl" to "erl".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:45 +00:00
David Reiss
f2e66c1cb7 Remove all of the old Erlang stuff in preparation for renaming alterl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666480 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:38 +00:00
David Reiss
1a2f2187cd Another whitespace rampage
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666477 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:01 +00:00
David Reiss
81b473b4a1 Fix warning in generated source for alterl bindings
Summary:
  - Was previously including both the fall-through to the base service as well as the "dummy" fallthrough function clause. This generated a warning like:

  gen-erl/redacted_thrift.erl:134: Warning: this clause cannot match because a previous clause at line 132 always matches

  Now we only include the "dummy" function if there is no base class to fall through to.

Test plan: Generated tutorial.thrift and shared.thrift, compiled without warnings

Notes: It's probably possible to have a circular inheritance graph, which would cause an infinite loop at runtime. Do we care about this?


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666423 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:58:41 +00:00
David Reiss
1d8b752971 Implement inheritance in the alterl generator
Summary:
  - Simply forwards function_info calls through to the base service

Test plan: cpiro will test it?


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666422 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:58:33 +00:00
David Reiss
cdf8d1994a Implement async_void in alterl bindings
Summary:
  - reply_type for async void functions is now async_void instead of
    the empty struct definition
  - async void functions should return "ok". otherwise the processor
    will crash and the connection will be killed. Is this behaviour
    expected?

Test Plan: tested using testAsync() in ThriftTest. Didn't used to work
           but works now


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666415 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:57:35 +00:00
David Reiss
982c72de7b Properly handle exceptions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666384 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:58:33 +00:00
David Reiss
11300fe872 Properly uncapitalize package names when referencing structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666379 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:52 +00:00
David Reiss
0c9b516506 Fix generation when multiple services are in the same service definition
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666378 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:44 +00:00
David Reiss
76f0d11dc9 Generator for alternative erl bindings, as well as a few more changes to lib code.
- Exceptions don't work yet, but it looks like everything else does.
- Seems to work fine on our pricing service
- Code could need some cleanup


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666377 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:57:35 +00:00
David Reiss
a1e0a6f0d8 Don't generate a constants file if there are no constants (Java only).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666372 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:43 +00:00
David Reiss
87e9ac6382 Fix a bug with initialization in JavaBean-style generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666371 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:34 +00:00
David Reiss
5245f40b3e Print an error instead of segfaulting with a bad compiler command line.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666370 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:26 +00:00
David Reiss
9d866ac231 Add newlines to some warning messages in the compiler.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666369 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:19 +00:00
David Reiss
0babe40d74 Fix some warnings caused by treating string literals as non-const.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666368 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:12 +00:00
David Reiss
d14f4f86d4 Fix some indentation in the PHP generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666366 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:54 +00:00
David Reiss
c0092f973d PHP Generator: Throw an exception on bad types.
Summary:
Previously, if you set a structure field to, say, an int when it was
supposed to be a container (array) or struct (object), the serialization
code would either produce corrupt output (container) or cause a fatal
error (struct).  Now they both throw exceptions.

Reviewed By: mcslee

Test Plan: Looked at generated code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666365 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:46 +00:00
David Reiss
c89e4de509 Make sure list<byte> is List<Byte> in Java gen'd code.
Reviewed By: dreiss

Test Plan: Generate list<byte> into Java


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666357 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:54:32 +00:00
David Reiss
8df6c82aa7 Switch md5 implementations.
Specifically, switch from the legally-ambiguous RSA implementation to
a zlib-licensed RFC-based implementation from SourceForge.

Generated some files with "dense" and made sure the output hadn't changed.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665679 13f79535-47bb-0310-9956-ffa450edef68
2008-05-04 03:00:22 +00:00
David Reiss
de59292f38 Remove an unnecessary include of boost/lexical_cast.hpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665678 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 20:51:03 +00:00
David Reiss
28f298dd5d Memory-based transport rewrite.
The old implementations of the memory-based transports (TBufferedTransport,
TFramedTransport, and TMemoryBuffer) shared very little code and all worked
a bit differently.  This change unifies them all as subclasses of a single
base (TBufferBase) which handles the fast-path operations (when requests
can be satisfied by the buffer) with inline methods (that will eventually
be made nonvirtual in the template branch) and calls out to pure-virutal
methods to handle full/empty buffers.  All of the buffer-management is now
done in terms of "base and bound" pointers rather than "pos" integers.

These classes were moved to TBufferTransports.{h,cpp}.  The .h is included
in TTransportUtils for backwards compatibility.

Also added a "TShortReadTransport" to assist testing transports.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665676 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 06:17:36 +00:00
David Reiss
9a4edfa07f Properly handle constants of typedef'ed types.
Also throw an error in the compiler if we cannot generate a constant for a
declared const because of its type.  Added a test of this functionality in
ConstantsDemo.thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665675 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:50 +00:00
David Reiss
372126079c Eliminate an unused local variable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665674 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:49 +00:00
David Reiss
74672b6719 Java: In toString for generated structs, handle nulls.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665671 13f79535-47bb-0310-9956-ffa450edef68
2008-04-29 23:09:11 +00:00
David Reiss
051fbd4e57 Thrift REST parsing allows null object params
Summary: If JSON objects are passed in allow them to be null and don'\''t default construct.

Reviewed By: dreiss

Test Plan: Regenerate API code and test on object args.

Revert: OK

DiffCamp Revision: 12407


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665670 13f79535-47bb-0310-9956-ffa450edef68
2008-04-29 00:29:45 +00:00
David Reiss
739cbe2b86 Add a few missing includes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665657 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 05:44:00 +00:00
iproctor
8361bf0565 ocaml and haskell thrift clients now calling readMessageEnd
Summary: I neglected to make the call to readMessageEnd if the client read an app exception in the haskell and ocaml code. Fixed now. The test cases for both now also compile with the new ThriftTest.thrift (though haskell's is still not doing anything but echoing  the args)

Reviewed By: dreiss

Test Plan: Ran test code. This bug would actually never show up because there's only tbinaryprotocol implemented for these languages and that does nothing on a readMessageEnd.

Revert: OK

DiffCamp Revision: 11377


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665651 13f79535-47bb-0310-9956-ffa450edef68
2008-04-10 00:31:55 +00:00
David Reiss
c5c542538b Fix some indentation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665639 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 23:16:46 +00:00
David Reiss
8bfba63dfb C#: Generate proper code for services that inherit from other services.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665632 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 22:10:13 +00:00
David Reiss
f5ece05649 Fix a segfault in the compiler.
We weren't initializing our pointers properly, resulting in
a difficult-to-trigger segfault.

Reviewed By: mcslee, bhamadani

Test Plan: Built the modified search IDL.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665627 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 00:23:31 +00:00
David Reiss
07ef3a930a Make the Perl generator use non-hardcoded namespaces.
- Make the Perl generator use program->get_namespace("perl")
  instead of program->get_perl_package()
- Eliminate the explicit "perl_package" in t_program.
- Deprecate the perl_package token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665624 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:39 +00:00
David Reiss
fdc21aa713 Allow the Thrift compiler to be built without the Perl generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-perl
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665623 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:34 +00:00
David Reiss
fb63533c78 Remove t_perl_generator.h.
t_perl_generator.h is no longer included anywhere, because
the Perl 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@665622 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:30 +00:00
David Reiss
2b386c50d7 Make the Perl generator dynamic.
- Modify the Perl generator constructor to fit the new generic interface.
- Register the Perl genrator with the central registry.
- Deprecate the old way of invoking the Perl generator.
- main.cc no longer includes t_pl_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665621 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:23 +00:00
David Reiss
6a4b82c4b7 Make the Ruby generator use non-hardcoded namespaces.
- Make the Ruby generator use program->get_namespace("ruby")
  instead of program->get_ruby_namespace()
- Eliminate the explicit "ruby_namespace" in t_program.
- Deprecate the ruby_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665620 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:16 +00:00
David Reiss
ae253583e7 Allow the Thrift compiler to be built without the Ruby generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-ruby
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665619 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:11 +00:00
David Reiss
6e93b454ec Remove t_rb_generator.h.
t_rb_generator.h is no longer included anywhere, because
the Ruby 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@665618 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:06 +00:00
David Reiss
a640cea9ae Make the Ruby generator dynamic.
- Modify the Ruby generator constructor to fit the new generic interface.
- Register the Ruby genrator with the central registry.
- Deprecate the old way of invoking the Ruby generator.
- main.cc no longer includes t_rb_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665617 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:01 +00:00
David Reiss
c53b184c12 Remove an unused helper function in the Ruby generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665616 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:58 +00:00
David Reiss
320e45ce8b Make the Python generator use non-hardcoded namespaces.
- Make the Python generator use program->get_namespace("py")
  instead of program->get_py_module()
- Eliminate the explicit "py_module" in t_program.
- Deprecate the py_module token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665615 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:54 +00:00
David Reiss
bfd26dcecc Allow the Thrift compiler to be built without the Python generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-py
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665614 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:49 +00:00
David Reiss
0d6eb969e1 Remove t_py_generator.h.
t_py_generator.h is no longer included anywhere, because
the Python 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@665613 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:45 +00:00
David Reiss
558e3993e1 Make the Python generator dynamic.
- Modify the Python generator constructor to fit the new generic interface.
- Register the Python genrator with the central registry.
- Deprecate the old way of invoking the Python generator.
- main.cc no longer includes t_py_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665612 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:40 +00:00
David Reiss
9d65bf061f Make the C# generator use non-hardcoded namespaces.
- Make the C# generator use program->get_namespace("csharp")
  instead of program->get_csharp_namespace()
- Eliminate the explicit "csharp_namespace" in t_program.
- Deprecate the csharp_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665611 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:37 +00:00
David Reiss
ce4f4f0cbd Allow the Thrift compiler to be built without the C# generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-csharp
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665610 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:31 +00:00
David Reiss
2dfdb2d7f7 Remove t_csharp_generator.h.
t_csharp_generator.h is no longer included anywhere, because
the C# generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.

Also cleaned up its includes a little bit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665609 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:27 +00:00
David Reiss
861869b734 Make the C# generator dynamic.
- Modify the C# generator constructor to fit the new generic interface.
- Register the C# genrator with the central registry.
- Deprecate the old way of invoking the C# generator.
- main.cc no longer includes t_csharp_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665608 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:23 +00:00
David Reiss
919ae80934 Fix a stale debug message.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665607 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:11 +00:00
David Reiss
54b602b746 Make the Cocoa generator use non-hardcoded namespaces.
- Make the Cocoa generator use program->get_namespace("cocoa")
  instead of program->get_cocoa_prefix()
- Eliminate the explicit "cocoa_prefix" in t_program.
- Deprecate the cocoa_prefix token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665606 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:06 +00:00
David Reiss
4b349aabc9 Allow the Thrift compiler to be built without the Cocoa generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-cocoa
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665605 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:02 +00:00
David Reiss
e21ce4c6ca Remove t_cocoa_generator.h.
t_cocoa_generator.h is no longer included anywhere, because
the Cocoa 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@665604 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:59 +00:00
David Reiss
d01c64dec5 Make the Cocoa generator dynamic.
- Modify the Cocoa generator constructor to fit the new generic interface.
- Register the Cocoa genrator with the central registry.
- Deprecate the old way of invoking the Cocoa generator.
- main.cc no longer includes t_cocoa_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665603 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:55 +00:00
David Reiss
be9757568f Put a newline at the end of the generated header file in the Cocoa generator.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665602 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:52 +00:00
David Reiss
3b45501b52 Make the Smalltalk generator use non-hardcoded namespaces.
- Make the Smalltalk generator use program->get_namespace("smalltalk.*")
  instead of program->get_smalltalk_{category|prefix}()
- Eliminate the explicit "smalltalk_{category|prefix}" in t_program.
- Deprecate the smalltalk_{category|prefix} tokens.
- Update example .thrift files and syntax files.

This was a little more complex than the others.  We now convert "." to "-"
in Smalltalk categories, because we no longer lex them as tok_st_identifier.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665601 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:46 +00:00
David Reiss
b3ac8a6c72 Allow the Thrift compiler to be built without the Smalltalk generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-st
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665600 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:42 +00:00
David Reiss
2b6ba090dc Remove t_st_generator.h.
t_st_generator.h is no longer included anywhere, because
the Smalltalk 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@665599 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:38 +00:00
David Reiss
a890b5714e Make the Smalltalk generator dynamic.
- Modify the Smalltalk generator constructor to fit the new generic interface.
- Register the Smalltalk genrator with the central registry.
- Deprecate the old way of invoking the Smalltalk generator.
- main.cc no longer includes t_st_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665598 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:35 +00:00
David Reiss
73dc1431d1 Make the Smalltalk generator respect the "-o" flag.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665597 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:30 +00:00
David Reiss
22812f8be8 Allow the Thrift compiler to be built without the Haskell generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-hs
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665596 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:26 +00:00
David Reiss
42e6d51437 Remove t_hs_generator.h.
t_hs_generator.h is no longer included anywhere, because
the Haskell 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@665595 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:20 +00:00
David Reiss
af3ab2619d Make the Haskell generator dynamic.
- Modify the Haskell generator constructor to fit the new generic interface.
- Register the Haskell genrator with the central registry.
- Deprecate the old way of invoking the Haskell generator.
- main.cc no longer includes t_hs_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665594 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:16 +00:00
David Reiss
3d671b5e53 Allow the Thrift compiler to be built without the OCaml generator.
- Use AX_THRIFT_GEN to make configure support --disable-gen-ocaml
- Update the compiler Makefile.am to exclude the generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665593 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:11 +00:00
David Reiss
7bb71df6ef Remove t_ocaml_generator.h.
t_ocaml_generator.h is no longer included anywhere, because
the Ocaml 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@665592 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:08 +00:00
David Reiss
f0521b1305 Make the OCaml generator dynamic.
- Modify the OCaml generator constructor to fit the new generic interface.
- Register the OCaml genrator with the central registry.
- Deprecate the old way of invoking the OCaml generator.
- main.cc no longer includes t_ocaml_generator.h.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665591 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:05 +00:00
David Reiss
b4d7b89efd Make generate_program virtual.
Haskell and OCaml need to override this to put typedefs at the end.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665590 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:40:01 +00:00
David Reiss
237171ee81 Whitespace-only change for consistency.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665589 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:58 +00:00
David Reiss
f10984b589 Include <cassert> in main.cc.
We are doing an assert in main, but the assert header is being pulled in
by an include that is about to go.  Make it explicit.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665587 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:52 +00:00
David Reiss
c934268249 Delete code generators after using them.
This has been leaking memory in the compiler, but it has also been
preventing the dynamic generators destructors from being called.
This can prevent a stream from being flushed properly.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665586 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:39:49 +00:00