Java test client/server fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665104 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/java/src/TestClient.java b/test/java/src/TestClient.java
index 3c8d8b3..8b1cc10 100644
--- a/test/java/src/TestClient.java
+++ b/test/java/src/TestClient.java
@@ -71,7 +71,7 @@
}
TBinaryProtocol binaryProtocol =
- new TBinaryProtocol(transport);
+ new TBinaryProtocol(transport, false, false);
ThriftTest.Client testClient =
new ThriftTest.Client(binaryProtocol);
@@ -330,15 +330,19 @@
System.out.print(k2 + " => {");
AbstractMap<Integer, Long> userMap = v2.userMap;
System.out.print("{");
- for (int k3 : userMap.keySet()) {
- System.out.print(k3 + " => " + userMap.get(k3) + ", ");
+ if (userMap != null) {
+ for (int k3 : userMap.keySet()) {
+ System.out.print(k3 + " => " + userMap.get(k3) + ", ");
+ }
}
System.out.print("}, ");
ArrayList<Xtruct> xtructs = v2.xtructs;
System.out.print("{");
- for (Xtruct x : xtructs) {
- System.out.print("{" + "\"" + x.string_thing + "\", " + x.byte_thing + ", " + x.i32_thing + ", "+ x.i64_thing + "}, ");
+ if (xtructs != null) {
+ for (Xtruct x : xtructs) {
+ System.out.print("{" + "\"" + x.string_thing + "\", " + x.byte_thing + ", " + x.i32_thing + ", "+ x.i64_thing + "}, ");
+ }
}
System.out.print("}");