kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [2/2] kudu git commit: [java] Fix TestNegotiator on Java 9+
Date Mon, 07 May 2018 16:24:48 GMT
[java] Fix TestNegotiator on Java 9+

TestNegotiator tests fail with a
java.nio.ReadOnlyBufferException when run on
Java 9+.

This patch creates a mutable ByteBuffer instead
to avoid the issue.

Change-Id: I6fd5bdf13b8b18caef2f8593a3c06512e4f7a0c5
Reviewed-on: http://gerrit.cloudera.org:8080/10323
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Grant Henke <granthenke@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/9ad7cf3e
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/9ad7cf3e
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/9ad7cf3e

Branch: refs/heads/master
Commit: 9ad7cf3e5a510a8b5103b51d123e931d7b7d6767
Parents: 1fe10eb
Author: Grant Henke <granthenke@apache.org>
Authored: Mon May 7 09:20:59 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Mon May 7 16:06:01 2018 +0000

----------------------------------------------------------------------
 .../src/test/java/org/apache/kudu/client/TestNegotiator.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/9ad7cf3e/java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
index bd1a6ed..e021712 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
@@ -212,7 +212,7 @@ public class TestNegotiator {
                                             ByteString clientTlsMessage) throws SSLException
{
     LOG.debug("Handling TLS message from client: {}", Bytes.hex(clientTlsMessage.toByteArray()));
     ByteBuffer dst = ByteBuffer.allocate(engine.getSession().getPacketBufferSize());
-    ByteBuffer src = clientTlsMessage.asReadOnlyByteBuffer();
+    ByteBuffer src =  ByteBuffer.wrap(clientTlsMessage.toByteArray());
     do {
       SSLEngineResult result = engine.unwrap(src, dst);
       runTasks(result, engine);


Mime
View raw message