{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/1016","repository_url":"https://api.github.com/repos/dotnet/roslyn-analyzers","labels_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/1016/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/1016/comments","events_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/1016/events","html_url":"https://github.com/dotnet/roslyn-analyzers/issues/1016","id":155864417,"number":1016,"title":"Broken tests (and possibly analyzer) for CA2200","user":{"login":"bkoelman","id":10324372,"avatar_url":"https://avatars.githubusercontent.com/u/10324372?v=3","gravatar_id":"","url":"https://api.github.com/users/bkoelman","html_url":"https://github.com/bkoelman","followers_url":"https://api.github.com/users/bkoelman/followers","following_url":"https://api.github.com/users/bkoelman/following{/other_user}","gists_url":"https://api.github.com/users/bkoelman/gists{/gist_id}","starred_url":"https://api.github.com/users/bkoelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkoelman/subscriptions","organizations_url":"https://api.github.com/users/bkoelman/orgs","repos_url":"https://api.github.com/users/bkoelman/repos","events_url":"https://api.github.com/users/bkoelman/events{/privacy}","received_events_url":"https://api.github.com/users/bkoelman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-20T00:28:18Z","updated_at":"2016-05-29T23:01:31Z","closed_at":null,"body":"#### Analyzer package\r\nMicrosoft.QualityGuidelines.Analyzers\r\n\r\n#### Analyzer\r\nCA2200: RethrowToPreserveStackDetailsAnalyzer\r\n\r\nThe code in test https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.QualityGuidelines.Analyzers/UnitTests/RethrowToPreserveStackDetailsTests.cs#L69 contains several compile errors:\r\n\r\n```csharp\r\n01 using System;\r\n02 \r\n03 class Program\r\n04 {\r\n05     void CatchAndRethrowExplicitly()\r\n06     {   \r\n07         try\r\n08         {\r\n09             try\r\n10             {\r\n11                 throw new ArithmeticException();\r\n12             }\r\n13             catch (ArithmeticException e)\r\n14             {\r\n15                 throw;\r\n16             }\r\n17             catch (ArithmeticException)\r\n18                 try\r\n19                 {\r\n20                     throw new ArithmeticException();\r\n21                 }\r\n22                 catch (ArithmeticException i)\r\n23                 {\r\n24                     throw e;\r\n25                 }\r\n26             }\r\n27         }\r\n28         catch (Exception e)\r\n29         {\r\n30             throw;\r\n31         }\r\n32     }\r\n33 }\r\n```\r\n\r\n* line 17: CS1514 { expected\r\n* line 24: CS0103 The name 'e' does not exist in the current context\r\n* line 17: CS0160 A previous catch clause already catches all exceptions of this or of a super type ('ArithmeticException')\r\n\r\nFixing any of these errors causes the analyzer under test to start emitting warnings, while the test expects no warnings. Of course the broken code could be intentional, but based on the test name CA2200CSharpTestWithLegalExceptionThrowNested that seems unlikely.\r\n\r\nOften it helps to look at [the related VB test](CA2200VisualBasicTestWithLegalExceptionThrowNested). But that one has its own compiler errors, so I'm lost on how to resolve these.\r\n\r\nAre only these tests broken, or is the analyzer too?"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/comments/222388002","html_url":"https://github.com/dotnet/roslyn-analyzers/issues/1016#issuecomment-222388002","issue_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/1016","id":222388002,"user":{"login":"bkoelman","id":10324372,"avatar_url":"https://avatars.githubusercontent.com/u/10324372?v=3","gravatar_id":"","url":"https://api.github.com/users/bkoelman","html_url":"https://github.com/bkoelman","followers_url":"https://api.github.com/users/bkoelman/followers","following_url":"https://api.github.com/users/bkoelman/following{/other_user}","gists_url":"https://api.github.com/users/bkoelman/gists{/gist_id}","starred_url":"https://api.github.com/users/bkoelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkoelman/subscriptions","organizations_url":"https://api.github.com/users/bkoelman/orgs","repos_url":"https://api.github.com/users/bkoelman/repos","events_url":"https://api.github.com/users/bkoelman/events{/privacy}","received_events_url":"https://api.github.com/users/bkoelman/received_events","type":"User","site_admin":false},"created_at":"2016-05-29T23:01:31Z","updated_at":"2016-05-29T23:01:31Z","body":"@srivatsn I'm having difficulties tracking the author of these tests. Do you know?"}}
{"actor":{"display_login":"bkoelman"}}