cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-12381) Verify use of ByteBuffer.hasArray() in whole code base
Date Thu, 04 Aug 2016 15:01:20 GMT


Robert Stupp commented on CASSANDRA-12381:

Netty had an issue with arrays and direct buffers recently. But reading the issue more thoroughly,
it was on Android and not the OpenJDK or Oracle JVM.
Seems, building this patch was an unnecessary panic reaction. The {{ByteBuffer}} constructor
taking a {{byte[]}} is only called for heap-BBs (Java 8 + Java 9).
TL;DR it should not affect us.

Yea - so what remains is bike-shedding. Would be fine to not merge this one.

> Verify use of ByteBuffer.hasArray() in whole code base
> ------------------------------------------------------
>                 Key: CASSANDRA-12381
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Minor
>             Fix For: 3.0.x
> As [noted here|],
a direct {{ByteBuffer}} can have a backing array.
> If a direct {{ByteBuffer}} has a backing array, we should not make any assumption on
how it is actually used.
> This ticket is about to check whether uses of {{ByteBuffer.hasArray()}} need to be replaced
with {{ByteBuffer.isDirect()}}.
> (With CASSANDRA-11870 however, there is no way that such a direct {{ByteBuffer}} has
a backing array.)

This message was sent by Atlassian JIRA

View raw message