From 13642eb896ae6dbbaebab6df3c3758296102ead8 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Wed, 8 Feb 2023 18:48:55 +0100 Subject: [fixes #3332] Prepend jdt.core SCL to compiler SCL The latest eclipse version properly splits the jdt.core module and the compiler. To load jdt.core classes during compilation the compiler SCL needs a reference to the jdt.core SCL. --- src/eclipseAgent/lombok/launch/PatchFixesHider.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java index c7bdbc31..5404ee1d 100755 --- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java +++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java @@ -60,6 +60,8 @@ import org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner; import org.eclipse.jdt.internal.corext.refactoring.SearchResultGroup; import org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.IncomingMemberVisibilityAdjustment; +import lombok.permit.Permit; + import static lombok.eclipse.EcjAugments.ASTNode_generatedBy; /** These contain a mix of the following: @@ -200,6 +202,13 @@ final class PatchFixesHider { if (TRANSFORM != null) return; Main.prependClassLoader(prepend); + try { + ClassLoader currentClassLoader = Transform.class.getClassLoader(); + Method prependParentMethod = Permit.getMethod(currentClassLoader.getClass(), "prependParent", ClassLoader.class); + Permit.invoke(prependParentMethod, currentClassLoader, prepend); + } catch (Throwable t) { + // Ignore + } Class shadowed = Util.shadowLoadClass("lombok.eclipse.TransformEclipseAST"); TRANSFORM = Util.findMethodAnyArgs(shadowed, "transform"); TRANSFORM_SWAPPED = Util.findMethodAnyArgs(shadowed, "transform_swapped"); -- cgit