{"action":"opened","issue":{"url":"https://api.github.com/repos/alibaba/fastjson/issues/470","labels_url":"https://api.github.com/repos/alibaba/fastjson/issues/470/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/fastjson/issues/470/comments","events_url":"https://api.github.com/repos/alibaba/fastjson/issues/470/events","html_url":"https://github.com/alibaba/fastjson/issues/470","id":122209802,"number":470,"title":"使用 JSONArray 的 getObject(int index, Class<T> clazz) 方法时反序列化错误","user":{"login":"ScienJus","id":8350653,"avatar_url":"https://avatars.githubusercontent.com/u/8350653?v=3","gravatar_id":"","url":"https://api.github.com/users/ScienJus","html_url":"https://github.com/ScienJus","followers_url":"https://api.github.com/users/ScienJus/followers","following_url":"https://api.github.com/users/ScienJus/following{/other_user}","gists_url":"https://api.github.com/users/ScienJus/gists{/gist_id}","starred_url":"https://api.github.com/users/ScienJus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScienJus/subscriptions","organizations_url":"https://api.github.com/users/ScienJus/orgs","repos_url":"https://api.github.com/users/ScienJus/repos","events_url":"https://api.github.com/users/ScienJus/events{/privacy}","received_events_url":"https://api.github.com/users/ScienJus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-15T07:20:59Z","updated_at":"2015-12-15T07:20:59Z","closed_at":null,"body":"版本为1.2.7\r\n当反序列化的字段为 boolean 类型，并且 JSON 中的值为 null 时，使用 JSONArray 的 getObject(int index, Class<T> clazz) 方法会报解析错误。\r\n\r\n原因是 TypeUtils 的866行的：\r\n\r\nmethod.invoke(object, new Object[] { value });\r\n\r\n将 null 传入了基本类型为参数的方法中，导致自动拆箱报错。\r\n\r\n但是使用 JSON 的 parseObject(String text, Class<T> clazz, Feature... features) 方法则不会报错。"}}