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

Stefan Miklosovic commented on CASSANDRA-17596:
-----------------------------------------------

Just for the record, I do not think that the example Blake showed with Map#put 
is applicable in this case because here I am not explicitly putting anything 
anywhere. I was just unfortunate enough to use API as not intended by developer 
who implemented it that way. The code perfectly compiles, all is fine but it 
fails in rutime when end (or start) is not provided explicitly and there is 
currently no way how to know this in advance.

I still think it is a bug but the amount of time we already spent on this is 
way bigger than potential time saved for other developers in the future. It, 
basically, does not matter. Feel free to fix this as you wish though.

> Fix NPE in SimpleBuilders.ParititionUpdateBulder.RTBuilder.build
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-17596
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17596
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core
>            Reporter: Stefan Miklosovic
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 4.0.5, 4.1-rc, 4.x
>
>
> These two arrays are not initialised (1) which means that if I do not set 
> start nor end, when ClusteringBound.create is called, it will be null, but it 
> will fail here (2) as values will be null.
> The fix consists of check if values are null and if they are, we build that 
> bound immediately.
> (1) 
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/SimpleBuilders.java#L257-L258
> (2) 
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/ClusteringBound.java#L128



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to