Use ILog.of(Class) in org.eclipse.ui.ide#3907
Merged
vogella merged 1 commit intoeclipse-platform:masterfrom Apr 20, 2026
Merged
Use ILog.of(Class) in org.eclipse.ui.ide#3907vogella merged 1 commit intoeclipse-platform:masterfrom
vogella merged 1 commit intoeclipse-platform:masterfrom
Conversation
Replace Activator-coupled `getDefault().getLog().log(...)` call sites in org.eclipse.ui.ide with `ILog.of(Class).error/warn/log(...)`, dropping the round-trip through the plug-in singleton and collapsing redundant Status allocations into the ILog convenience methods. Skipped for a separate pass: - IDEWorkbenchPlugin internal log helpers (activator self-reference) - ProjectEncodingMarkerResolutionGenerator logs via UIPlugin from an IDE-bundle class (bundle-id mismatch needs per-site judgement)
2 tasks
There was a problem hiding this comment.
Pull request overview
This PR modernizes logging in org.eclipse.ui.ide by replacing Activator-coupled IDEWorkbenchPlugin.getDefault().getLog().log(...) call sites with ILog.of(Class) convenience logging methods, reducing unnecessary Status allocations and avoiding plug-in singleton round-trips.
Changes:
- Replaced
getDefault().getLog().log(new Status(...))withILog.of(Class).warn(...)/error(...)at several call sites. - Replaced
getDefault().getLog().log(status)withILog.of(Class).log(status)where anIStatusalready exists. - Simplified one
CopyFilesAndFoldersOperationerror logging site to log viaILog.of(Class)directly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java | Switch warning log site to ILog.of(...).warn(...) and drop explicit Status construction. |
| bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java | Log existing status via ILog.of(...).log(status) instead of Activator log. |
| bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/filesystem/FileSystemSupportRegistry.java | Log CoreException status via ILog.of(...).log(status). |
| bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/ProjectNaturesPage.java | Replace two warning Status constructions with ILog.of(...).warn(message, exception). |
| bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/EditorAssociationOverrideDescriptor.java | Replace Status-based error logging with ILog.of(...).error(message). |
| bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java | Replace Activator-based logging with ILog.of(...).error(message) in error-display path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
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.
Summary
Follow-up to #3906 (Use Status.error/warning factories). Replace Activator-coupled
Plugin.getDefault().getLog().log(...)call sites inorg.eclipse.ui.idewithILog.of(Class).error/warn/log(...). Drops the round-trip through the plug-in singleton and collapses redundantStatusallocations into theILogconvenience methods.Sites touched:
EditorAssociationOverrideDescriptor,ProjectNaturesPage(×2),MarkerSupportRegistry:getDefault().getLog().log(new Status(...))->ILog.of(Class).error/warn(...)MarkerContentGenerator,FileSystemSupportRegistry:getDefault().getLog().log(status)->ILog.of(Class).log(status)CopyFilesAndFoldersOperation: collapsed thegetDefault().getLog().log(StatusUtil.newStatus(...))pattern that Use Status.error/warning factories in org.eclipse.ui.ide #3906 partially simplifiedMessage-fallback behavior is preserved: the
Status.error/warningfactories delegate to theStatus(int, Class<?>, int, String, Throwable)constructor, which runs the message throughinterpolateMessage(null/empty falls back toe.getLocalizedMessage(), thene.getClass().getSimpleName()).Skipped for follow-ups
IDEWorkbenchPlugininternal log helpers (activator self-reference; separate concern)ProjectEncodingMarkerResolutionGeneratorlogs viaUIPluginfrom an IDE-bundle class; bundle-id mismatch needs per-site judgementTest plan
mvn clean compile -pl bundles/org.eclipse.ui.ide -Pbuild-individual-bundlessucceeds