helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flier Lu (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HELIX-476) ZNRecordStreamingSerializer.deserialize throw NullPointerException when 'id' property is not the first item in JSON
Date Tue, 22 Jul 2014 04:28:39 GMT

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

Flier Lu resolved HELIX-476.
----------------------------

       Resolution: Fixed
    Fix Version/s: 0.7.1

it seems the latest trunk code has fixed it, just merge the patch back to 0.6.3, and waiting
for your new release :)

> ZNRecordStreamingSerializer.deserialize throw NullPointerException when 'id' property
is not the first item in JSON 
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: HELIX-476
>                 URL: https://issues.apache.org/jira/browse/HELIX-476
>             Project: Apache Helix
>          Issue Type: Bug
>          Components: helix-core
>    Affects Versions: 0.6.3
>            Reporter: Flier Lu
>            Priority: Minor
>             Fix For: 0.7.1
>
>
> ZNRecordStreamingSerializer.deserialize create ZNRecord when found 'id' property, but
if 'id' is not the first item in JSON (from python etc), the record will be null and throw
NullPointerException when parse another property. 
>       while (jp.nextToken() != JsonToken.END_OBJECT) {
>         String fieldname = jp.getCurrentName();
>         jp.nextToken(); // move to value, or START_OBJECT/START_ARRAY
>         if ("id".equals(fieldname)) {
>           // contains an object
>           record = new ZNRecord(jp.getText()); // CREATE ZNRecord
>         } else if ("simpleFields".equals(fieldname)) {
>           while (jp.nextToken() != JsonToken.END_OBJECT) {
>             String key = jp.getCurrentName();
>             jp.nextToken(); // move to value
>             record.setSimpleField(key, jp.getText()); // CRASH
>           }
> we need cached those property before we meet the 'id' property



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message