Github user jsirois commented on a diff in the pull request: https://github.com/apache/thrift/pull/1081#discussion_r98087206 --- Diff: lib/java/src/org/apache/thrift/transport/TFramedTransport.java --- @@ -123,6 +123,12 @@ public void consumeBuffer(int len) { readBuffer_.consumeBuffer(len); } + public void clear() { + if (readBuffer_ != null) { --- End diff -- `readBuffer_` is declared `private TMemoryInputTransport readBuffer_ = new TMemoryInputTransport(new byte[0]);` and never re-assigned in this class. Unless there is known code re-assigning via reflection, this should just be promoted to final and all the null checks - like the one added here - dispensed with.
--- 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. ---