Use ILog.of(Class) in four text-related bundles#3908
Merged
vogella merged 1 commit intoeclipse-platform:masterfrom Apr 20, 2026
Merged
Use ILog.of(Class) in four text-related bundles#3908vogella merged 1 commit intoeclipse-platform:masterfrom
vogella merged 1 commit intoeclipse-platform:masterfrom
Conversation
…iceditor Replace Activator-coupled Plugin.getDefault().getLog().log(...) call sites across four bundles 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. Bundles touched: - org.eclipse.ui.workbench.texteditor (20 files) - org.eclipse.ui.genericeditor (13 files) - org.eclipse.ui.editors (4 files) - org.eclipse.ui.navigator.resources (2 files) Two sites intentionally preserve the explicit Status construction because they attribute the log to the contributor bundle via element.getNamespaceIdentifier() (CodeMiningProviderRegistry, StickyLinesProviderRegistry): only the ILog instance is swapped to avoid changing the logged pluginId. Activator internal log helpers are left unchanged; modernizing those is a separate concern.
There was a problem hiding this comment.
Pull request overview
This PR continues the logging modernization from #3907 by migrating remaining call sites in four text-related bundles away from Activator-coupled Plugin.getDefault().getLog().log(...) toward ILog.of(Class).error/warn/log(...), reducing indirection and redundant Status allocations while keeping message fallback behavior consistent.
Changes:
- Replaced
getDefault().getLog().log(new Status(...))patterns withILog.of(<Class>).error/warn(...)where the log attribution remains within the same bundle. - Replaced
getDefault().getLog().log(status)patterns withILog.of(<Class>).log(status). - Preserved explicit
Statusconstruction where the loggedpluginIdmust remain the contributor’s namespace (element.getNamespaceIdentifier()), swapping only theILoginstance.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java | Switch template read/write error logging to ILog.of(Class) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java | Use ILog convenience error(...) when saving template store fails |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingService.java | Log CoreException status via ILog.of(Class).log(status) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java | Route status logging through ILog.of(Class) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextViewerDeleteLineTarget.java | Log clipboard-related Status via ILog.of(Class) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorTargetDescriptor.java | Replace explicit Status allocations with ILog.of(Class).error(message) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java | Replace invalid extension/element logging with ILog.of(Class).error(message) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieCompleteAction.java | Use ILog.of(Class).error(msg, e) for document access errors |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoNextEditPositionAction.java | Use ILog.of(Class).error(...) on editor open failures |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java | Use ILog.of(Class).error(...) on line computation failures |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLastEditPositionAction.java | Use ILog.of(Class).error(...) on editor open failures |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java | Replace Status creation + activator log with ILog.of(Class).error(message, e) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java | Use ILog.of(Class).error(...) for BadLocationException |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java | Log CoreException status via ILog.of(Class) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/views/minimap/MinimapWidget.java | Use ILog.of(Class).error(...) for minimap sync failures |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderRegistry.java | Preserve contributor pluginId in Status, swap to ILog.of(Class) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java | Replace activator logging with ILog.of(Class).error(...) |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/HippieCompletionEngine.java | Use ILog.of(Class).error(msg, e) for BadLocationException |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/CompoundEditExitStrategy.java | Use ILog.of(Class).error(...) when listener notification fails |
| bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java | Replace Status.error(...) + activator logging with ILog.of(Class).error(...) |
| bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java | Log generated IStatus via ILog.of(Class).log(status) |
| bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java | Replace explicit Status allocation with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/TextHoverRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java | Use ILog.of(Class).warn(...) for unsupported hover controls |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/compare/GenericEditorViewer.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/TextDoubleClickStrategyRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ReconcilerRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) across sync paths |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/QuickAssistProcessorRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/PresentationReconcilerRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/IconsRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithContentTypeIcon.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericContentTypeRelatedExtension.java | Replace plugin log usage with ILog.of(Class).error(...) for delegate creation and enabledWhen evaluation |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ContentAssistProcessorRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/CharacterPairMatcherRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/AutoEditStrategyRegistry.java | Replace plugin log usage with ILog.of(Class).error(msg, ex) |
| bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderRegistry.java | Preserve contributor pluginId in Status, swap to ILog.of(Class) |
| bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderDescriptor.java | Replace plugin log usage with ILog.of(Class).error(...) |
| bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java | Replace plugin log usage with ILog.of(Class).error(message) |
💡 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 #3907. Replace Activator-coupled
Plugin.getDefault().getLog().log(...)call sites across four bundles withILog.of(Class).error/warn/log(...). Drops the round-trip through the plug-in singleton and collapses redundantStatusallocations into theILogconvenience methods.Bundles in scope (all have a single Activator, matching
Bundle-SymbolicName, and classes live in the same bundle they log to):org.eclipse.ui.workbench.texteditororg.eclipse.ui.genericeditororg.eclipse.ui.editorsorg.eclipse.ui.navigator.resourcesMessage-fallback behavior is preserved: the
ILog.error/warn(msg, t)path goes through theStatus(int, Class<?>, int, String, Throwable)constructor, which interpolates a null/empty message frome.getLocalizedMessage()/e.getClass().getSimpleName()(equinoxorg.eclipse.core.runtime.Status.interpolateMessage).Intentionally preserved
Two sites keep the explicit
Statusconstruction because they attribute the log to the contributor bundle viaelement.getNamespaceIdentifier(), not the current bundle:CodeMiningProviderRegistry(texteditor)StickyLinesProviderRegistry(editors)Only the
ILoginstance is swapped there to avoid changing the logged pluginId.Left for follow-ups
IDEWorkbenchPlugin.log,WorkbenchNavigatorPlugin.log,EditorsPlugin.log, etc.) still usegetDefault().getLog(), but inside the Activator that is just a self-reference. Modernizing those helper bodies is a separate concern.org.eclipse.ui.editorssites inProjectEncodingMarkerResolutionGeneratorlog viaUIPluginfrom an IDE-bundle class; that bundle-id mismatch needs per-site judgement.org.eclipse.ui.workbenchandorg.eclipse.uiare deferred until theorg.eclipse.uivsorg.eclipse.ui.workbenchid question is resolved.Test plan
mvn clean compileper bundle succeeds locally