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)