From 3adf835e48f064a4b8ef1d24d3d32d1827c03f28 Mon Sep 17 00:00:00 2001 From: Jappe van der Hel Date: Wed, 4 Jan 2012 00:18:35 +0100 Subject: "QualifiedName"'s are now also marked as generated during ASTConverter phase (just like "SimpleName"'s) This fixes "Rename" when inner types are used (for both the main type and the inner type) --- src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index 53d60bde..9f7abbe3 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -212,7 +212,7 @@ public class PatchFixes { } } - public static void setIsGeneratedFlagForSimpleName(SimpleName name, Object internalNode) throws Exception { + public static void setIsGeneratedFlagForName(org.eclipse.jdt.core.dom.Name name, Object internalNode) throws Exception { if (internalNode instanceof org.eclipse.jdt.internal.compiler.ast.ASTNode) { if (internalNode.getClass().getField("$generatedBy").get(internalNode) != null) { name.getClass().getField("$isGenerated").set(name, true); -- cgit From 1a08aa5cbca685ffd8b056f4a4fc64ce9912027c Mon Sep 17 00:00:00 2001 From: Jappe van der Hel Date: Tue, 10 Jan 2012 13:22:38 +0100 Subject: removeGeneratedMethods was broken, causing the rename to fail --- src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index 9f7abbe3..c2ab45e0 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -258,9 +258,9 @@ public class PatchFixes { public static IMethod[] removeGeneratedMethods(IMethod[] methods) throws Exception { List result = new ArrayList(); for (IMethod m : methods) { - if (m.getNameRange().getLength() > 0) result.add(m); + if (m.getNameRange().getLength() > 0 && !m.getNameRange().equals(m.getSourceRange())) result.add(m); } - return result.size() == methods.length ? methods : result.toArray(new IMethod[0]); + return result.size() == methods.length ? methods : result.toArray(new IMethod[result.size()]); } public static SimpleName[] removeGeneratedSimpleNames(SimpleName[] in) throws Exception { -- cgit