You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksey Yeschenko (JIRA)" <ji...@apache.org> on 2015/01/28 14:49:35 UTC

[jira] [Commented] (CASSANDRA-8695) thrift column definition list sometimes immutable

    [ https://issues.apache.org/jira/browse/CASSANDRA-8695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14295148#comment-14295148 ] 

Aleksey Yeschenko commented on CASSANDRA-8695:
----------------------------------------------

Doesn't really matter which one you decide to alter - CFMetaData#internalFromThrift() is the only consumer of ColumnDefinition#fromThrift().

> thrift column definition list sometimes immutable
> -------------------------------------------------
>
>                 Key: CASSANDRA-8695
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8695
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Chris Lockfort
>
> When the input cf_def.column_metadata is null, ColumnDefinition.fromThrift can return Collections.emptyList() (which is defined to be an immutable list) 
> One caller, CFMetaData.internalFromThrift , incorrectly assumes that this list will always be mutable and tries to add to this immutable list, which causes the Cassandra server to throw an exception.
> It looks like this is a bug in 2.1, but not in trunk.
> I can include my one-liner patch, but I'm not sure whether it is better to fix the caller (to not assume random lists you get back from a method are mutable) or the callee (to always return a mutable list).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)