Skip to content

Use ILog.of(Class) in four text-related bundles#3908

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:cleanup/ilog-misc-bundles
Apr 20, 2026
Merged

Use ILog.of(Class) in four text-related bundles#3908
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:cleanup/ilog-misc-bundles

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 20, 2026

Summary

Follow-up to #3907. Replace Activator-coupled Plugin.getDefault().getLog().log(...) call sites across four bundles with ILog.of(Class).error/warn/log(...). Drops the round-trip through the plug-in singleton and collapses redundant Status allocations into the ILog convenience methods.

Bundles in scope (all have a single Activator, matching Bundle-SymbolicName, and classes live in the same bundle they log to):

Bundle Sites migrated
org.eclipse.ui.workbench.texteditor 26
org.eclipse.ui.genericeditor 17
org.eclipse.ui.editors 5 (+1 preserved)
org.eclipse.ui.navigator.resources 2 (+2 activator helpers left)

Message-fallback behavior is preserved: the ILog.error/warn(msg, t) path goes through the Status(int, Class<?>, int, String, Throwable) constructor, which interpolates a null/empty message from e.getLocalizedMessage() / e.getClass().getSimpleName() (equinox org.eclipse.core.runtime.Status.interpolateMessage).

Intentionally preserved

Two sites keep the explicit Status construction because they attribute the log to the contributor bundle via element.getNamespaceIdentifier(), not the current bundle:

  • CodeMiningProviderRegistry (texteditor)
  • StickyLinesProviderRegistry (editors)

Only the ILog instance is swapped there to avoid changing the logged pluginId.

Left for follow-ups

  • Activator internal log helpers (IDEWorkbenchPlugin.log, WorkbenchNavigatorPlugin.log, EditorsPlugin.log, etc.) still use getDefault().getLog(), but inside the Activator that is just a self-reference. Modernizing those helper bodies is a separate concern.
  • Two org.eclipse.ui.editors sites in ProjectEncodingMarkerResolutionGenerator log via UIPlugin from an IDE-bundle class; that bundle-id mismatch needs per-site judgement.
  • org.eclipse.ui.workbench and org.eclipse.ui are deferred until the org.eclipse.ui vs org.eclipse.ui.workbench id question is resolved.

Test plan

  • mvn clean compile per bundle succeeds locally
  • CI green

…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.
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 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 with ILog.of(<Class>).error/warn(...) where the log attribution remains within the same bundle.
  • Replaced getDefault().getLog().log(status) patterns with ILog.of(<Class>).log(status).
  • Preserved explicit Status construction where the logged pluginId must remain the contributor’s namespace (element.getNamespaceIdentifier()), swapping only the ILog instance.

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.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   852 files  ±0     852 suites  ±0   55m 33s ⏱️ +37s
 7 899 tests ±0   7 656 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 199 runs  ±0  19 544 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit d4e9854. ± Comparison against base commit b6b40ba.

@vogella vogella merged commit ba308b7 into eclipse-platform:master Apr 20, 2026
22 checks passed
@vogella vogella deleted the cleanup/ilog-misc-bundles branch April 20, 2026 16:43
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