title: Weird behavior when calling org.json.JSONObject.getJSONArray
body: <p>Hey,
  I noticed this really weird behavior when calling getJSONArray.
  This is my code:</p>
  
  <pre><code> JSONObject jsonObject = new JSONObject(data);
   if (!jsonObject.getJSONObject("transfer").has("skill"))
       return Collections.emptyList();
   JSONArray events = jsonObject.getJSONObject("transfer").getJSONArray("skill");
  </code></pre>
  
  <p>now, whenever transfer has more than 1 skill elements, everything works great, but when there is only 1 skill element, Im getting an exception:</p>
  
  <blockquote>
    <p>Caused by: org.json.JSONException:
    Value {"id":"2","name":"DOGS"} at
    skill of type org.json.JSONObject
    cannot be converted to JSONArray
            at org.json.JSON.typeMismatch(JSON.java:96)
            at org.json.JSONObject.getJSONArray(JSONObject.java:548)
    ....</p>
  </blockquote>
  
  <p>Is that makes sense? Do I really have to catch the exception and handle this kind of array specific?</p>
  
  <p>Thanks,
  Udi</p>