From 7e870c7d6dddd288c16b0531a86b7bbf7cef4de3 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 3 Dec 2024 14:47:39 +0100 Subject: [PATCH 1/2] Use SubMonintor in CheckConditionsContext done() call not necessary here and convert can also handle null. Also split will also check for cancellation so the additional cancellation check is not necessary. See https://www.eclipse.org/articles/Article-Progress-Monitors/article.html --- .../participants/CheckConditionsContext.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/CheckConditionsContext.java b/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/CheckConditionsContext.java index 82ca63804a61..c4e1952fcfee 100644 --- a/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/CheckConditionsContext.java +++ b/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/CheckConditionsContext.java @@ -22,8 +22,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; @@ -102,9 +100,7 @@ public void add(IConditionChecker checker) throws CoreException { * @throws CoreException if an error occurs during condition checking */ public RefactoringStatus check(IProgressMonitor pm) throws CoreException { - if (pm == null) { - pm= new NullProgressMonitor(); - } + RefactoringStatus result= new RefactoringStatus(); mergeResourceOperationAndValidateEdit(); List values= new ArrayList<>(fCheckers.values()); @@ -120,14 +116,11 @@ public RefactoringStatus check(IProgressMonitor pm) throws CoreException { } return 0; }); + SubMonitor sm= SubMonitor.convert(pm, "", values.size()); //$NON-NLS-1$ for (IConditionChecker checker : values) { result.merge(checker.check(sm.split(1))); - if (pm.isCanceled()) { - throw new OperationCanceledException(); - } } - pm.done(); return result; } From 488af1e892b223e0a037d7e30887ef9c0b9d0a6e Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Wed, 17 Dec 2025 16:00:01 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.39 stream --- bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF b/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF index a4fdac38f266..9f0f659919b5 100644 --- a/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.core.refactoring Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.ltk.core.refactoring; singleton:=true -Bundle-Version: 3.15.100.qualifier +Bundle-Version: 3.15.200.qualifier Bundle-Activator: org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName