From 27a3efeb1cb6f79ecefc6e641ba78de6d69406c3 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 26 Sep 2009 09:00:12 +0200 Subject: Rewrite of the eclipse agent to use the new lombok.patcher project. --- .../java/lombok/eclipse/ClassLoaderWorkaround.java | 4 ++++ src_eclipseagent/java/lombok/eclipse/PatchFixes.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src_eclipseagent/java/lombok/eclipse/PatchFixes.java (limited to 'src_eclipseagent/java/lombok') diff --git a/src_eclipseagent/java/lombok/eclipse/ClassLoaderWorkaround.java b/src_eclipseagent/java/lombok/eclipse/ClassLoaderWorkaround.java index f5c8bbd3..3d8e9ec9 100644 --- a/src_eclipseagent/java/lombok/eclipse/ClassLoaderWorkaround.java +++ b/src_eclipseagent/java/lombok/eclipse/ClassLoaderWorkaround.java @@ -52,6 +52,10 @@ public class ClassLoaderWorkaround { private static final Map transform = new HashMap(); + public static void transformCompilationUnitDeclarationSwapped(Object cud, Object parser) throws Exception { + transformCompilationUnitDeclaration(parser, cud); + } + public static void transformCompilationUnitDeclaration(Object parser, Object cud) throws Exception { Method transformMethod = getTransformMethod(cud); try { diff --git a/src_eclipseagent/java/lombok/eclipse/PatchFixes.java b/src_eclipseagent/java/lombok/eclipse/PatchFixes.java new file mode 100644 index 00000000..23c60d32 --- /dev/null +++ b/src_eclipseagent/java/lombok/eclipse/PatchFixes.java @@ -0,0 +1,14 @@ +package java.lombok.eclipse; + +public class PatchFixes { + public static int fixRetrieveStartingCatchPosition(int in) { + return in; + } + + private static final int BIT24 = 0x800000; + + public static boolean checkBit24(Object node) throws Exception { + int bits = (Integer)(node.getClass().getField("bits").get(node)); + return (bits & BIT24) != 0; + } +} -- cgit