Skip to content

Commit 2f730b1

Browse files
author
sebastigurin
committed
fix for varargs invocation like vararg("param1", "2", new String[]{"3","4"}). needsBraked should be false only when there is only one array parameter in the method invocation
1 parent 6e3bd17 commit 2f730b1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/ASTScriptVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,7 @@ public boolean visit(MethodInvocation node) {
18631863
else {
18641864
Expression arg = (Expression) args.get(args.size() - 1);
18651865
ITypeBinding resolveTypeBinding = arg.resolveTypeBinding();
1866-
if (resolveTypeBinding != null && resolveTypeBinding.isArray())
1866+
if (resolveTypeBinding != null && resolveTypeBinding.isArray() && args.size()==1) /* sgurin: fix for varargs invocation like vararg("param1", "2", new String[]{"3","4"}). needsBraked should be false only when there is only one array parameter in the method invocation */
18671867
needBrackets = false;
18681868
if (needBrackets) buffer.append("[");
18691869
visitList(args, ", ", paramTypes.length - 1, size);

0 commit comments

Comments
 (0)