Skip to content

Cleanup progress monitor handling in resource plugin#1778

Merged
ptziegler merged 1 commit intoeclipse-platform:masterfrom
ptziegler:issue1776
Mar 21, 2025
Merged

Cleanup progress monitor handling in resource plugin#1778
ptziegler merged 1 commit intoeclipse-platform:masterfrom
ptziegler:issue1776

Conversation

@ptziegler
Copy link
Contributor

@ptziegler ptziegler commented Mar 18, 2025

This resolves several trace errors thrown by an improper use of the
progress monitor while moving, deleting or copying files or folders.

  • ResourceTree

The deprecated SubProgressMonitor has been replaced by a SubMonitor, due
to an improved handling of rounding errors when reporting fractional
work back to its parent. In addition, the standardMoveFile() method now
explicitly calls beginTask() on its given progress monitor, to remain
consistent with the standardMoveFolder() and standardMoveProject()
methods and to avoid an error being reported when moving files.

  • DeleteVisitor

beginTask() is called on the given progress monitor by converting it to
a SubMonitor with the given number of ticks. This number is based on the
number of to-be-deleted files. When deleting a file, a SubMonitor is
used instead of the deprecated SubProgressMonitor, consuming a number of
ticks based on the total number of ticks.

  • CopyVisitor

This method has been adapted similarly to the DeleteVisitor as
beginTask() also needs to be called on the given progress monitor here.
Additionally, the progress handling has been adapted to avoid creating
"zero ticks" SubMonitors, as this also causes an error.

Closes #1776

@ptziegler
Copy link
Contributor Author

CC @vogella due to changes to 8539653 and b7534d0.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2025

Test Results

1 174 files   -  16  1 174 suites   - 16   54m 24s ⏱️ - 8m 19s
4 173 tests ±  0  4 126 ✅ ±  0   47 💤 ±0  0 ❌ ±0 
8 747 runs   - 208  8 628 ✅  - 207  119 💤  - 1  0 ❌ ±0 

Results for commit 0e40523. ± Comparison against base commit f4e6c3b.

♻️ This comment has been updated with latest results.

@ptziegler ptziegler changed the title Cleanup progress monitor handling in DeleteVisitor and CopyVisitor Cleanup progress monitor handling in resource plugin Mar 20, 2025
This resolves several trace errors thrown by an improper use of the
progress monitor while moving, deleting or copying files or folders.

- ResourceTree

The deprecated SubProgressMonitor has been replaced by a SubMonitor, due
to an improved handling of rounding errors when reporting fractional
work back to its parent. In addition, the standardMoveFile() method now
explicitly calls beginTask() on its given progress monitor, to remain
consistent with the standardMoveFolder() and standardMoveProject()
methods and to avoid an error being reported when moving files.

- DeleteVisitor

beginTask() is called on the given progress monitor by converting it to
a SubMonitor with the given number of ticks. This number is based on the
number of to-be-deleted files. When deleting a file, a SubMonitor is
used instead of the deprecated SubProgressMonitor, consuming a number of
ticks based on the total number of ticks.

- CopyVisitor

This method has been adapted similarly to the DeleteVisitor as
beginTask() also needs to be called on the given progress monitor here.
Additionally, the progress handling has been adapted to avoid creating
"zero ticks" SubMonitors, as this also causes an error.
@ptziegler
Copy link
Contributor Author

The OOM error on Windows seems sadly unrelated. Unless there are any objections, I'd like to merge this at the end of the week.

@ptziegler
Copy link
Contributor Author

The other builds are looking fine. Merging.

@ptziegler ptziegler merged commit a791b17 into eclipse-platform:master Mar 21, 2025
16 of 17 checks passed
@ptziegler ptziegler deleted the issue1776 branch March 21, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improper use of progress monitor when deleting a folder

1 participant