boonproject / boon

Simple opinionated Java for the novice to expert level Java Programmer. Low Ceremony. High Productivity.
http://richardhightower.github.io/site/Boon/Welcome.html
Apache License 2.0
520 stars 102 forks source link

JsonParserFactory().strict().create() parser not strict #324

Open usnavi opened 9 years ago

usnavi commented 9 years ago

Looks like the strict version of the parser allows trailing characters after the object. E.g., the following doesn't throw an exception and parsers successfully:

    val parser = new JsonParserFactory().strict().create()
    parser.parse( """{ "fred" : 1}asdfasfds""" )

Am I enabling the strict parser correctly? Thanks!

RichardHightower commented 9 years ago

LOL.. strict = stricter than lax.

Yeah.. I could throw an exception if strict is enabled and there is stuff after.

usnavi commented 9 years ago

Thanks for getting back to me.

If my team ends up going this route, I'd be happy to issue a PR for this. Let me know if you have any pointers.

RichardHightower commented 9 years ago

ok.. I probably wont get to it today. But it seems like an easy fix.