diff options
author | Roel Spilker <r.spilker@gmail.com> | 2009-10-10 02:29:40 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2009-10-10 02:29:40 +0200 |
commit | 2f80f9eff4c3b553a6b3ccea31a18c48629d49fc (patch) | |
tree | 500a5695a6812afb6f4c5b1206b16769a2400609 /src_eclipseagent/lombok/eclipse/agent/PatchFixes.java | |
parent | 61d2011f1f254bfdbbf3defe1b0aa7b8ca7c3c2f (diff) | |
download | lombok-2f80f9eff4c3b553a6b3ccea31a18c48629d49fc.tar.gz lombok-2f80f9eff4c3b553a6b3ccea31a18c48629d49fc.tar.bz2 lombok-2f80f9eff4c3b553a6b3ccea31a18c48629d49fc.zip |
Renaming an inner type, or a type in a linked file, still failed. Now it works.
Diffstat (limited to 'src_eclipseagent/lombok/eclipse/agent/PatchFixes.java')
-rw-r--r-- | src_eclipseagent/lombok/eclipse/agent/PatchFixes.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src_eclipseagent/lombok/eclipse/agent/PatchFixes.java b/src_eclipseagent/lombok/eclipse/agent/PatchFixes.java index c8459a5f..e0d21f90 100644 --- a/src_eclipseagent/lombok/eclipse/agent/PatchFixes.java +++ b/src_eclipseagent/lombok/eclipse/agent/PatchFixes.java @@ -1,7 +1,10 @@ package lombok.eclipse.agent; import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.dom.SimpleName; public class PatchFixes { @@ -34,6 +37,14 @@ public class PatchFixes { } } + public static IMethod[] removeGeneratedMethods(IMethod[] methods) throws Exception { + List<IMethod> result = new ArrayList<IMethod>(); + for (IMethod m : methods) { + if (m.getNameRange().getLength() > 0) result.add(m); + } + return result.size() == methods.length ? methods : result.toArray(new IMethod[0]); + } + public static SimpleName[] removeGeneratedSimpleNames(SimpleName[] in) throws Exception { Field f = SimpleName.class.getField("$isGenerated"); |