aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-13 20:21:25 +0000
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-13 20:21:25 +0000
commit2ae0341a3f3656ec29094a16d9c9bbfc6f4ba1d3 (patch)
treee00faac7bb287bf8c6d674bdb1cda01fd5aad3af /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parentb30f8e351b241f8976c6b00ff402df39eedde2bc (diff)
downloadlombok-2ae0341a3f3656ec29094a16d9c9bbfc6f4ba1d3.tar.gz
lombok-2ae0341a3f3656ec29094a16d9c9bbfc6f4ba1d3.tar.bz2
lombok-2ae0341a3f3656ec29094a16d9c9bbfc6f4ba1d3.zip
Jiggered the hook point a bit for eclipse 'delegate' support and it looks like this might just work.
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index c54ef604..5d24d81e 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -26,6 +26,9 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
+import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+
import lombok.core.Agent;
import lombok.patcher.Hook;
import lombok.patcher.MethodTarget;
@@ -264,10 +267,18 @@ public class EclipsePatcher extends Agent {
private static void patchDelegate(ScriptManager sm) {
final String TYPEDECLARATION_SIG = "org.eclipse.jdt.internal.compiler.ast.TypeDeclaration";
+// sm.addScript(ScriptBuilder.exitEarly()
+// .target(new MethodTarget(TYPEDECLARATION_SIG, "resolve", "void"))
+// .request(StackRequest.THIS)
+// .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "handleDelegateForType", "boolean", TYPEDECLARATION_SIG))
+// .build());
+
+ final String CLASSSCOPE_SIG = "org.eclipse.jdt.internal.compiler.lookup.ClassScope";
+
sm.addScript(ScriptBuilder.exitEarly()
- .target(new MethodTarget(TYPEDECLARATION_SIG, "resolve", "void"))
+ .target(new MethodTarget(CLASSSCOPE_SIG, "buildFieldsAndMethods", "void"))
.request(StackRequest.THIS)
- .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "handleDelegateForType", "boolean", TYPEDECLARATION_SIG))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "handleDelegateForType2", "boolean", CLASSSCOPE_SIG))
.build());
}