pvdung / quick-json

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

Library doesn't parse Doubles with exponents, escape sequences, nulls, booleans or empty arrays (Fix included) #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to parse the following json sequence:

{
    "error": "0",
    "test": "",
    "test2": {},
    "test3": [

    ],
    "test4": 4,
    "test5": null,
    "test6": true,
    "test7": false,
    "test8": "Test \"8\"\\Blub\u0009\uA000\u0009\u1234\n",
    "test9": 4.5,
    "wikiexample": {
  "Herausgeber": "Xema",
  "Nummer": "1234-5678-9012-3456",
  "Deckung": 2e+6,
  "Währung": "EURO",
  "Inhaber": {
    "Name": "Mustermann",
    "Vorname": "Mäx",
    "männlich": true,
    "Hobbys": [ "Reiten", "Golfen", "Lesen" ],
    "Alter": 42,
    "Kinder": [],
    "Partner": null
  }
}
}

What is the expected output? What do you see instead?
{error=0, test=, test8=Test "8"\Blub    ꀀ ሴ
, test9=4.5, test6=true, wikiexample={Währung=EURO, Herausgeber=Xema, 
Deckung=2000000.0, Inhaber={Name=Mustermann, Hobbys=[Reiten, Golfen, Lesen], 
männlich=true, Kinder=[], Alter=42, Partner=null, Vorname=Mäx}, 
Nummer=1234-5678-9012-3456}, test7=false, test4=4, test5=null, test2={}, 
test3=[]}

Instead errors are thrown.

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

Please provide any additional information below.
I have applied all patches provided in issues 2-10. I think I have also fixed 
all the issues without patches and I added support for proper typing inside the 
map (including support for "null"). Please find the patchset attached to build 
it yourself. Each patch corresponds to a commit in my git repository while 
working on it. I will also add a binary version and a source jar. Please be 
aware that I had to work with a code base I'm unfamiliar with so I tried to 
touch as little as possible. The code isn't really beautiful, but it works with 
all the test-cases I have created.

Due to the large number of changes and new features I have named this build 
quick-json version 1.3.

Original issue reported on code.google.com by noack.mi...@googlemail.com on 8 Aug 2014 at 12:13

Attachments:

GoogleCodeExporter commented 9 years ago
Reupload of the jars with proper manifest

Original comment by noack.mi...@googlemail.com on 8 Aug 2014 at 12:19

Attachments:

GoogleCodeExporter commented 9 years ago
Reupload with the name 1.0.3 to match the versioning scheme of the author

Original comment by noack.mi...@googlemail.com on 8 Aug 2014 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago
Version 1.0.4 fixes bug introduced with content typing. Strings that were 
numbers were incorrectly parsed as Integer or Double. This could mess up 
telephone numbers and similar content. Strings are now always parsed as Strings.

Original comment by noack.mi...@googlemail.com on 11 Aug 2014 at 10:48

Attachments:

GoogleCodeExporter commented 9 years ago
Version 1.0.4.1 fixes validation parser throwing exception on empty array

Original comment by noack.mi...@googlemail.com on 14 Aug 2014 at 12:52

Attachments: