Skip to content

Fix Eclipse classloader lookup after Equinox API removal - #4059

Open
chagong wants to merge 2 commits into
projectlombok:masterfrom
chagong:fix-equinox-bundle-wiring
Open

Fix Eclipse classloader lookup after Equinox API removal#4059
chagong wants to merge 2 commits into
projectlombok:masterfrom
chagong:fix-equinox-bundle-wiring

Conversation

@chagong

@chagong chagong commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Restore Lombok's jdt.core classloader lookup after Equinox removed the private EquinoxBundle.getModuleClassLoader(boolean) method.

The existing cross-bundle repair added in #3347 and #3563 depends on that private method. Current Equinox throws NoSuchMethodException, causing findJdtCoreClassLoader() to return null. The later parser-based fallback is timing-dependent, so EclipseAST intermittently cannot load org.eclipse.core.runtime.IPath and silently ignores lombok.config.

Change

Use the standard OSGi API:

Bundle.adapt(BundleWiring.class).getClassLoader()

The lookup is performed reflectively to preserve Lombok's classloader boundary and avoid a direct OSGi dependency. The removed private Equinox method remains as a fallback for older runtimes.

Added focused tests covering:

  • the standard BundleWiring lookup;
  • the legacy Equinox fallback.

Validation

  • ant compile
  • ant dist
  • focused PatchFixesHiderTest: 2 tests passed
  • rebuilt agent against current JDT LS: lombok.config applied in 5 of 5 clean workspaces

Fixes #4058.

chagong and others added 2 commits August 3, 2026 15:31
Use the standard OSGi BundleWiring API to obtain the jdt.core bundle's
classloader. Keep the removed private Equinox API as a fallback for older
runtime versions.

This makes the early parser classloader prepend deterministic again, so
EclipseAST can resolve source locations and consistently load lombok.config.

Fixes projectlombok#4058

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Leave release-note curation to the project maintainers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[BUG] lombok.config intermittently ignored after Equinox removed getModuleClassLoader(boolean)

1 participant