belikeswap / quick-json

Automatically exported from code.google.com/p/quick-json
0 stars 0 forks source link

unable to parse empty arays #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
I'm experiencing the same problem using the same version of quick-json.

Original comment by andreas....@gmail.com on 15 Aug 2013 at 9:49

GoogleCodeExporter commented 9 years ago
{
success: true,
friends: [ ]
}

for this json, it gives same error

Original comment by adem...@gmail.com on 19 Nov 2013 at 9:31

GoogleCodeExporter commented 9 years ago
This makes the package completely unusable.  That was a waste of time.  Please 
fix.  How hard can it be?

Original comment by gym...@gmail.com on 8 May 2014 at 9:14

GoogleCodeExporter commented 9 years ago
There is no workaround, I understand it.  I guess, I would have to reimplement 
my code using another parser or try to fix it myself.  Sad...

Original comment by vassili....@gmail.com on 18 Sep 2014 at 4:31

GoogleCodeExporter commented 9 years ago
You might want to take a look at 
https://code.google.com/p/quick-json/issues/detail?id=11

I fixed this issue among (all?) others that have been reported here.

Original comment by noack.mi...@googlemail.com on 23 Oct 2014 at 3:34