Skip to content

Use Status.error/warning factories in org.eclipse.ui.ide#3906

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:cleanup/status-util-ide
Apr 20, 2026
Merged

Use Status.error/warning factories in org.eclipse.ui.ide#3906
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:cleanup/status-util-ide

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 20, 2026

Replaces 9 call sites of the internal StatusUtil.newStatus(...) wrapper in org.eclipse.ui.ide with the Status.error(...) / Status.warning(...) static factories. The factories infer the plug-in id from the calling class' bundle, which equals IDEWorkbenchPlugin.IDE_WORKBENCH for all callers in this bundle, so the produced status objects keep the same plug-in id.

The (severity, message, throwable) overload of StatusUtil also passed 'severity' as the unused 'code' field; the factories use IStatus.OK which is the conventional value for that field.

One BasicNewProjectResourceWizard call uses a dynamic severity derived from a wrapped CoreException. It is rewritten to a direct Status constructor so the severity remains preserved.

StatusUtil itself is still used by ~11 callers of newError(Throwable) (which provides a getLocalizedMessage / getMessage / toString fallback chain that has no direct factory equivalent) and the multi-status overload, so the class is intentionally kept.

Replaces 9 call sites of the internal StatusUtil.newStatus(...) wrapper
in org.eclipse.ui.ide with the Status.error(...) / Status.warning(...)
static factories. The factories infer the plug-in id from the calling
class' bundle, which equals IDEWorkbenchPlugin.IDE_WORKBENCH for all
callers in this bundle, so the produced status objects keep the same
plug-in id.

The (severity, message, throwable) overload of StatusUtil also passed
'severity' as the unused 'code' field; the factories use IStatus.OK
which is the conventional value for that field.

One BasicNewProjectResourceWizard call uses a dynamic severity derived
from a wrapped CoreException. It is rewritten to a direct Status
constructor so the severity remains preserved.

StatusUtil itself is still used by ~11 callers of newError(Throwable)
(which provides a getLocalizedMessage / getMessage / toString fallback
chain that has no direct factory equivalent) and the multi-status
overload, so the class is intentionally kept.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes status creation in org.eclipse.ui.ide by replacing several uses of the internal StatusUtil.newStatus(...) wrapper with Status.error(...) / Status.warning(...) factories, keeping plug-in attribution consistent while using the conventional status code value.

Changes:

  • Replaced multiple StatusUtil.newStatus(...) call sites with Status.error(...) / Status.warning(...).
  • Preserved dynamic severity in BasicNewProjectResourceWizard by using a direct new Status(...) constructor for that case.
  • Removed now-unused StatusUtil imports where applicable.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard.java Switches status creation to Status.warning(...) and uses direct Status construction where severity must be preserved.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkCompletedHandler.java Replaces a warning StatusUtil.newStatus(...) with Status.warning(...) for interruption logging.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java Uses Status.warning(...) for a non-fatal internal warning instead of StatusUtil.newStatus(...).
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchPlugin.java Updates internal logging helpers to use Status.error(...) factories.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/WorkspaceAction.java Replaces error status creation with Status.error(...) when logging invocation failures.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/RefreshAction.java Replaces error status creation with Status.error(...) when wrapping invocation failures in a CoreException.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java Uses Status.error(...) for logging unexpected invocation failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   852 files     852 suites   49m 27s ⏱️
 7 899 tests  7 656 ✅ 243 💤 0 ❌
20 199 runs  19 544 ✅ 655 💤 0 ❌

Results for commit 9663340.

@vogella vogella merged commit b6b40ba into eclipse-platform:master Apr 20, 2026
22 checks passed
@vogella vogella deleted the cleanup/status-util-ide branch April 20, 2026 15:02
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.

2 participants