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)