Skip to content

[fix-finder] Remove redundant null-forgiving operator - #12818

Merged
simonrozsival merged 1 commit into
mainfrom
nightly/remove-null-forgiving-attribute-eb88ff8f7e3a80d6
Sep 18, 2026
Merged

simonrozsival merged 1 commit into
mainfrom
nightly/remove-null-forgiving-attribute-eb88ff8f7e3a80d6

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

AI-generated fix. Produced by the nightly-fix-finder agentic workflow.

Problem

GetRequiredAttribute used a null-forgiving operator even though the preceding IsNullOrWhiteSpace guard uses the repository's [NotNullWhen(false)]-annotated extension and already proves the value is non-null. This violated the repository rule against null-forgiving operators and left a redundant suppression in shipped build tooling.

Fix

Return the proven non-null attribute value directly in src/Xamarin.Android.Build.Tasks/Utilities/UtilityExtensions.cs, preserving the existing control flow and exception behavior.

Validation

  • AndroidSdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-sdk" AndroidNdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-ndk" ./build.sh Prepare — passed
  • Built the three lightweight prerequisite projects through ./dotnet-local.sh — passed
  • GRADLE_USER_HOME=/tmp/gh-aw/agent/gradle ./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj --no-restore --nologo --verbosity:minimal --maxcpucount:1 -p:BuildProjectReferences=false -p:AndroidSdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-sdk" -p:AndroidNdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-ndk" — passed with 0 errors
  • git diff --check — passed

Fix-finder metadata

  • Script: 02-null-forgiving-operator
  • Score: 30/30 (actionability: 10, safety: 10, scope: 10)

Generated by Nightly Fix Finder · copilot · gpt56 · 70.9 AIC · ⌖ 22.7 AIC · ⊞ 20.2K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival
simonrozsival merged commit 11a81a0 into main Sep 18, 2026
44 checks passed
@simonrozsival
simonrozsival deleted the nightly/remove-null-forgiving-attribute-eb88ff8f7e3a80d6 branch September 18, 2026 05:31
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant