diff options
author | David Reiss <dreiss@apache.org> | 2009-08-27 20:27:09 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2009-08-27 20:27:09 +0000 |
commit | af81de0123c8d9920a25a27d28da66f9d00748cc (patch) | |
tree | a85adc2cfe4a3e5ae040f4b3eecb64e92f8013b8 /lib/java/test/org/apache | |
parent | 2c8cd944e50d4d69f00fde70ecee9c75ab924e2b (diff) | |
download | thrift-af81de0123c8d9920a25a27d28da66f9d00748cc.tar.gz |
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
Diffstat (limited to 'lib/java/test/org/apache')
-rw-r--r-- | lib/java/test/org/apache/thrift/test/Fixtures.java | 12 | ||||
-rwxr-xr-x | lib/java/test/org/apache/thrift/test/TCompactProtocolTest.java | 6 |
2 files changed, 2 insertions, 16 deletions
diff --git a/lib/java/test/org/apache/thrift/test/Fixtures.java b/lib/java/test/org/apache/thrift/test/Fixtures.java index 7ef91ef21..ea250dd98 100644 --- a/lib/java/test/org/apache/thrift/test/Fixtures.java +++ b/lib/java/test/org/apache/thrift/test/Fixtures.java @@ -112,17 +112,7 @@ public class Fixtures { // superhuge compact proto test struct compactProtoTestStruct = new CompactProtoTestStruct(thrift.test.Constants.COMPACT_TEST); - compactProtoTestStruct.a_binary = new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8}; - compactProtoTestStruct.binary_list = Arrays.asList(new byte[]{(byte) 0, (byte) 1}, new byte[]{(byte) 2, (byte) 3}); - compactProtoTestStruct.binary_set = new HashSet<byte[]>(compactProtoTestStruct.binary_list); - compactProtoTestStruct.binary_byte_map = new HashMap<byte[], Byte>() {{ - put(new byte[]{(byte) 0, (byte) 1}, (byte) 100); - put(new byte[]{(byte) 2, (byte) 3}, (byte) 101); - }}; - compactProtoTestStruct.byte_binary_map = new HashMap<Byte, byte[]>() {{ - put((byte) 100, new byte[]{(byte) 0, (byte) 1}); - put((byte) 101, new byte[]{(byte) 2, (byte) 3}); - }}; + compactProtoTestStruct.a_binary = new byte[]{0,1,2,3,4,5,6,7,8}; } catch (Exception e) { throw new RuntimeException(e); } diff --git a/lib/java/test/org/apache/thrift/test/TCompactProtocolTest.java b/lib/java/test/org/apache/thrift/test/TCompactProtocolTest.java index 99173401e..5d1c3cba1 100755 --- a/lib/java/test/org/apache/thrift/test/TCompactProtocolTest.java +++ b/lib/java/test/org/apache/thrift/test/TCompactProtocolTest.java @@ -324,11 +324,7 @@ public class TCompactProtocolTest { T objRead = klass.newInstance(); objRead.read(proto); - // TODO equals is broken when List<array> is involved, since AbstractList.equals(Object o) - // calls o.equals, but for arrays that is just == which will never work when you are - // comparing pre- and post- serialized versions. You need to use Arrays.equals instead. - // So, here I have special-cased CPTS to avoid failing the test b/c of this bug. - if (!obj.equals(objRead) && klass != CompactProtoTestStruct.class) { + if (!obj.equals(objRead)) { System.out.println("Expected: " + obj.toString()); System.out.println("Actual: " + objRead.toString()); // System.out.println(buf.inspect()); |