aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/launch
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2022-03-13 12:55:53 +0100
committerRawi01 <Rawi01@users.noreply.github.com>2022-03-13 12:55:53 +0100
commit017df4c72a755707366bfb6271e2df46a76f3aa4 (patch)
tree6a855581a4060d6aa34c1d1b76015459996f8bcb /src/eclipseAgent/lombok/launch
parent8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb (diff)
downloadlombok-017df4c72a755707366bfb6271e2df46a76f3aa4.tar.gz
lombok-017df4c72a755707366bfb6271e2df46a76f3aa4.tar.bz2
lombok-017df4c72a755707366bfb6271e2df46a76f3aa4.zip
[fixes #3134] Search patched method also by parameters
Diffstat (limited to 'src/eclipseAgent/lombok/launch')
-rwxr-xr-xsrc/eclipseAgent/lombok/launch/PatchFixesHider.java17
1 files changed, 17 insertions, 0 deletions
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;