{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/85375251","pull_request_review_id":6096148,"id":85375251,"diff_hunk":"@@ -1726,6 +1812,59 @@ internal static string GetDefaultStableNamespace(string clrNs)\n             return new Uri(Globals.DataContractXsdBaseNamespaceUri, clrNs).AbsoluteUri;\n         }\n \n+        internal static void GetDefaultStableName(string fullTypeName, out string localName, out string ns)\n+        {\n+            CodeTypeReference typeReference = new CodeTypeReference(fullTypeName);\n+            GetDefaultStableName(typeReference, out localName, out ns);\n+        }\n+\n+        private static void GetDefaultStableName(CodeTypeReference typeReference, out string localName, out string ns)\n+        {\n+            string fullTypeName = typeReference.BaseType;\n+            DataContract dataContract = GetBuiltInDataContract(fullTypeName);\n+            if (dataContract != null)\n+            {\n+                localName = dataContract.StableName.Name;\n+                ns = dataContract.StableName.Namespace;\n+                return;\n+            }\n+\n+            GetClrNameAndNamespace(fullTypeName, out localName, out ns);\n+            if (typeReference.TypeArguments.Count > 0)\n+            {\n+                StringBuilder localNameBuilder = new StringBuilder();\n+                StringBuilder argNamespacesBuilder = new StringBuilder();\n+                bool parametersFromBuiltInNamespaces = true;\n+                IList<int> nestedParamCounts = GetDataContractNameForGenericName(localName, localNameBuilder);","path":"src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs","position":215,"original_position":215,"commit_id":"ff03c2f445102ecb49b2f40ca641caaf1fcefd46","original_commit_id":"ff03c2f445102ecb49b2f40ca641caaf1fcefd46","user":{"login":"justinvp","id":710598,"avatar_url":"https://avatars.githubusercontent.com/u/710598?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvp","html_url":"https://github.com/justinvp","followers_url":"https://api.github.com/users/justinvp/followers","following_url":"https://api.github.com/users/justinvp/following{/other_user}","gists_url":"https://api.github.com/users/justinvp/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvp/subscriptions","organizations_url":"https://api.github.com/users/justinvp/orgs","repos_url":"https://api.github.com/users/justinvp/repos","events_url":"https://api.github.com/users/justinvp/events{/privacy}","received_events_url":"https://api.github.com/users/justinvp/received_events","type":"User","site_admin":false},"body":"I realize there are a bunch of allocations going on in this method, but one allocation could be avoided by changing the return type of `GetDataContractNameForGenericName` from `IList<int>` to `List<int>` and `nestedParamCounts` to `List<int>`, which would avoid the enumerator allocation in the `foreach` below (since it would use `List<T>`'s struct enumerator instead of the boxed enumerator that would be returned from `IList<int>`).","created_at":"2016-10-27T16:25:56Z","updated_at":"2016-10-27T16:25:56Z","html_url":"https://github.com/dotnet/corefx/pull/13068#discussion_r85375251","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/13068","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/85375251"},"html":{"href":"https://github.com/dotnet/corefx/pull/13068#discussion_r85375251"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/13068"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/13068","id":91105280,"html_url":"https://github.com/dotnet/corefx/pull/13068","diff_url":"https://github.com/dotnet/corefx/pull/13068.diff","patch_url":"https://github.com/dotnet/corefx/pull/13068.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/13068","number":13068,"state":"open","locked":false,"title":"Enable DCS/DCJS to Serialize ISerializable Types.","user":{"login":"shmao","id":12262109,"avatar_url":"https://avatars.githubusercontent.com/u/12262109?v=3","gravatar_id":"","url":"https://api.github.com/users/shmao","html_url":"https://github.com/shmao","followers_url":"https://api.github.com/users/shmao/followers","following_url":"https://api.github.com/users/shmao/following{/other_user}","gists_url":"https://api.github.com/users/shmao/gists{/gist_id}","starred_url":"https://api.github.com/users/shmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmao/subscriptions","organizations_url":"https://api.github.com/users/shmao/orgs","repos_url":"https://api.github.com/users/shmao/repos","events_url":"https://api.github.com/users/shmao/events{/privacy}","received_events_url":"https://api.github.com/users/shmao/received_events","type":"User","site_admin":false},"body":"The fix is to enable DCS/DCJS to serialize/deserialize types inheriting ISerializable interface.\r\n\r\nRef #11477.\r\n\r\n/cc: @zhenlan @mconnew @huanwu ","created_at":"2016-10-26T23:01:59Z","updated_at":"2016-10-27T16:25:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/13068/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/13068/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/13068/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/ff03c2f445102ecb49b2f40ca641caaf1fcefd46","head":{"label":"shmao:ISerializableImpl","ref":"ISerializableImpl","sha":"ff03c2f445102ecb49b2f40ca641caaf1fcefd46","user":{"login":"shmao","id":12262109,"avatar_url":"https://avatars.githubusercontent.com/u/12262109?v=3","gravatar_id":"","url":"https://api.github.com/users/shmao","html_url":"https://github.com/shmao","followers_url":"https://api.github.com/users/shmao/followers","following_url":"https://api.github.com/users/shmao/following{/other_user}","gists_url":"https://api.github.com/users/shmao/gists{/gist_id}","starred_url":"https://api.github.com/users/shmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmao/subscriptions","organizations_url":"https://api.github.com/users/shmao/orgs","repos_url":"https://api.github.com/users/shmao/repos","events_url":"https://api.github.com/users/shmao/events{/privacy}","received_events_url":"https://api.github.com/users/shmao/received_events","type":"User","site_admin":false},"repo":{"id":39537803,"name":"corefx","full_name":"shmao/corefx","owner":{"login":"shmao","id":12262109,"avatar_url":"https://avatars.githubusercontent.com/u/12262109?v=3","gravatar_id":"","url":"https://api.github.com/users/shmao","html_url":"https://github.com/shmao","followers_url":"https://api.github.com/users/shmao/followers","following_url":"https://api.github.com/users/shmao/following{/other_user}","gists_url":"https://api.github.com/users/shmao/gists{/gist_id}","starred_url":"https://api.github.com/users/shmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmao/subscriptions","organizations_url":"https://api.github.com/users/shmao/orgs","repos_url":"https://api.github.com/users/shmao/repos","events_url":"https://api.github.com/users/shmao/events{/privacy}","received_events_url":"https://api.github.com/users/shmao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shmao/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/shmao/corefx","forks_url":"https://api.github.com/repos/shmao/corefx/forks","keys_url":"https://api.github.com/repos/shmao/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shmao/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shmao/corefx/teams","hooks_url":"https://api.github.com/repos/shmao/corefx/hooks","issue_events_url":"https://api.github.com/repos/shmao/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/shmao/corefx/events","assignees_url":"https://api.github.com/repos/shmao/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/shmao/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/shmao/corefx/tags","blobs_url":"https://api.github.com/repos/shmao/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shmao/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shmao/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/shmao/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shmao/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/shmao/corefx/languages","stargazers_url":"https://api.github.com/repos/shmao/corefx/stargazers","contributors_url":"https://api.github.com/repos/shmao/corefx/contributors","subscribers_url":"https://api.github.com/repos/shmao/corefx/subscribers","subscription_url":"https://api.github.com/repos/shmao/corefx/subscription","commits_url":"https://api.github.com/repos/shmao/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/shmao/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/shmao/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/shmao/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/shmao/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/shmao/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shmao/corefx/merges","archive_url":"https://api.github.com/repos/shmao/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shmao/corefx/downloads","issues_url":"https://api.github.com/repos/shmao/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/shmao/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/shmao/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/shmao/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shmao/corefx/labels{/name}","releases_url":"https://api.github.com/repos/shmao/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/shmao/corefx/deployments","created_at":"2015-07-23T00:55:49Z","updated_at":"2016-08-08T17:11:12Z","pushed_at":"2016-10-26T23:43:39Z","git_url":"git://github.com/shmao/corefx.git","ssh_url":"git@github.com:shmao/corefx.git","clone_url":"https://github.com/shmao/corefx.git","svn_url":"https://github.com/shmao/corefx","homepage":"http://dotnet.github.io/core/","size":110233,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dotnet:master","ref":"master","sha":"6d523750c4356af1d5c9e001c362baa833059833","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2016-10-27T09:36:22Z","pushed_at":"2016-10-27T16:21:27Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://docs.microsoft.com/dotnet/","size":156113,"stargazers_count":10701,"watchers_count":10701,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2694,"mirror_url":null,"open_issues_count":1460,"forks":2694,"open_issues":1460,"watchers":10701,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/13068"},"html":{"href":"https://github.com/dotnet/corefx/pull/13068"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/13068"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/13068/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/13068/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/13068/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/ff03c2f445102ecb49b2f40ca641caaf1fcefd46"}}}}
{"actor":{"display_login":"justinvp"}}