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

Consider replacing org.json because of license #1016

Closed
flkue opened this issue May 3, 2018 · 3 comments
Closed

Consider replacing org.json because of license #1016

flkue opened this issue May 3, 2018 · 3 comments

Comments

@flkue
Copy link

flkue commented May 3, 2018

Description

The org.json library runs under the JSON license which contains the part
"The Software shall be used for Good, not Evil."

This part leads to the problem, that the software is no longer free.

Links:
https://wiki.debian.org/qa.debian.org/jsonevil
https://www.apache.org/legal/resolved.html#json
https://dzone.com/articles/jsonorg-license-literally-says
https://www.gnu.org/licenses/license-list.html#JSON

To avoid this problem, use an alternative json library.

@rhuss
Copy link
Collaborator

rhuss commented Aug 12, 2018

Agreed, that we move away from org.json. Happy for any pull request. I tried to use

        <dependency>
            <groupId>com.vaadin.external.google</groupId>
            <artifactId>android-json</artifactId>
            <version>0.0.20131108.vaadin1</version>
        </dependency>

but failed because we need a JsonTokener which supports stream. We might consider to move to json-simple or any other json JSON library which supports parsing JSON tokens from a stream.

rdifrango pushed a commit to rdifrango/docker-maven-plugin that referenced this issue Aug 15, 2018
…Android community.

I choose this as it was the closest direct port and was used already in the jsonassert.

Resolves fabric8io#1016
Resolves fabric8io#1064

Signed-off-by: Ronald DiFrango ronald.difrango@capitalone.com
@rdifrango
Copy link
Contributor

@rhuss I just submitted a PR to resolve this and I think I found a work-around for the fact that JsonTokener is missing.

@rhuss
Copy link
Collaborator

rhuss commented Aug 16, 2018

Thanks a lot ! I've seen the workaround but this is not really suitable as it will first consume the whole stream and then creates the tokenizer while the whole handler thing is that the tokens are consumer while they are coming in.

I'm still looking for an alternative and I think that https://github.com/fangyidong/json-simple/blob/master/src/main/java/org/json/simple/parser/JSONParser.java#L91 can do this as it will only consume the next JSON element in the stream and then returns. As json-simple is a complete independent JSON library we should be on the safe side, too.

I can give a try when I find some spare time ...

rdifrango pushed a commit to rdifrango/docker-maven-plugin that referenced this issue Aug 28, 2018
Resolves fabric8io#1016
Resolves fabric8io#1064

Signed-off-by: Ronald DiFrango ronald.difrango@capitalone.com
rhuss pushed a commit that referenced this issue Sep 25, 2018
Replace org.json with GSON 

Fixes #1016 and #1064.

Signed-off-by: Ronald DiFrango ronald.difrango@capitalone.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants