Github user Gospodzin commented on a diff in the pull request: https://github.com/apache/thrift/pull/743#discussion_r47467283 --- Diff: lib/java/test/org/apache/thrift/TestStruct.java --- @@ -309,11 +309,33 @@ public void testToString() throws Exception { } public void testBytesBufferFeatures() throws Exception { - JavaTestHelper o = new JavaTestHelper(); + + final String testString = "testBytesBufferFeatures"; + final JavaTestHelper o = new JavaTestHelper(); + o.setReq_bin((ByteBuffer)null); assertNull(o.getReq_bin()); + + o.setReq_bin(ByteBuffer.wrap(testString.getBytes())); + assertNotNull(o.getReq_bin()); + o.setReq_bin((byte[])null); assertNull(o.getReq_bin()); + + o.setReq_bin(testString.getBytes()); + assertNotNull(o.getReq_bin()); + + o.setFieldValue(JavaTestHelper._Fields.REQ_BIN, null); + assertNull(o.getReq_bin()); + + o.setFieldValue(JavaTestHelper._Fields.REQ_BIN, testString.getBytes()); + assertNotNull(o.getReq_bin()); + + o.setFieldValue(JavaTestHelper._Fields.REQ_BIN, null); --- End diff -- Does it make sense to duplicate this piece of code?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---