Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#6712] Fix issue with jdk incompatibility in java RPC client
Summary: See #6712 for more details. The signature of ByteBuffer::flip changed between JDK 8 and 9. So when the client is compiled using Java >8 and run with Java 8, it fails to "link" the flip method and results in a NoSuchMethod error. The fix converts the code to always use Buffer.flip instead of the derived method. This should be not result in a loss of functionality because the implementation of the flip in the derived class seems to be the same as the parent class but just returns a different type. See http://hg.openjdk.java.net/jdk9/sandbox/jdk/file/7d9bd66d2bb9/src/java.base/share/classes/java/nio/X-Buffer.java.template#l1148 The issue highlights another problem in the Java RPC client - it seems like the error NoSuchMethodException is just swallowed somewhere along the path. The 'sync' YBClient calls the AsyncYBClient but it might not provide an 'errback' for the error that results from this call. Test Plan: Compile with Java 11, run with Java 8, verify the error is fixed. Reviewers: arnav, streddy, daniel Reviewed By: streddy, daniel Subscribers: streddy, yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D10183
- Loading branch information