[Tizen.WindowSystem] Replace manual null checks with ArgumentNullException.ThrowIfNull()#7662
Open
JoonghyunCho wants to merge 1 commit into
Open
[Tizen.WindowSystem] Replace manual null checks with ArgumentNullException.ThrowIfNull()#7662JoonghyunCho wants to merge 1 commit into
JoonghyunCho wants to merge 1 commit into
Conversation
…ption.ThrowIfNull() Convert legacy 'if (arg == null) throw new ArgumentNullException(nameof(arg));' patterns in Tizen.WindowSystem to the single-statement helper ArgumentNullException.ThrowIfNull(arg) introduced in .NET 6+. This reduces generated IL size, improving JIT inlining heuristics on hot paths, and tightens the source. Exception type and paramName (used by ArgumentNullException.ThrowIfNull) remain identical, so behavior and public API surface are preserved. Affected files: - KVMService.cs - QuickPanelService.cs (incl. SetContentRegion/SetHandlerRegion) - QuickPanelClient.cs (also normalized literal-string paramNames) - ScreensaverService.cs - TaskbarService.cs - SoftkeyClient.cs - SoftkeyService.cs Refs #7548
There was a problem hiding this comment.
Code Review
This pull request refactors several service and client classes within the Tizen.WindowSystem namespace to use the ArgumentNullException.ThrowIfNull helper method for parameter validation, replacing manual null checks with a more concise implementation. I have no feedback to provide as there were no review comments to assess.
Member
Author
|
🤖 [AI Review] Reviewed — no findings. Scope checked:
No 🔴 critical issues, no 🟡 suggestions to flag. Automated review — final merge decision rests with human reviewers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces legacy
if (arg == null) throw new ArgumentNullException(nameof(arg));patterns insrc/Tizen.WindowSystemwith the single-statement helperArgumentNullException.ThrowIfNull(arg)introduced in .NET 6.This is the second module-level slice of the umbrella refactor tracked in #7548 (the first slice,
Tizen.Applications.Common, is in PR #7566).Changes
src/Tizen.WindowSystem/src/KVMService.cs— constructor null checks fortzShell,winsrc/Tizen.WindowSystem/src/QuickPanelService.cs— constructor null checks fortzShell,win;SetContentRegionandSetHandlerRegionnull check forregionssrc/Tizen.WindowSystem/src/QuickPanelClient.cs— constructor null checks fortzShell,win(also normalizes the pre-existing literal-stringparamNames"tzShell"/"win"—ArgumentNullException.ThrowIfNullderives the same paramName viaCallerArgumentExpression)src/Tizen.WindowSystem/src/ScreensaverService.cs— constructor null checks fortzShell,winsrc/Tizen.WindowSystem/src/TaskbarService.cs— constructor null checks fortzShell,winsrc/Tizen.WindowSystem/src/SoftkeyClient.cs— constructor null checks fortzShell,winsrc/Tizen.WindowSystem/src/SoftkeyService.cs— constructor null checks fortzShell,winNet change: 7 files, +16 / -64 lines.
Mode
Refactoring
API Compatibility
ArgumentNullException)paramNamecarried by exceptionnameof(arg)value; for the previous literal-string sites inQuickPanelClient.cs, the literal already matched the parameter name)Verification
dotnet build src/Tizen.WindowSystem→ 0 errors, 4 unrelated warnings inherited fromTizen.Applications.CommonRefs #7548