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
Harden against null arguments in simplifier #5144
Conversation
Reviewers: @balajikris, @brettfo, @CyrusNajmabadi, @davkean, @dpoeschl, @jasonmalinowski, @DustinCampbell, @Pilchie, @rchande |
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? 👍 |
These are breaking changes. Do we take these through some sort of breaking change committee and/or document them? |
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. |
@DustinCampbell filed icsharpcode/RefactoringEssentials#105 on RefactoringEssentials |
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. |
@jmarolf I think Simplification tests are in EditorServicesTest2. 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. |
@balajikris thanks, I'll move them. |
Moving simplifier tests from ServiceTest to EditorServicesTest2
These API changes are OK with me. |
Fine with the behavior change in the API as well. |
I'll make a wiki page to note this breaking change between 1.0 and 1.1. |
I thought @gafter already created one. |
@davkean I see, its under docs/Breaking API Changes.md I'll update this pull request to document the changes there. |
Harden against null arguments in simplifier Fixes #5121
Fixes #5121