From 2d9195a2296e36ce904719b63ff0e5c0321b2a74 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 28 May 2011 19:30:34 +0200 Subject: Removed the ability of lombok to run as ecj annotation processor, because it won't actually work right; method-level generics would break. The new way is to use -javaagent:lombok.jar=ECJ in addition to -cp lombok.jar --- src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/eclipseAgent/lombok/eclipse/agent') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java index ccc00f5d..71fa1dc5 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java @@ -28,7 +28,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; +import java.util.IdentityHashMap; import java.util.List; +import java.util.Map; import java.util.Set; import lombok.core.AST.Kind; @@ -159,6 +161,9 @@ public class PatchDelegate { return null; } + private static Map alreadyApplied = new IdentityHashMap(); + private static final Object MARKER = new Object(); + private static void fillMethodBindings(CompilationUnitDeclaration cud, ClassScope scope, List methodsToDelegate) { TypeDeclaration decl = scope.referenceContext; if (decl == null) return; @@ -170,6 +175,7 @@ public class PatchDelegate { TypeBinding tb = ann.type.resolveType(decl.initializerScope); if (!charArrayEquals("lombok", tb.qualifiedPackageName())) continue; if (!charArrayEquals("Delegate", tb.qualifiedSourceName())) continue; + if (alreadyApplied.put(ann, MARKER) == MARKER) continue; List rawTypes = new ArrayList(); List excludedRawTypes = new ArrayList(); -- cgit