Skip to content

Use is not null instead of != null in new files from PR #10353 - #10362

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/use-is-not-null-pattern
Jul 31, 2026
Merged

Use is not null instead of != null in new files from PR #10353#10362
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/use-is-not-null-pattern

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Fixes#10361

Replaces != null with is not null in the two files introduced by #10353, aligning them with the repo convention used everywhere else in the Platform codebase.

  • src/Platform/Microsoft.Testing.Extensions.MSBuild/MSBuildConsumer.cs — 4 occurrences (ApplicationStateGuard.Ensure(...))
  • src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/SerializerUtilities.TestNodeSerializers.cs — 5 occurrences

Style-only change; no behavior difference. Verified both projects build with 0 warnings / 0 errors.

Fixes#10361
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ed3dfd9e-f272-4b5a-b0fe-243680d50305
CopilotAI review requested due to automatic review settings July 31, 2026 14:24

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns null checks with the Platform codebase’s established is not null convention. No behavioral changes.

Changes:

  • Replaces nine != null checks with pattern matching.
  • Preserves existing serialization and MSBuild behavior.
Show a summary per file
FileDescription
MSBuildConsumer.csUpdates four lifecycle callback null checks.
SerializerUtilities.TestNodeSerializers.csUpdates five exception null checks.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expert Review — PR #10362

Verdict: No issues found.

This is a straightforward, mechanical style fix replacing != null with is not null in two files introduced by PR #10353, aligning them with the repo convention enforced by .editorconfig and the coding guidelines.

All 8 replacements are correct pattern-matching substitutions with identical semantics (no custom operator != overloads are involved — these are reference-type/nullable checks). No behavioral change, no public API surface change, no new dependencies.

Nothing to flag across any review dimension — clean change. ✅

@EvangelinkAmaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Jul 31, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit e5c4277 into mainJul 31, 2026
52 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/use-is-not-null-pattern branch July 31, 2026 15:30
Amaury Levé (Evangelink) pushed a commit that referenced this pull request Jul 31, 2026
Two more consumers whose state machines my change disturbed, both the same
shape as the hang-dump fix: a retry sequence has one in-progress update for
the whole test but a terminal update per attempt, so completing on a
superseded attempt drops the test while its next attempt is still running.
- `SimplifiedConsoleOutputDeviceBase` completed `_activeTestTracker` before
the superseded gate, so active-test progress stopped after attempt 1. The
comment there also asserted the opposite of what actually happens - "each
attempt has its own in-progress/terminal pair" - which is wrong: MSTest
reports in-progress once per test, outside the retry loop. Corrected both.
- `SlowTestReporterBase` removed the uid from `_inProgress` on every
terminal update, so a retried test stopped producing slow-test diagnostics
after its first attempt. This is a shared base, so the Azure DevOps and
GitHub slow-test reporters inherited the behavior.
Also merges main (#10362).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa37ea7e-23a2-458b-bb8a-68ad56c832e6
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-reviewAwaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-simplifier] Use is not null instead of != null in new files from PR #10353

3 participants

@Evangelink@0101