Skip to content

refactor all remaining == null to is null - #8243

Merged
dreddy-work merged 3 commits into
dotnet:mainfrom
elachlan:is-null
Nov 22, 2022
Merged

dreddy-work merged 3 commits into
dotnet:mainfrom
elachlan:is-null

Conversation

@elachlan

@elachlan elachlan commented Nov 22, 2022 •

Copy link
Copy Markdown
Contributor

Refactors all remaining code to use is null instead of == null using CSharpIsNull analyzer code fix.

Related: #3459

Microsoft Reviewers: Open in CodeFlow

@elachlan
elachlan requested a review from a team as a code owner November 22, 2022 00:02
@ghost ghost assigned elachlan Nov 22, 2022
Assert.False(element1 == (HtmlElement)null);
Assert.True((HtmlElement)null == (HtmlElement)null);
Assert.False(element1 is null);
Assert.False((HtmlElement)null is null);

@dreddy-work dreddy-work Nov 22, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this seems off. What are we doing here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll add back in the casts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hughbe I think you wrote these tests. Could you explain the casts on null here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dreddy-work I added an exclusion for now and we can revisit it to improve the tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@elachlan, do you mind moving the CSisNULL warning suppressions in this PR to linked analyzer PR? Wanted to keep PRs isolated. This PR stand alone doesn't need those suppression if we do not merge other PR yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, so remove it from here and add it in #8244

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@dreddy-work dreddy-work left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

soem last ones seems off.

@ghost ghost added waiting-author-feedback The team requires more information from the author and removed waiting-author-feedback The team requires more information from the author labels Nov 22, 2022
@dreddy-work
dreddy-work enabled auto-merge (squash) November 22, 2022 01:45
@elachlan

Copy link
Copy Markdown
Contributor Author

Flaky test.

@dreddy-work

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@dreddy-work
dreddy-work merged commit f785576 into dotnet:main Nov 22, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Nov 22, 2022
@elachlan
elachlan deleted the is-null branch November 22, 2022 20:29
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants