Use Status.error/warning factories in org.eclipse.ui.ide#3906
Merged
vogella merged 1 commit intoeclipse-platform:masterfrom Apr 20, 2026
Merged
Use Status.error/warning factories in org.eclipse.ui.ide#3906vogella merged 1 commit intoeclipse-platform:masterfrom
vogella merged 1 commit intoeclipse-platform:masterfrom
Conversation
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.
There was a problem hiding this comment.
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 withStatus.error(...)/Status.warning(...). - Preserved dynamic severity in
BasicNewProjectResourceWizardby using a directnew Status(...)constructor for that case. - Removed now-unused
StatusUtilimports 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.
Contributor
Test Results 852 files 852 suites 49m 27s ⏱️ Results for commit 9663340. |
This was referenced Apr 20, 2026
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.
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.