Skip to content

[Mono.AndroidTools] Enable nullable reference types in AdbSyncNotification.cs#11778

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

[Mono.AndroidTools] Enable nullable reference types in AdbSyncNotification.cs#11778
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types

Conversation

Copilot AI commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

AdbSyncNotification.cs ships in Mono.AndroidTools.dll but compiled in a nullable-oblivious context. This opts the file into NRT, making its existing null contract explicit: LocalPath is null for directory/remove/preserve operations, while RemotePath is always non-null.

Changes

  • src/Mono.AndroidTools/Adb/AdbSyncNotification.cs
    • Added #nullable enable as the first line.
    • Annotated LocalPath property and the localPath constructor parameter as string?; RemotePath stays non-nullable.
public AdbSyncNotification (AdbSyncKind kind, string remotePath, string? localPath, long size)
...
public string? LocalPath { get; private set; }

No null-throwing is required (netstandard2.0, so no ArgumentNullException.ThrowIfNull), and callers in AdbSyncContext.cs, AdbSyncClient.cs, and AndroidDevice.cs are not nullable-enabled, so no call-site changes or warnings result.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable nullable reference types in AdbSyncNotification.cs [Mono.AndroidTools] Enable nullable reference types in AdbSyncNotification.cs Jun 28, 2026
Copilot AI requested a review from jonathanpeppers June 28, 2026 03:08
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.

2 participants