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

Unsealed IDisposable should contain protected virtual void Dispose(bool) method #11820

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Feb 10, 2020

PR Summary

PR Context

Fix code smell: https://rules.sonarsource.com/csharp/RSPEC-3881

PR Checklist

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Feb 10, 2020

PowerShell-CI-linux failed in build 45608: Invoke-WebRequest tests.Denial of service.Image Parsing Issue opened: #11821

@PaulHigin PaulHigin added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Feb 18, 2020
@PaulHigin
Copy link
Contributor

Adding committee review tag. I am not sure if these changes should be made.

@iSazonov
Copy link
Collaborator

Perhaps it makes sense for public (not sealed) classes.

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee reviewed this, we should not make any unnecessary changes to private/internal classes. We should review public classes if the change makes sense. Additionally, going forward, we would appreciate if the summary section is filled out to provide context on the reasons for making this change and enable the committee to have more productive conversations during review.

@SteveL-MSFT SteveL-MSFT added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Feb 19, 2020
@xtqqczze xtqqczze closed this Feb 21, 2020
@iSazonov
Copy link
Collaborator

@xtqqczze Do you want to continue with reviewing public classes?

@xtqqczze xtqqczze reopened this Feb 22, 2020
@xtqqczze xtqqczze changed the title Fix IDisposable implementation by defining Dispose method as virtual WIP: Fix IDisposable implementation by defining Dispose method as virtual Feb 22, 2020
@iSazonov
Copy link
Collaborator

@xtqqczze Friendly ping.

@xtqqczze xtqqczze force-pushed the patch-dispose-virtual-method branch 3 times, most recently from 63851c4 to ea36c64 Compare April 10, 2020 22:46
@xtqqczze xtqqczze changed the title WIP: Fix IDisposable implementation by defining Dispose method as virtual WIP: Fix IDisposable implementation Apr 10, 2020
@xtqqczze xtqqczze force-pushed the patch-dispose-virtual-method branch from ea36c64 to 666b6c0 Compare April 10, 2020 23:19
@ghost ghost added the Review - Needed The PR is being reviewed label May 27, 2020
@ghost
Copy link

ghost commented May 27, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Mainainer, Please provide feedback and/or mark it as Waiting on Author

@iSazonov
Copy link
Collaborator

@xtqqczze Do you want to continue?

@TravisEz13 TravisEz13 added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Review - Needed The PR is being reviewed Review - Waiting on Author labels May 27, 2020
@xtqqczze xtqqczze changed the title WIP: Fix IDisposable implementation Fix IDisposable implementation May 28, 2020
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label May 28, 2020
@xtqqczze
Copy link
Contributor Author

@iSazonov yes please, thanks for the reminder

@ghost ghost added the Review - Needed The PR is being reviewed label Jun 4, 2020
@ghost
Copy link

ghost commented Jun 4, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Mainainer, Please provide feedback and/or mark it as Waiting on Author

@xtqqczze xtqqczze changed the title Fix IDisposable implementation Unsealed IDisposable should contain protected virtual void Dispose(bool) method Jul 8, 2020
@xtqqczze xtqqczze force-pushed the patch-dispose-virtual-method branch from 666b6c0 to 34b7535 Compare July 8, 2020 22:34
@xtqqczze
Copy link
Contributor Author

xtqqczze commented Jul 8, 2020

Rebased for CI, this PR is ready for review.

@iSazonov
Copy link
Collaborator

iSazonov commented Jul 9, 2020

I would not change this old code without urgent need.

/cc @daxian-dbw @PaulHigin for conclusion.

@ghost ghost removed the Review - Needed The PR is being reviewed label Jul 9, 2020
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through these changes and agree with @iSazonov that they don't really provide much value with some small risk. Some classes are internal and should be 'sealed' because they are not meant to be derived from. Others are public and also should probably be sealed.

I appreciate the effort to find and make these changes, but I feel we shouldn't submit the changes because there is no compelling reason to.

@ghost ghost added the Review - Needed The PR is being reviewed label Jul 17, 2020
@ghost
Copy link

ghost commented Jul 17, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

xtqqczze added a commit to xtqqczze/PowerShell that referenced this pull request Feb 13, 2024
The motivation of this PR is this comment by @PaulHigin PowerShell#11820 (comment).

_Contributes to PowerShell#15110._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committee-Reviewed PS-Committee has reviewed this and made a decision Review - Needed The PR is being reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants