Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 658702e

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 6b882e9 commit 658702e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)