Skip to content

Conversation

akoeplinger
Copy link
Member

Fixes #118409

@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 21:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes xUnit1041 analyzer warnings in priority 1 runtime tests by changing public constructors to private where the constructors are not used outside their containing classes. The xUnit1041 rule flags constructors that appear to be public but are never instantiated externally, suggesting they should be made private to improve encapsulation.

  • Changes public constructors to private across 7 test files
  • Improves code encapsulation by restricting constructor visibility
  • Addresses static analysis warnings without changing test functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
NestedException.cs Changed NestedException constructor from public to private
MultipleException.cs Changed MultipleException constructor from public to private
HandlerException.cs Changed HandlerException constructor from public to private
rethrow.cs Changed RethrowException constructor from public to private
Inline_NewObj.cs Changed MainApp_Inline constructor from public to private
arrres.cs Changed Test constructor from public to private
ClosedStatic.cs Changed Program constructor from public to private

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025
@akoeplinger
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@akoeplinger akoeplinger added area-Infrastructure and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 5, 2025
@akoeplinger akoeplinger requested a review from jkotas August 5, 2025 21:41
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@MichalStrehovsky MichalStrehovsky merged commit e399fff into main Aug 6, 2025
125 checks passed
@MichalStrehovsky MichalStrehovsky deleted the fix-xunit1041 branch August 6, 2025 00:11
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Pri1 CoreCLR test build is failing with xUnit1041 error

3 participants