Fix SubMonitor misuse in UndoablePackageDeleteChange#2985
Merged
jjohnstn merged 1 commit intoMay 14, 2026
Conversation
The perform() method mixed pm.worked() with SubMonitor.convert() on the same monitor, and called SubMonitor.convert(pm, 1) inside a loop. Both patterns corrupt progress reporting: convert() resets the monitor's remaining work, so repeated calls in a loop or after worked() discard already-reported progress. Replace pm.beginTask/worked/done and the in-loop SubMonitor.convert() calls with a single SubMonitor.convert() up front, then split() for each unit of work.
78d710e to
bd8fbb6
Compare
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.
The
perform()method mixedpm.worked()withSubMonitor.convert()on the same monitor, and calledSubMonitor.convert(pm, 1)inside a loop. Both patterns corrupt progress reporting:convert()resets the monitor's remaining work, so repeated calls inside a loop or afterworked()discard already-reported progress.The fix replaces
beginTask/workedand the in-loopSubMonitor.convert()calls with a singleSubMonitor.convert()up front, thensplit()for each unit of work. The loops are also simplified to enhanced for-each since the index is no longer needed.Author checklist