THRIFT-4932: Using a default string on a binary field results in invalid Java code.

Client: Java
Patch: Ewan Higgs

This closes #1875.
diff --git a/test/JavaBinaryDefault.thrift b/test/JavaBinaryDefault.thrift
new file mode 100644
index 0000000..5517802
--- /dev/null
+++ b/test/JavaBinaryDefault.thrift
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace java thrift.test
+
+struct StringAndBinary {
+  1: optional string strval = ""
+  2: optional binary binval = ""
+}
diff --git a/test/JavaTypes.thrift b/test/JavaTypes.thrift
index 8c733ad..5553340 100644
--- a/test/JavaTypes.thrift
+++ b/test/JavaTypes.thrift
@@ -27,6 +27,10 @@
   1: string val
 }
 
+struct Binary {
+  1: binary val
+}
+
 struct Boolean {
   1: bool val
 }
diff --git a/test/Makefile.am b/test/Makefile.am
index f6b867c..c2fbbd4 100755
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -158,6 +158,7 @@
 	Include.thrift \
 	Int64Test.thrift \
 	JavaBeansTest.thrift \
+	JavaBinaryDefault.thrift \
 	JavaDeepCopyTest.thrift \
 	JavaTypes.thrift \
 	JsDeepConstructorTest.thrift \