{"action":"created","issue":{"url":"https://api.github.com/repos/mono/sharpen/issues/27","labels_url":"https://api.github.com/repos/mono/sharpen/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/mono/sharpen/issues/27/comments","events_url":"https://api.github.com/repos/mono/sharpen/issues/27/events","html_url":"https://github.com/mono/sharpen/issues/27","id":22722975,"number":27,"title":"Incorrect conversion of classes declared inside of methods.","user":{"login":"hazzik","id":144791,"avatar_url":"https://avatars.githubusercontent.com/u/144791?v=3","gravatar_id":"","url":"https://api.github.com/users/hazzik","html_url":"https://github.com/hazzik","followers_url":"https://api.github.com/users/hazzik/followers","following_url":"https://api.github.com/users/hazzik/following{/other_user}","gists_url":"https://api.github.com/users/hazzik/gists{/gist_id}","starred_url":"https://api.github.com/users/hazzik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazzik/subscriptions","organizations_url":"https://api.github.com/users/hazzik/orgs","repos_url":"https://api.github.com/users/hazzik/repos","events_url":"https://api.github.com/users/hazzik/events{/privacy}","received_events_url":"https://api.github.com/users/hazzik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-11-15T09:56:06Z","updated_at":"2015-05-28T15:43:24Z","closed_at":null,"body":"```java\r\npublic class ContextFactory\r\n{\r\n    private static ContextFactory global = new ContextFactory();\r\n\r\n    public interface GlobalSetter {\r\n        public void setContextFactoryGlobal(ContextFactory factory);\r\n        public ContextFactory getContextFactoryGlobal();\r\n    }\r\n\r\n    public synchronized static GlobalSetter getGlobalSetter() {\r\n        if (hasCustomGlobal) {\r\n            throw new IllegalStateException();\r\n        }\r\n        hasCustomGlobal = true;\r\n        class GlobalSetterImpl implements GlobalSetter {\r\n            public void setContextFactoryGlobal(ContextFactory factory) {\r\n                global = factory == null ? new ContextFactory() : factory;\r\n            }\r\n            public ContextFactory getContextFactoryGlobal() {\r\n                return global;\r\n            }\r\n        }\r\n        return new GlobalSetterImpl();\r\n    }\r\n}\r\n```\r\n\r\nIs converted to\r\n\r\n```csharp\r\npublic class ContextFactory\r\n{\r\n        private static ContextFactory global = new ContextFactory();\r\n\r\n\tpublic interface GlobalSetter\r\n\t{\r\n\t\tvoid SetContextFactoryGlobal(ContextFactory factory);\r\n\r\n\t\tContextFactory GetContextFactoryGlobal();\r\n\t}\r\n\r\n\tpublic static ContextFactory.GlobalSetter GetGlobalSetter()\r\n\t{\r\n\t\tlock (typeof(ContextFactory))\r\n\t\t{\r\n\t\t\tif (hasCustomGlobal)\r\n\t\t\t{\r\n\t\t\t\tthrow new InvalidOperationException();\r\n\t\t\t}\r\n\t\t\thasCustomGlobal = true;\r\n\t\t\treturn new _T1664473621(this); // we are in the static method\r\n\t\t}\r\n\t}\r\n\r\n\tinternal class _T1664473621 : ContextFactory.GlobalSetter // the name of a class is incorrect\r\n\t{\r\n\t\tpublic virtual void SetContextFactoryGlobal(ContextFactory factory)\r\n\t\t{\r\n\t\t\tContextFactory.global = factory == null ? new ContextFactory() : factory;\r\n\t\t}\r\n\r\n\t\tpublic virtual ContextFactory GetContextFactoryGlobal()\r\n\t\t{\r\n\t\t\treturn ContextFactory.global;\r\n\t\t}\r\n\r\n\t\tinternal _T1664473621(ContextFactory _enclosing)\r\n\t\t{\r\n\t\t\tthis._enclosing = _enclosing;\r\n\t\t}\r\n\r\n\t\tprivate readonly ContextFactory _enclosing;\r\n\t}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/mono/sharpen/issues/comments/106426039","html_url":"https://github.com/mono/sharpen/issues/27#issuecomment-106426039","issue_url":"https://api.github.com/repos/mono/sharpen/issues/27","id":106426039,"user":{"login":"nathanaeljones","id":107935,"avatar_url":"https://avatars.githubusercontent.com/u/107935?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanaeljones","html_url":"https://github.com/nathanaeljones","followers_url":"https://api.github.com/users/nathanaeljones/followers","following_url":"https://api.github.com/users/nathanaeljones/following{/other_user}","gists_url":"https://api.github.com/users/nathanaeljones/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanaeljones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanaeljones/subscriptions","organizations_url":"https://api.github.com/users/nathanaeljones/orgs","repos_url":"https://api.github.com/users/nathanaeljones/repos","events_url":"https://api.github.com/users/nathanaeljones/events{/privacy}","received_events_url":"https://api.github.com/users/nathanaeljones/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T15:43:24Z","updated_at":"2015-05-28T15:43:24Z","body":"Could you add a unit test with the expected result, like https://github.com/imazen/sharpen/commit/b0bc864b1e9a9bea07d8a68caaea9221916ef564"}}