Skip to content

unable to parse empty arays #4

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. JsonParserFactory factory = JsonParserFactory.getInstance();
2. JSONParser parser = factory.newJsonParser();
3. Map<String, List<String>> graph = parser.parseJson("{'a': ['c'], 'b': []}");

What is the expected output? What do you see instead?

==> the expected output is a map containing the json string properly parsed, 
instead what i see is the exception shown at the end

What version of the product are you using? On what operating system?

==> quick-json-1.0.2.3.jar

Please provide any additional information below.

==> 
com.json.exceptions.JSONParsingException: 
@Key-Heirarchy::root/a[0]/  @Key::  Value is expected but found 
empty...@Position::7
    at com.json.utils.JSONUtility.handleFailure(JSONUtility.java:124)
    at com.json.parsers.JSONParser.nonValidatingValueTemplate(JSONParser.java:759)
    at com.json.parsers.JSONParser.jsonArrayTemplate(JSONParser.java:454)
    at com.json.parsers.JSONParser.parseValue(JSONParser.java:368)
    at com.json.parsers.JSONParser.parseKeysValues(JSONParser.java:254)
    at com.json.parsers.JSONParser.parseJsonBody(JSONParser.java:232)
    at com.json.parsers.JSONParser.parseJsonBlock(JSONParser.java:212)
    at com.json.parsers.JSONParser.parseJson(JSONParser.java:139)
    at ... JUnit related stack ...

Original issue reported on code.google.com by angel.vi...@gmail.com on 21 Jun 2013 at 2:12

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions