aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2023-01-12 00:40:22 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2023-01-12 00:40:22 +0100
commit073ec78dd523e6108f18325f321204912b311f26 (patch)
treedaf106051643d435f734e7425dd4fe8767149f78 /src/eclipseAgent/lombok/eclipse/agent
parentc16f6e90849ea2186adc6f81c0303b1d0720ffc0 (diff)
parentffd364b964e671eac8fb6ae700834d5d977b5b00 (diff)
downloadlombok-073ec78dd523e6108f18325f321204912b311f26.tar.gz
lombok-073ec78dd523e6108f18325f321204912b311f26.tar.bz2
lombok-073ec78dd523e6108f18325f321204912b311f26.zip
Merge branch 'Rawi01-eclipse-tests'
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index d893b724..c0bfbe09 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -109,6 +109,8 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
patchRenameField(sm);
patchNullCheck(sm);
+ patchForTests(sm);
+
if (reloadExistingClasses) sm.reloadClasses(instrumentation);
}
@@ -1007,5 +1009,13 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
.transplant()
.build());
}
+
+ private static void patchForTests(ScriptManager sm) {
+ sm.addScriptIfWitness(new String[] {"lombok/eclipse/EclipseTests"}, ScriptBuilder.wrapReturnValue()
+ .target(new MethodTarget("org.osgi.framework.FrameworkUtil", "getBundle", "org.osgi.framework.Bundle", "java.lang.Class"))
+ .request(StackRequest.RETURN_VALUE, StackRequest.PARAM1)
+ .wrapMethod(new Hook("lombok.launch.PatchFixesHider$Tests", "getBundle", "java.lang.Object", "java.lang.Object", "java.lang.Class"))
+ .build());
+ }
}