jakartaee / jsonp-api

Jakarta JSON Processing
https://eclipse.org/ee4j/jsonp
Other
141 stars 61 forks source link

Fixes #146: Avoid using exceptions for flow control in JsonObject implementation #191

Closed jhinch-at-atlassian-com closed 5 years ago

jhinch-at-atlassian-com commented 5 years ago

Exceptions by default will fill stacktraces which is very expensive particularly when performed in a tight loop or in places with deep stacks (such as on webservers). Replace there use within the variants of getString, getInt and getBoolean which apply a default value. The two exceptions which could previously be thrown were null pointers and class cast which are now both handled using an instanceof check

Bug: https://github.com/eclipse-ee4j/jsonp/issues/146

jhinch-at-atlassian-com commented 5 years ago

It seems like the JDK8 build might be having some infrastructure related issues. It doesn't seem related to my changes.

leadpony commented 5 years ago

The failure is due to the problem of Travis CI. Travis uses install-jdk.sh available at https://github.com/sormuras/bach/blob/master/install-jdk.sh. The script has dropped the support of Oracle JDK and now supports only OpenJDK 9 and higher.

jjspiegel commented 5 years ago

Looks good to me, thanks.

jhinch-at-atlassian-com commented 5 years ago

I have rebased my changes onto master. Both builds are now green, the changes are identical. Let me know if there is anything else you want me to do.

jhinch-at-atlassian-com commented 5 years ago

I have updated the copyright years as requested