Skip to content

Enable nullable reference types in JdkPackage.cs#11687

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types
Open

Enable nullable reference types in JdkPackage.cs#11687
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

JdkPackage.cs in the Xamarin.Installer.AndroidSDK project is not opted into nullable reference types. As a clean, immutable data model where every reference-type property is assigned in the constructor, it's a low-risk candidate for enabling NRT.

Changes

  • Added #nullable enable as the first line of src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/JdkPackage.cs, preserving the existing UTF-8 BOM.
#nullable enable

using System;
using System.Collections.Generic;
using System.Linq;

Notes

  • No ! null-forgiving operator introduced.
  • All constructor parameters and properties remain non-nullable by design — the constructor initializes every reference-type member (DisplayName, LicenseID, Vendor, Revision, Archives), so no further code changes or null-validation are required.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable nullable reference types in JdkPackage.cs Enable nullable reference types in JdkPackage.cs Jun 17, 2026
Copilot AI requested a review from jonathanpeppers June 17, 2026 16:50
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 17, 2026 18:23
Copilot AI review requested due to automatic review settings June 17, 2026 18:23

Copilot AI 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

This PR opts JdkPackage.cs in Xamarin.Installer.AndroidSDK into nullable reference types (NRT) by adding a file-level #nullable enable directive, making the type’s nullability contracts explicit to the compiler and consumers.

Changes:

  • Enable NRT for JdkPackage.cs via #nullable enable at the top of the file.

Comment on lines +1 to +3
#nullable enable

using System;
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.

3 participants