Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden against null arguments in simplifier #5144

Merged
merged 3 commits into from Sep 11, 2015

Conversation

jmarolf
Copy link
Contributor

@jmarolf jmarolf commented Sep 10, 2015

Fixes #5121

@jmarolf
Copy link
Contributor Author

jmarolf commented Sep 10, 2015

@DustinCampbell
Copy link
Member

To be pedantic, this isn't really "hardening". It's making the APIs throw exceptions on null arguments like they already should have been. Are you in touch with the Refactoring Essentials folks per #5121?

👍

@davkean
Copy link
Member

davkean commented Sep 10, 2015

These are breaking changes. Do we take these through some sort of breaking change committee and/or document them?

@DustinCampbell
Copy link
Member

Yes, they're technically breaking changes. Having null for any of these arguments would have failed very quickly but they wouldn't have failed with ArgumentNullExceptions and so would potentially fall through existing catch blocks.

@jmarolf
Copy link
Contributor Author

jmarolf commented Sep 10, 2015

@DustinCampbell filed icsharpcode/RefactoringEssentials#105 on RefactoringEssentials

@DustinCampbell
Copy link
Member

Adding a few other folks to provide guidance on the API breaking changes. I'm totally comfortable with this one as I believe this is very seldom called by client code and the conditions under which a user would experience a behavior change are uncommon. In general, most client code calls this indirectly by applying simplification annotations in a CodeAction. The CodeAction engine calls the simplifier APIs on behalf of the client.

@mattwar, @AnthonyDGreen, @jaredpar, @srivatsn, @gafter

@balajikris
Copy link
Member

@jmarolf I think Simplification tests are in EditorServicesTest2.
See: http://source.roslyn.io/#Roslyn.Services.Editor.UnitTests2/Simplification/AbstractSimplificationTests.vb

It was probably authored there to take advantage of VB xml literals but I'm not certain.. See if you should move your tests to that directory and/or unify their location.

@jmarolf
Copy link
Contributor Author

jmarolf commented Sep 11, 2015

@balajikris thanks, I'll move them.

Moving simplifier tests from ServiceTest to EditorServicesTest2
@gafter
Copy link
Member

gafter commented Sep 11, 2015

These API changes are OK with me.

@jaredpar
Copy link
Member

Fine with the behavior change in the API as well.

@jmarolf
Copy link
Contributor Author

jmarolf commented Sep 11, 2015

I'll make a wiki page to note this breaking change between 1.0 and 1.1.

@davkean
Copy link
Member

davkean commented Sep 11, 2015

I thought @gafter already created one.

@jmarolf
Copy link
Contributor Author

jmarolf commented Sep 11, 2015

@davkean I see, its under docs/Breaking API Changes.md I'll update this pull request to document the changes there.

jmarolf added a commit that referenced this pull request Sep 11, 2015
Harden against null arguments in simplifier
Fixes #5121
@jmarolf jmarolf merged commit 4176470 into dotnet:master Sep 11, 2015
@jmarolf jmarolf deleted the RedundantPrivateCodeFixProvider branch October 24, 2015 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants