{"action":"closed","number":1025,"pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025","id":40952888,"html_url":"https://github.com/swagger-api/swagger-codegen/pull/1025","diff_url":"https://github.com/swagger-api/swagger-codegen/pull/1025.diff","patch_url":"https://github.com/swagger-api/swagger-codegen/pull/1025.patch","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1025","number":1025,"state":"closed","locked":false,"title":"Unreachable Code in Deserialize (type.GetType())","user":{"login":"adamholdenyall","id":7155110,"avatar_url":"https://avatars.githubusercontent.com/u/7155110?v=3","gravatar_id":"","url":"https://api.github.com/users/adamholdenyall","html_url":"https://github.com/adamholdenyall","followers_url":"https://api.github.com/users/adamholdenyall/followers","following_url":"https://api.github.com/users/adamholdenyall/following{/other_user}","gists_url":"https://api.github.com/users/adamholdenyall/gists{/gist_id}","starred_url":"https://api.github.com/users/adamholdenyall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamholdenyall/subscriptions","organizations_url":"https://api.github.com/users/adamholdenyall/orgs","repos_url":"https://api.github.com/users/adamholdenyall/repos","events_url":"https://api.github.com/users/adamholdenyall/events{/privacy}","received_events_url":"https://api.github.com/users/adamholdenyall/received_events","type":"User","site_admin":false},"body":"Removing:\r\n\r\nif (type.GetType() == typeof(Object))\r\n        return (Object)content;\r\n\r\nBecause it is unreachable. When you call .GetType() on an instance of Type, which is being done here, you actually are getting the type of the type, which in this case would be RuntimeType. You don't get the type that the Type object is wrapping. Because you always get the type of RuntimeType, this if statement always evaluates to false.\r\n\r\nI'm proposing to remove these lines, because it seems it always evaluates to false, and therefore isn't hit. Their original purpose seems undocumented as well, and I wonder if it's some kind of workaround.\r\n\r\nA way to have this functionality and have it evaluate properly would be:\r\n\r\nif (type.FullName == typeof(Object).FullName)\r\n        return (Object)content;\r\n\r\nFurther Reading:\r\nhttp://stackoverflow.com/questions/7988781/what-does-gettype-return-on-an-instance-of-type","created_at":"2015-07-27T21:42:17Z","updated_at":"2015-08-18T12:06:42Z","closed_at":"2015-08-18T12:06:42Z","merged_at":null,"merge_commit_sha":"b2570dbcf70fb77a09c9c1fab52718366583d08c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025/commits","review_comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025/comments","review_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1025/comments","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/67a78119d129a14f7284408cb95e6fa77815205d","head":{"label":"adamholdenyall:patch-2","ref":"patch-2","sha":"67a78119d129a14f7284408cb95e6fa77815205d","user":{"login":"adamholdenyall","id":7155110,"avatar_url":"https://avatars.githubusercontent.com/u/7155110?v=3","gravatar_id":"","url":"https://api.github.com/users/adamholdenyall","html_url":"https://github.com/adamholdenyall","followers_url":"https://api.github.com/users/adamholdenyall/followers","following_url":"https://api.github.com/users/adamholdenyall/following{/other_user}","gists_url":"https://api.github.com/users/adamholdenyall/gists{/gist_id}","starred_url":"https://api.github.com/users/adamholdenyall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamholdenyall/subscriptions","organizations_url":"https://api.github.com/users/adamholdenyall/orgs","repos_url":"https://api.github.com/users/adamholdenyall/repos","events_url":"https://api.github.com/users/adamholdenyall/events{/privacy}","received_events_url":"https://api.github.com/users/adamholdenyall/received_events","type":"User","site_admin":false},"repo":{"id":39796036,"name":"swagger-codegen","full_name":"adamholdenyall/swagger-codegen","owner":{"login":"adamholdenyall","id":7155110,"avatar_url":"https://avatars.githubusercontent.com/u/7155110?v=3","gravatar_id":"","url":"https://api.github.com/users/adamholdenyall","html_url":"https://github.com/adamholdenyall","followers_url":"https://api.github.com/users/adamholdenyall/followers","following_url":"https://api.github.com/users/adamholdenyall/following{/other_user}","gists_url":"https://api.github.com/users/adamholdenyall/gists{/gist_id}","starred_url":"https://api.github.com/users/adamholdenyall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamholdenyall/subscriptions","organizations_url":"https://api.github.com/users/adamholdenyall/orgs","repos_url":"https://api.github.com/users/adamholdenyall/repos","events_url":"https://api.github.com/users/adamholdenyall/events{/privacy}","received_events_url":"https://api.github.com/users/adamholdenyall/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamholdenyall/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":true,"url":"https://api.github.com/repos/adamholdenyall/swagger-codegen","forks_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/forks","keys_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/events","assignees_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/merges","archive_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/adamholdenyall/swagger-codegen/releases{/id}","created_at":"2015-07-27T20:22:26Z","updated_at":"2015-07-27T20:22:27Z","pushed_at":"2015-07-30T17:50:30Z","git_url":"git://github.com/adamholdenyall/swagger-codegen.git","ssh_url":"git@github.com:adamholdenyall/swagger-codegen.git","clone_url":"https://github.com/adamholdenyall/swagger-codegen.git","svn_url":"https://github.com/adamholdenyall/swagger-codegen","homepage":"http://swagger.io","size":16724,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"swagger-api:master","ref":"master","sha":"47abfe7079f59f90808f901adaf18504ae8609f2","user":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"repo":{"id":2006876,"name":"swagger-codegen","full_name":"swagger-api/swagger-codegen","owner":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swagger-api/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":false,"url":"https://api.github.com/repos/swagger-api/swagger-codegen","forks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/forks","keys_url":"https://api.github.com/repos/swagger-api/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swagger-api/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swagger-api/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/events","assignees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/swagger-api/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/swagger-api/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/swagger-api/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swagger-api/swagger-codegen/merges","archive_url":"https://api.github.com/repos/swagger-api/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swagger-api/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/swagger-api/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/swagger-api/swagger-codegen/releases{/id}","created_at":"2011-07-06T14:26:48Z","updated_at":"2015-08-18T02:27:18Z","pushed_at":"2015-08-18T12:04:53Z","git_url":"git://github.com/swagger-api/swagger-codegen.git","ssh_url":"git@github.com:swagger-api/swagger-codegen.git","clone_url":"https://github.com/swagger-api/swagger-codegen.git","svn_url":"https://github.com/swagger-api/swagger-codegen","homepage":"http://swagger.io","size":36582,"stargazers_count":1074,"watchers_count":1074,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":618,"mirror_url":null,"open_issues_count":149,"forks":618,"open_issues":149,"watchers":1074,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025"},"html":{"href":"https://github.com/swagger-api/swagger-codegen/pull/1025"},"issue":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1025"},"comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1025/comments"},"review_comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025/comments"},"review_comment":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/1025/commits"},"statuses":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/67a78119d129a14f7284408cb95e6fa77815205d"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":2,"review_comments":0,"commits":1,"additions":0,"deletions":3,"changed_files":1}}