RFR: 44: GitHubApplication should not use a JSONParser instance
Robin Westberg via github.com
duke at openjdk.java.net
Fri Jul 5 08:23:24 UTC 2019
On Fri, 5 Jul 2019 08:18:21 GMT, Erik Duveblad via github.com <duke at openjdk.java.net> wrote:
> Hi all,
>
> a `JSONParser` instance is not thread-safe and it is therefore a little dangerous to create instances of it _if_ that instance might end up being accessible by multiple threads. We have such a case in `GitHubApplication`. Since a `JSONParser` is very cheap to allocate (it only has an `int` and a pointer) I decided to make `JSONParser` package private thereby forcing all callers to use `JSON.parse`.
>
> Thanks,
> Erik
>
> ## Testing
> - [x] `sh gradlew test` on Linux x86-64
>
> ----------------
>
> Commits:
> - 19e23934: 44: GitHubApplication should not use a JSONParser instance
>
> Pull request:
> http://git.openjdk.java.net/skara/pull/30
>
> Webrev:
> https://openjdk.github.io/cr/skara/30/webrev.00
>
> Patch:
> http://git.openjdk.java.net/skara/pull/30.diff
>
> Fetch command:
> git fetch https://github.com/openjdk/skara.git pull/30/head:pull/30
This PR has been reviewed by Robin Westberg via github.com - changes are approved. Review comment:
Looks good, thanks for fixing!
PR: http://git.openjdk.java.net/skara/pull/30
More information about the skara-dev
mailing list