Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net.minidev.json.parser.JSONParser.ACCEPT_TAILLING_DATA seems to have no effect #1

Closed
jochenberger opened this issue Sep 12, 2014 · 10 comments

Comments

@jochenberger
Copy link
Contributor

Trailing data is accepted regardless of what I set the net.minidev.json.parser.JSONParser.ACCEPT_TAILLING_DATA setting to. net.minidev.json.parser.JSONParserBase.checkTaillingData is initialized but never used.

@UrielCh
Copy link
Contributor

UrielCh commented Sep 23, 2014

ACCEPT_TAILLING_DATA is correcty functionnal.
if ACCEPT_TAILLING_DATA is not set JSONSmart will refused data but will accepte Spaces.

I have juste add an ACCEPT_TAILLING_SPACE, to solve your probleme

@UrielCh
Copy link
Contributor

UrielCh commented Sep 23, 2014

this feature look to be only available on json-smart 1.X and is not functionnal in 2.X...

@jochenberger
Copy link
Contributor Author

if ACCEPT_TAILLING_DATA is not set JSONSmart will refused data but will accepte Spaces.

Yes, that's what json-smart 1.x used to do. 2.x accepts {"foo":"bar"}{ no matter what I set ACCEPT_TAILLING_DATA to.

@UrielCh
Copy link
Contributor

UrielCh commented Sep 23, 2014

I found the probleme...

@UrielCh
Copy link
Contributor

UrielCh commented Oct 6, 2014

Can you test the current trunk version, and let me know if the issue is fixed?

@jochenberger
Copy link
Contributor Author

Looks good to me, thanks.

@UrielCh
Copy link
Contributor

UrielCh commented Oct 19, 2014

Finaly 2.0.1 won't be released, switch to version 2.1.0 available on maven central repo

@UrielCh UrielCh closed this as completed Oct 19, 2014
@jochenberger
Copy link
Contributor Author

No, it's not working properly, test case:

    public void testTaillingDataWithSpaceAllowed() throws Exception {
        String s = "{\"t\":0}{";
        MustThrows.testInvalidJson(s, JSONParser.MODE_STRICTEST | JSONParser.ACCEPT_TAILLING_SPACE, ParseException.ERROR_UNEXPECTED_TOKEN);
    }

@UrielCh
Copy link
Contributor

UrielCh commented Oct 20, 2014

I had juste add this test, and fix this side effect.

2014-10-20 9:25 GMT+02:00 jochenberger notifications@github.com:

No, it's not working properly, test case:

public void testTaillingDataWithSpaceAllowed() throws Exception {
    String s = "{\"t\":0}{";
    MustThrows.testInvalidJson(s, JSONParser.MODE_STRICTEST | JSONParser.ACCEPT_TAILLING_SPACE, ParseException.ERROR_UNEXPECTED_TOKEN);
}


Reply to this email directly or view it on GitHub
#1 (comment).

@UrielCh
Copy link
Contributor

UrielCh commented Oct 20, 2014

patched commited as non released version 1.3.2 and 2.1.1

2014-10-20 9:41 GMT+02:00 Uriel Chemouni uriel.chemouni@gmail.com:

I had juste add this test, and fix this side effect.

2014-10-20 9:25 GMT+02:00 jochenberger notifications@github.com:

No, it's not working properly, test case:

public void testTaillingDataWithSpaceAllowed() throws Exception {
    String s = "{\"t\":0}{";
    MustThrows.testInvalidJson(s, JSONParser.MODE_STRICTEST | JSONParser.ACCEPT_TAILLING_SPACE, ParseException.ERROR_UNEXPECTED_TOKEN);
}


Reply to this email directly or view it on GitHub
#1 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants