From 017df4c72a755707366bfb6271e2df46a76f3aa4 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 13 Mar 2022 12:55:53 +0100 Subject: [fixes #3134] Search patched method also by parameters --- src/eclipseAgent/lombok/launch/PatchFixesHider.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/eclipseAgent/lombok/launch') diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java index e0c330a2..a844239f 100755 --- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java +++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java @@ -39,6 +39,7 @@ import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.Name; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jdt.core.dom.Type; @@ -780,6 +781,22 @@ final class PatchFixesHider { return newSimpleNames; } + public static Name[] removeGeneratedNames(Name[] in) throws Exception { + Field f = Name.class.getField("$isGenerated"); + + int count = 0; + for (int i = 0; i < in.length; i++) { + if (in[i] == null || !((Boolean)f.get(in[i])).booleanValue()) count++; + } + if (count == in.length) return in; + Name[] newNames = new Name[count]; + count = 0; + for (int i = 0; i < in.length; i++) { + if (in[i] == null || !((Boolean)f.get(in[i])).booleanValue()) newNames[count++] = in[i]; + } + return newNames; + } + public static Annotation[] convertAnnotations(Annotation[] out, IAnnotatable annotatable) { IAnnotation[] in; -- cgit