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:27:00 UTC

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

bd2019us created ZEPPELIN-4101:
----------------------------------

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


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

As presented at [https://wink.apache.org/documentation/1.2.1/api/org/apache/wink/json4j/JSONObject.html#getJSONArray(java.lang.String)], "getJSONArray(element)"  may throw "[JSONException|https://wink.apache.org/documentation/1.2.1/api/org/apache/wink/json4j/JSONException.html]" if "element" does not exist in the corresponding JSONObject, where the program risk in crashing. Therefore, to ensure the safety, the method "optJSONArray()" should be preferred.



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