aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
index a63617d4..8c1a8db7 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
@@ -166,7 +166,6 @@ public class PatchDelegate {
if (!Arrays.equals(mb.selector, name)) continue;
int paramLen = mb.parameters == null ? 0 : mb.parameters.length;
if (paramLen != args.length) continue;
- // TODO check if varargs are copied or otherwise handled correctly.
for (int i = 0; i < paramLen; i++) {
if (!mb.parameters[i].erasure().isEquivalentTo(args[i])) continue methods;
}
@@ -328,6 +327,8 @@ public class PatchDelegate {
* }
*/
+ boolean isVarargs = (pair.base.modifiers & ClassFileConstants.AccVarargs) != 0;
+
try {
checkConflictOfTypeVarNames(pair, typeNode);
} catch (CantMakeDelegates e) {
@@ -423,6 +424,12 @@ public class PatchDelegate {
call.arguments[i] = new SingleNameReference(argName, pos(source));
Eclipse.setGeneratedBy(call.arguments[i], source);
}
+ if (isVarargs) {
+ method.arguments[method.arguments.length - 1].type.bits |= ASTNode.IsVarArgs;
+ }
+ for (int i = 0; i < method.arguments.length; i++) {
+ System.out.printf("Positions of marg type: %d %d\n", method.arguments[i].sourceStart(), method.arguments[i].sourceEnd());
+ }
}
Statement body;