mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-20 02:17:52 +00:00
EclipsePatcher now only patches needed stuff when in ECJ mode.
This commit is contained in:
1 parent
0917f20f74
commit
f737c1ca27
1 file changed
+13
-8
@@ -45,20 +45,25 @@ import lombok.patcher.scripts.ScriptBuilder;
|
||||
public class EclipsePatcher extends Agent {
|
||||
@Override
|
||||
public void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected) throws Exception {
|
||||
registerPatchScripts(instrumentation, injected);
|
||||
registerPatchScripts(instrumentation, injected, injected);
|
||||
}
|
||||
|
||||
private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses) {
|
||||
private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses, boolean ecjOnly) {
|
||||
ScriptManager sm = new ScriptManager();
|
||||
sm.registerTransformer(instrumentation);
|
||||
EquinoxClassLoader.addPrefix("lombok.");
|
||||
EquinoxClassLoader.registerScripts(sm);
|
||||
if (!ecjOnly) {
|
||||
EquinoxClassLoader.addPrefix("lombok.");
|
||||
EquinoxClassLoader.registerScripts(sm);
|
||||
}
|
||||
|
||||
// patchLombokizeAST(sm);
|
||||
patchAvoidReparsingGeneratedCode(sm);
|
||||
// patchCatchReparse(sm);
|
||||
// patchSetGeneratedFlag(sm);
|
||||
// patchHideGeneratedNodes(sm);
|
||||
|
||||
if (!ecjOnly) {
|
||||
patchLombokizeAST(sm);
|
||||
patchCatchReparse(sm);
|
||||
patchSetGeneratedFlag(sm);
|
||||
patchHideGeneratedNodes(sm);
|
||||
}
|
||||
|
||||
if (reloadExistingClasses) sm.reloadClasses(instrumentation);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user