Fix Eclipse classloader lookup after Equinox API removal - #4059
Open
chagong wants to merge 2 commits into
Open
Conversation
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>
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
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, causingfindJdtCoreClassLoader()to returnnull. The later parser-based fallback is timing-dependent, soEclipseASTintermittently cannot loadorg.eclipse.core.runtime.IPathand silently ignoreslombok.config.Change
Use the standard OSGi API:
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:
BundleWiringlookup;Validation
ant compileant distPatchFixesHiderTest: 2 tests passedlombok.configapplied in 5 of 5 clean workspacesFixes #4058.