You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "bd2019us (JIRA)" <ji...@apache.org> on 2019/03/31 20:42:00 UTC

[jira] [Created] (ZEPPELIN-4102) JSONObject.getJSONObject() may cause program crash if element does not exist.

bd2019us created ZEPPELIN-4102:
----------------------------------

             Summary: JSONObject.getJSONObject() may cause program crash if element does not exist.
                 Key: ZEPPELIN-4102
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4102
             Project: Zeppelin
          Issue Type: Bug
            Reporter: bd2019us


Location: elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/client/HttpBasedClient.java:77

According to the description at [https://wink.apache.org/documentation/1.2.1/api/org/apache/wink/json4j/JSONObject.html], the method "getJSONObject(String)" may throw "[JSONException|https://wink.apache.org/documentation/1.2.1/api/org/apache/wink/json4j/JSONException.html]", which may risk the program in crashing. However, the method "optJSONObject(String)" will return a default value (null) if the element does not exist. To ensure safety, the latter should be preferred.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)