aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2011-08-16 02:46:22 +0200
committerRoel Spilker <r.spilker@gmail.com>2011-08-16 02:46:22 +0200
commit14efdb09ad5ab153d2c1a1019d5f5a97c25f8249 (patch)
treeececa0cadbe76b101f081d62576c62bfe070c04c /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parent85c90ca606869d42be64d513b2a6f829712dbe27 (diff)
downloadlombok-14efdb09ad5ab153d2c1a1019d5f5a97c25f8249.tar.gz
lombok-14efdb09ad5ab153d2c1a1019d5f5a97c25f8249.tar.bz2
lombok-14efdb09ad5ab153d2c1a1019d5f5a97c25f8249.zip
Improve Extract method refactoring: you can extract method for code that also contains @SneakyThrows
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 0ac62c79..6b899807 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -85,6 +85,7 @@ public class EclipsePatcher extends Agent {
patchIdentifierEndReparse(sm);
patchRetrieveEllipsisStartPosition(sm);
patchSetGeneratedFlag(sm);
+ patchDomAstReparseIssues(sm);
patchHideGeneratedNodes(sm);
patchPostCompileHookEclipse(sm);
patchFixSourceTypeConverter(sm);
@@ -98,6 +99,17 @@ public class EclipsePatcher extends Agent {
if (reloadExistingClasses) sm.reloadClasses(instrumentation);
}
+ private static void patchDomAstReparseIssues(ScriptManager sm) {
+ sm.addScript(ScriptBuilder.replaceMethodCall()
+ .target(new MethodTarget("org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer", "visit"))
+ .methodToReplace(new Hook("org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner", "getTokenEndOffset", "int", "int", "int"))
+ .replacementMethod(new Hook("lombok.eclipse.agent.PatchFixes", "getTokenEndOffsetFixed", "int", "org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner", "int", "int", "java.lang.Object"))
+ .requestExtra(StackRequest.PARAM1)
+ .transplant()
+ .build());
+
+ }
+
private static void patchPostCompileHookEclipse(ScriptManager sm) {
sm.addScript(ScriptBuilder.wrapMethodCall()
.target(new MethodTarget("org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder", "writeClassFileContents"))