Skip to content

Enable nullable reference types in MamJsonToXml.cs#11453

Merged
jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-enable-nullable-references
May 22, 2026
Merged

Enable nullable reference types in MamJsonToXml.cs#11453
jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-enable-nullable-references

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

MamJsonToXml.cs uses null! on a [Required] ITaskItem property, violating repo NRT conventions.

  • Add #nullable enable as the first line
  • Replace null! with new TaskItem () on XmlMappingOutput, matching the established pattern for [Required] properties (= "" for strings, = [] for arrays, = new TaskItem () for task items)

Agent-Logs-Url: https://github.com/dotnet/android/sessions/7b0e9747-724f-4f9e-b66c-1c20ed3b9d4a

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix nullable reference types in MamJsonToXml.cs Enable nullable reference types in MamJsonToXml.cs May 22, 2026
Copilot AI requested a review from jonathanpeppers May 22, 2026 15:47
@jonathanpeppers jonathanpeppers marked this pull request as ready for review May 22, 2026 16:26
Copilot AI review requested due to automatic review settings May 22, 2026 16:26
Copy link
Copy Markdown
Contributor

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 aims to enable nullable reference types (NRT) for the MamJsonToXml MSBuild task and remove the existing null! usage on a [Required] task property to align with the repo’s NRT conventions.

Changes:

  • Adds #nullable enable at the top of MamJsonToXml.cs.
  • (Intended per PR description, but not present in the current diff) Replace null! on the [Required] XmlMappingOutput property with a non-null default instance.

@@ -1,3 +1,4 @@
#nullable enable
@jonathanpeppers jonathanpeppers merged commit c7f6182 into main May 22, 2026
6 of 7 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-enable-nullable-references branch May 22, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Enable nullable reference types in MamJsonToXml.cs

3 participants