Skip to content

Conversation

@ptziegler
Copy link
Contributor

The migration from the IProgressMonitor to the SubMonitor done as part of 40114d2 also converts the progress monitor used within the InternalMonitorWrapper.

If the parent monitor is a SubMonitor, this calls beginTask() both when the InternalMonitorWrapper is created, as well as explicitly later on. To avoid this, switch back to create a null-safe progress monitor via Policy.monitorFor(...).

Closes #1758

@ptziegler
Copy link
Contributor Author

The other usages of the SubMonitor look fine, so that seems to be the only place that needs to be adapted.


public InternalMonitorWrapper(IProgressMonitor monitor) {
super(SubMonitor.convert(monitor));
super(Policy.monitorFor(monitor));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that Policy.monitorFor

public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
return monitor == null ? new NullProgressMonitor() : monitor;
}

and IProgressMonitor.nullSafe(...)

static IProgressMonitor nullSafe(IProgressMonitor monitor) {
    if (monitor == null) {
        return new NullProgressMonitor();
    }
    return monitor;
}

are functionally identical. It probably makes sense to get rid of the former altogether...

@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 9cf771f7999fd3dcd4f5d5b6aaf92fbaefcd93a2 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Wed, 5 Mar 2025 19:03:41 +0000
Subject: [PATCH] Version bump(s) for 4.36 stream


diff --git a/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF b/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF
index 5c1c77c5da..aa042e2f42 100644
--- a/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF
+++ b/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.core.resources; singleton:=true
-Bundle-Version: 3.22.100.qualifier
+Bundle-Version: 3.22.200.qualifier
 Bundle-Activator: org.eclipse.core.resources.ResourcesPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-- 
2.48.1

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Test Results

1 191 files   -  65  1 191 suites   - 65   59m 1s ⏱️ - 2m 23s
4 173 tests ±  0  4 127 ✅ +  1   46 💤  - 1  0 ❌ ±0 
9 312 runs   - 267  9 191 ✅  - 264  121 💤  - 3  0 ❌ ±0 

Results for commit a0bb0d5. ± Comparison against base commit 14db9ea.

♻️ This comment has been updated with latest results.

ptziegler and others added 2 commits March 6, 2025 13:19
The migration from the IProgressMonitor to the SubMonitor done as part
of 40114d2 also converts the progress
monitor used within the InternalMonitorWrapper.

If the parent monitor is a SubMonitor, this calls beginTask() both when
the InternalMonitorWrapper is created, as well as explicitly later on.
To avoid this, switch back to create a null-safe progress monitor via
Policy.monitorFor(...).

Closes eclipse-platform#1758
@ptziegler
Copy link
Contributor Author

The failure on the Windows node also happens on the master, so it's likely unrelated.

@ptziegler ptziegler merged commit e1dd87d into eclipse-platform:master Mar 6, 2025
16 of 17 checks passed
@ptziegler ptziegler deleted the issue1758 branch March 6, 2025 13:19
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.

beginTask was called on SaveManager more than once

2 participants