aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-22 23:46:12 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-22 23:46:12 +0100
commit4ba4a371b5741fd8ba77969da3704725e97fdeed (patch)
tree6a1e472004897c62fc6a213324244862386a95ec /src
parente151d491388a6a159e339509e4582e56ab4df02b (diff)
downloadlombok-4ba4a371b5741fd8ba77969da3704725e97fdeed.tar.gz
lombok-4ba4a371b5741fd8ba77969da3704725e97fdeed.tar.bz2
lombok-4ba4a371b5741fd8ba77969da3704725e97fdeed.zip
Cleaned up the patch fixes in eclipse for finding end of identifier and start of catch block. Maaartin-1 reported issues that sound like these were at fault they we were not able to reproduce them.
Diffstat (limited to 'src')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java8
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 88518337..d039f015 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -140,15 +140,15 @@ public class EclipsePatcher extends Agent {
private static void patchCatchReparse(ScriptManager sm) {
sm.addScript(ScriptBuilder.wrapReturnValue()
.target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "retrieveStartingCatchPosition"))
- .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "fixRetrieveStartingCatchPosition", "int", "int"))
- .transplant().request(StackRequest.PARAM1).build());
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "fixRetrieveStartingCatchPosition", "int", "int", "int"))
+ .transplant().request(StackRequest.RETURN_VALUE, StackRequest.PARAM1).build());
}
private static void patchIdentifierEndReparse(ScriptManager sm) {
sm.addScript(ScriptBuilder.wrapReturnValue()
.target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "retrieveIdentifierEndPosition"))
- .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "fixRetrieveIdentifierEndPosition", "int", "int"))
- .transplant().request(StackRequest.PARAM1).build());
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "fixRetrieveIdentifierEndPosition", "int", "int", "int"))
+ .transplant().request(StackRequest.RETURN_VALUE, StackRequest.PARAM2).build());
}
private static void patchSetGeneratedFlag(ScriptManager sm) {
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
index 7c2936ba..8a07302c 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
@@ -36,12 +36,12 @@ import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.dom.SimpleName;
public class PatchFixes {
- public static int fixRetrieveStartingCatchPosition(int in) {
- return in;
+ public static int fixRetrieveStartingCatchPosition(int original, int start) {
+ return original == -1 ? start : original;
}
- public static int fixRetrieveIdentifierEndPosition(int in) {
- return in;
+ public static int fixRetrieveIdentifierEndPosition(int original, int end) {
+ return original == -1 ? end : original;
}
public static final int ALREADY_PROCESSED_FLAG = 0x800000; //Bit 24