Skip to content

Replace Plugin.getLog() with static ILog.of(Class)#2627

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:replace-getlog-with-ilog-of
Apr 27, 2026
Merged

Replace Plugin.getLog() with static ILog.of(Class)#2627
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:replace-getlog-with-ilog-of

Conversation

@vogella

@vogella vogella commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switch six single-call-site static log(IStatus) helpers to ILog.of(SomeClass.class) instead of routing through the plugin singleton.
  • Removes the last logging-only reason these bundles rely on getDefault() / getPlugin(), and logging now works even before the activator has stored the singleton.
  • No MANIFEST changes required — all affected bundles already require org.eclipse.core.runtime >= 3.29, which is when ILog.of(Class) was introduced.

Affected bundles:

  • org.eclipse.compare.win32
  • org.eclipse.unittest.ui
  • org.eclipse.ui.console
  • org.eclipse.core.variables
  • org.eclipse.ant.core
  • org.eclipse.ant.ui

Part of an effort to identify activators / getDefault() usages that can be simplified or replaced. These six are the lowest-risk starting point — each bundle has exactly one getDefault().getLog() call site.

Test plan

  • CI build succeeds
  • No API baseline warnings for the six bundles
  • Logging still functions (spot-check: trigger a logged error in one of the affected plug-ins)

@vogella

vogella commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Build failure also looks unrelated to this change:

Error: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:5.0.3-SNAPSHOT:test (default-test) on project org.eclipse.core.tests.resources.saveparticipant1: No tests found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:5.0.3-SNAPSHOT:test (default-test) on project org.eclipse.core.tests.resources.saveparticipant1: No tests found
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)

Again I would guess that eclipse-platform/eclipse.platform.releng.aggregator#3784 might be related.

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   35m 59s ⏱️ +42s
 4 558 tests ±0   4 536 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 270 runs  ±0  12 114 ✅ ±0  156 💤 ±0  0 ❌ ±0 

Results for commit 0e42c68. ± Comparison against base commit 61d50fa.

♻️ This comment has been updated with latest results.

Switch the six single-call-site static log(IStatus) helpers to use
ILog.of(SomeClass.class) instead of routing through the plugin singleton.
This removes the last logging-only reason these bundles rely on
getDefault()/getPlugin() and works even before the activator has stored
the singleton.

Affected bundles:
- org.eclipse.compare.win32
- org.eclipse.unittest.ui
- org.eclipse.ui.console
- org.eclipse.core.variables
- org.eclipse.ant.core
- org.eclipse.ant.ui

All of these already require org.eclipse.core.runtime >= 3.29, which is
when ILog.of(Class) was introduced, so no MANIFEST changes are needed.
@vogella vogella force-pushed the replace-getlog-with-ilog-of branch from d9f0d77 to 0e42c68 Compare April 26, 2026 10:57
@vogella vogella merged commit ab362e6 into eclipse-platform:master Apr 27, 2026
18 checks passed
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.

1 participant