Commit ada2c72
authored
[Mono.AndroidTools] Enable nullable reference types in AdbSyncNotification.cs (#11778)
`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.
```csharp
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.1 parent 07ab367 commit ada2c72
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
0 commit comments