{"action":"closed","issue":{"url":"https://api.github.com/repos/ayende/rhino-mocks/issues/23","repository_url":"https://api.github.com/repos/ayende/rhino-mocks","labels_url":"https://api.github.com/repos/ayende/rhino-mocks/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/ayende/rhino-mocks/issues/23/comments","events_url":"https://api.github.com/repos/ayende/rhino-mocks/issues/23/events","html_url":"https://github.com/ayende/rhino-mocks/issues/23","id":188235803,"number":23,"title":"Concurrency bug in MockRepository","user":{"login":"Darxis69","id":10614436,"avatar_url":"https://avatars.githubusercontent.com/u/10614436?v=3","gravatar_id":"","url":"https://api.github.com/users/Darxis69","html_url":"https://github.com/Darxis69","followers_url":"https://api.github.com/users/Darxis69/followers","following_url":"https://api.github.com/users/Darxis69/following{/other_user}","gists_url":"https://api.github.com/users/Darxis69/gists{/gist_id}","starred_url":"https://api.github.com/users/Darxis69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Darxis69/subscriptions","organizations_url":"https://api.github.com/users/Darxis69/orgs","repos_url":"https://api.github.com/users/Darxis69/repos","events_url":"https://api.github.com/users/Darxis69/events{/privacy}","received_events_url":"https://api.github.com/users/Darxis69/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-09T12:27:27Z","updated_at":"2016-11-09T12:31:52Z","closed_at":"2016-11-09T12:31:52Z","body":"I've triggered a bug in MockRepository class. The problem is with the static dictionary `generatorMap`, more precisely with following method (this is the only method that access this dictionary):\r\n\r\n```\r\nprotected virtual ProxyGenerator GetProxyGenerator(Type type)\r\n{\r\n    if (!generatorMap.ContainsKey(type))\r\n    {\r\n        generatorMap[type] = new ProxyGenerator();\r\n    }\r\n\r\n    return generatorMap[type];\r\n}\r\n```\r\n\r\nAs tests are usually run in parallel, this can lead to a NullReferenceException in the GetProxyGenerator method when accessing/inserting into the dictionary (see http://stackoverflow.com/a/2195287/699850).\r\n\r\nPR with Fix: #24 "}}
{"actor":{"display_login":"Darxis69"}}