public short getShortValue(int index) {
        Object value = list.get(index);

        if (value == null) {
            return 0;
        }

        if (value instanceof Number) {
            return ((Number) value).shortValue();
        }

        if (value instanceof String) {
            String str = (String) value;

            if (str.isEmpty() || "null".equalsIgnoreCase(str)) {
                return 0;
            }

            return Short.parseShort(str);
        }

        throw new JSONException("Can not cast '" + value.getClass() + "' to short value");
    }
Returns a short value at the specified location in this {@link com.alibaba.fastjson.JSONArray}.

@param index index of the element to return
@return short
@throws NumberFormatException If the value of get is {@link String} and it contains no parsable short
@throws JSONException Unsupported type conversion to short value
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSONArray.java