As above, you could have typed the parameter JSONObject and avoid casting.