mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 04:16:19 +00:00
[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.
This commit is contained in:
1 parent
70cf9b5d0d
commit
13642eb896
1 file changed
+9
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user