aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2023-02-08 18:48:55 +0100
committerRoel Spilker <r.spilker@gmail.com>2023-03-21 17:11:45 +0100
commit13642eb896ae6dbbaebab6df3c3758296102ead8 (patch)
tree1f80cd5783c95366fa8fb6c69bcddc86195e1b11
parent70cf9b5d0d4cbced2e506b03b4769d324fb53e7e (diff)
downloadlombok-13642eb896ae6dbbaebab6df3c3758296102ead8.tar.gz
lombok-13642eb896ae6dbbaebab6df3c3758296102ead8.tar.bz2
lombok-13642eb896ae6dbbaebab6df3c3758296102ead8.zip
[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.
-rwxr-xr-xsrc/eclipseAgent/lombok/launch/PatchFixesHider.java9
1 files changed, 9 insertions, 0 deletions
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");