cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Brown (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-13891) fromJson(null) throws java.lang.NullPointerException on Cassandra
Date Tue, 03 Apr 2018 12:40:00 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Brown updated CASSANDRA-13891:
------------------------------------
       Resolution: Fixed
         Reviewer: Jason Brown  (was: Benjamin Lerer)
    Fix Version/s: 3.11.3
                   4.0
    Reproduced In: 3.11.0, 3.9  (was: 3.9, 3.11.0)
           Status: Resolved  (was: Patch Available)

ftr, this error only occurs in 3.11 and trunk. Thus, I've ported [~eribeiro]'s patches to
those branches and run tests.

||3.11||trunk||
|[branch|https://github.com/jasobrown/cassandra/tree/13891-3.11]|[branch|https://github.com/jasobrown/cassandra/tree/13891-trunk]|
|[utests &amp; dtests|https://circleci.com/gh/jasobrown/workflows/cassandra/tree/13891-3.11]|[utests
&amp; dtests|https://circleci.com/gh/jasobrown/workflows/cassandra/tree/13891-trunk]|
||

Failing tests are unrelated and were previously unhealthy.

committed as sha {{28bd6c2a031e76b725dd773b949070962555698a}}. Thanks!


> fromJson(null) throws java.lang.NullPointerException on Cassandra
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-13891
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13891
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: Cassandra 3.11
>            Reporter: Marcel Villet
>            Assignee: Edward Ribeiro
>            Priority: Minor
>             Fix For: 4.0, 3.11.3
>
>         Attachments: CASSANDRA-13891.patch
>
>
> Basically, {{fromJson}} throws a {{java.lang.NullPointerException}} when NULL is passed,
instead of just returning a NULL itself. Say I create a UDT and a table as follows:
> {code:java}
> create type type1
> (
> id int,
> name text
> );
> create table table1
> (
> id int,
> t FROZEN<type1>,
> primary key (id)
> );{code}
> And then try and insert a row as such:
> {{insert into table1 (id, t) VALUES (1, fromJson(null));}}
> I get the error: {{java.lang.NullPointerException}}
> This works as expected: {{insert into table1 (id, t) VALUES (1, null);}}
> Programmatically, one does not always know when a UDT will be null, hence me expecting
{{fromJson}} to just return NULL.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message