aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/launch
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2022-03-13 13:44:51 +0100
committerGitHub <noreply@github.com>2022-03-13 13:44:51 +0100
commit70bda546114ceccc7714bd6060d96edbcd25e3a0 (patch)
treed9f1be03959470253696074dfb6776323473c022 /src/eclipseAgent/lombok/launch
parent77e54d274597e54c0cbd32cebadddd7d00cb5b10 (diff)
parent017df4c72a755707366bfb6271e2df46a76f3aa4 (diff)
downloadlombok-70bda546114ceccc7714bd6060d96edbcd25e3a0.tar.gz
lombok-70bda546114ceccc7714bd6060d96edbcd25e3a0.tar.bz2
lombok-70bda546114ceccc7714bd6060d96edbcd25e3a0.zip
Merge pull request #3136 from Rawi01/eclipse-rename
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;