Repository navigation
fix(revit): scope the PushButtonData release with a using on the IDisposable view - #712
Merged
Merged
Conversation
…posable view The finally-block dispose (#711) satisfied cs/local-not-disposed but tripped cs/missed-using-statement (code-quality finding #7). A `using` on `buttonData as IDisposable` keeps one code path for all legs — null, so a no-op, on Revit 2024 where the type is not disposable; a release at scope exit on Revit 2025+ — and is the form both queries accept. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
This was written agentically; verify its assertions:
Why
#711 released
PushButtonDatain afinallyblock to satisfycs/local-not-disposedon every leg; the rescan then raised code-quality finding #7 (cs/missed-using-statement), which prefers ausingstatement over manual disposal infinally. A plainusing varon thePushButtonDatacannot compile on the Revit 2024 leg, where the type is notIDisposable.What
using var releaseButtonData = buttonData as IDisposable;right after construction: null (a no-op) on Revit 2024, a release at scope exit on 2025+, one code path for all legs, and theusingform both queries accept. No#if, nofinally.Testing
mainwith no replacement🤖 Co-authored by Claude Fable 5.1.
🤖 Generated with Claude Code