Skip to content

Use ILog.of(Class) in org.eclipse.ui.ide#3907

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

Use ILog.of(Class) in org.eclipse.ui.ide#3907
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:cleanup/ilog-ide

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 20, 2026

Summary

Follow-up to #3906 (Use Status.error/warning factories). Replace Activator-coupled Plugin.getDefault().getLog().log(...) call sites in org.eclipse.ui.ide 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.

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 the getDefault().getLog().log(StatusUtil.newStatus(...)) pattern that Use Status.error/warning factories in org.eclipse.ui.ide #3906 partially simplified

Message-fallback behavior is preserved: the Status.error/warning factories delegate to the Status(int, Class<?>, int, String, Throwable) constructor, which runs the message through interpolateMessage (null/empty falls back to e.getLocalizedMessage(), then e.getClass().getSimpleName()).

Skipped for follow-ups

  • IDEWorkbenchPlugin internal log helpers (activator self-reference; separate concern)
  • ProjectEncodingMarkerResolutionGenerator logs via UIPlugin from an IDE-bundle class; bundle-id mismatch needs per-site judgement

Test plan

  • mvn clean compile -pl bundles/org.eclipse.ui.ide -Pbuild-individual-bundles succeeds
  • CI green

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)
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 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(...)) with ILog.of(Class).warn(...) / error(...) at several call sites.
  • Replaced getDefault().getLog().log(status) with ILog.of(Class).log(status) where an IStatus already exists.
  • Simplified one CopyFilesAndFoldersOperation error logging site to log via ILog.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.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   852 files  ±0     852 suites  ±0   50m 11s ⏱️ - 4m 45s
 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 2a986ff. ± Comparison against base commit b6b40ba.

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