/[Apache-SVN]
ViewVC logotype

Revision 665541


Jump to revision: Previous Next
Author: dreiss
Date: Sun Mar 2 06:29:19 2008 UTC (16 years, 8 months ago)
Changed paths: 6
Log Message:
Add support for .equals() to Java structs.

- Add a new method to t_java_generator that generates a .equals() method.
- Add a correct but useless implementation of hashCode for structs.
  (This is required by conventino when overriding .equals().)
- Add java_package to DebugProtoTest and OptionalRequiredTest.
- Add a new structure to OptionalRequiredTest to assist testing the behavior
  of .equals() with respect to null and unset fields.
- Clean up test/java/build.xml a bit.  (It still has a ways to go.)
- Add EqualityTest.java to test .equals().
- Add IdentityTest.java to test that writing and reading a structure
  preserves equality.

Tested by runnint atn test.
I also looked at the generated code for OptionalRequiredTest.thrift.


Changed paths

Path Details
Directoryincubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc modified , text changed
Directoryincubator/thrift/trunk/test/DebugProtoTest.thrift modified , text changed
Directoryincubator/thrift/trunk/test/OptionalRequiredTest.thrift modified , text changed
Directoryincubator/thrift/trunk/test/java/build.xml modified , text changed
Directoryincubator/thrift/trunk/test/java/src/EqualityTest.java added
Directoryincubator/thrift/trunk/test/java/src/IdentityTest.java added

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26