{"action":"created","issue":{"url":"https://api.github.com/repos/fukumotom/WorkManager/issues/5","repository_url":"https://api.github.com/repos/fukumotom/WorkManager","labels_url":"https://api.github.com/repos/fukumotom/WorkManager/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/fukumotom/WorkManager/issues/5/comments","events_url":"https://api.github.com/repos/fukumotom/WorkManager/issues/5/events","html_url":"https://github.com/fukumotom/WorkManager/issues/5","id":146248175,"number":5,"title":"JSPでgetAttributeする際の型チェック","user":{"login":"btkigamim","id":14105196,"avatar_url":"https://avatars.githubusercontent.com/u/14105196?v=3","gravatar_id":"","url":"https://api.github.com/users/btkigamim","html_url":"https://github.com/btkigamim","followers_url":"https://api.github.com/users/btkigamim/followers","following_url":"https://api.github.com/users/btkigamim/following{/other_user}","gists_url":"https://api.github.com/users/btkigamim/gists{/gist_id}","starred_url":"https://api.github.com/users/btkigamim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btkigamim/subscriptions","organizations_url":"https://api.github.com/users/btkigamim/orgs","repos_url":"https://api.github.com/users/btkigamim/repos","events_url":"https://api.github.com/users/btkigamim/events{/privacy}","received_events_url":"https://api.github.com/users/btkigamim/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-06T09:22:37Z","updated_at":"2016-04-13T01:22:18Z","closed_at":"2016-04-13T01:22:18Z","body":"JSPでサーブレットから値を取得する場合は、以下のような型チェックが必要。\r\nただキャストだけすると警告になる。\r\n\r\n```\r\n\t\tObject obj = request.getAttribute(\"workList\");\r\n\t\tArrayList<Work> workList = new ArrayList<Work>();\r\n\r\n\t\tif (obj instanceof ArrayList<?>) {\r\n\t\t\tArrayList<?> list = (ArrayList<?>) obj;\r\n\t\t\tfor (Object o : list) {\r\n\t\t\t\tif (o instanceof Work) {\r\n\t\t\t\t\tworkList.add((Work) o);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/fukumotom/WorkManager/issues/comments/209176381","html_url":"https://github.com/fukumotom/WorkManager/issues/5#issuecomment-209176381","issue_url":"https://api.github.com/repos/fukumotom/WorkManager/issues/5","id":209176381,"user":{"login":"btkigamim","id":14105196,"avatar_url":"https://avatars.githubusercontent.com/u/14105196?v=3","gravatar_id":"","url":"https://api.github.com/users/btkigamim","html_url":"https://github.com/btkigamim","followers_url":"https://api.github.com/users/btkigamim/followers","following_url":"https://api.github.com/users/btkigamim/following{/other_user}","gists_url":"https://api.github.com/users/btkigamim/gists{/gist_id}","starred_url":"https://api.github.com/users/btkigamim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btkigamim/subscriptions","organizations_url":"https://api.github.com/users/btkigamim/orgs","repos_url":"https://api.github.com/users/btkigamim/repos","events_url":"https://api.github.com/users/btkigamim/events{/privacy}","received_events_url":"https://api.github.com/users/btkigamim/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T01:22:18Z","updated_at":"2016-04-13T01:22:18Z","body":"型チェックを1クラスに実装完了。\r\n移行は横並びで確認できるため、クローズ"}}