aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 10:16:46 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 10:16:46 +0200
commit33b3e798fd6fdd85c6aa09cf30e8b19acacb1543 (patch)
tree1df113d0a6031dbc97f0a5ad89bc9c7621ec6204 /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parent8e1cbe1b1079c1a6f5123add0241d32c8452cdae (diff)
downloadlombok-33b3e798fd6fdd85c6aa09cf30e8b19acacb1543.tar.gz
lombok-33b3e798fd6fdd85c6aa09cf30e8b19acacb1543.tar.bz2
lombok-33b3e798fd6fdd85c6aa09cf30e8b19acacb1543.zip
Added some 'live debugging' - patches to improve error reporting for bugs that are very hard to reproduce.
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 7e38a35b..1e0d9082 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -63,6 +63,7 @@ public class EclipsePatcher extends Agent {
patchCatchReparse(sm);
patchSetGeneratedFlag(sm);
patchHideGeneratedNodes(sm);
+ patchLiveDebug(sm);
}
if (reloadExistingClasses) sm.reloadClasses(instrumentation);
@@ -165,6 +166,20 @@ public class EclipsePatcher extends Agent {
.transplant().build());
}
+ /**
+ * XXX LIVE DEBUG
+ *
+ * Adds patches to improve error reporting in cases of extremely rare bugs that are hard to reproduce. These should be removed
+ * once the issue has been solved!
+ */
+ private static void patchLiveDebug(ScriptManager sm) {
+ sm.addScript(ScriptBuilder.exitEarly()
+ .target(new MethodTarget(
+ "org.eclipse.jdt.internal.compiler.ast.MethodDeclaration", "resolveStatements", "void"))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "debugPrintStateOfScope", "boolean", "java.lang.Object"))
+ .request(StackRequest.THIS).build());
+ }
+
private static void patchAvoidReparsingGeneratedCode(ScriptManager sm) {
final String PARSER_SIG = "org.eclipse.jdt.internal.compiler.parser.Parser";
sm.addScript(ScriptBuilder.exitEarly()