### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/core/Signature.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java,v retrieving revision 1.97 diff -u -r1.97 Signature.java --- model/org/eclipse/jdt/core/Signature.java 11 May 2010 18:47:10 -0000 1.97 +++ model/org/eclipse/jdt/core/Signature.java 20 Oct 2010 14:22:31 -0000 @@ -2202,8 +2202,17 @@ // parameters buffer.append('('); char[][] pts = getParameterTypes(methodSignature); - for (int i = 0, max = pts.length; i < max; i++) { - if (i == max - 1) { + // search for the last array in the signature + int max = pts.length; + int index = max - 1; + loop: for (int i = index; i >= 0; i--) { + if (pts[i][0] == Signature.C_ARRAY) { + break loop; + } + index--; + } + for (int i = 0; i < max; i++) { + if (i == index) { appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer, isVargArgs); } else { appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer); #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java,v retrieving revision 1.61 diff -u -r1.61 VarargsTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 14 Aug 2008 17:34:25 -0000 1.61 +++ src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 20 Oct 2010 14:22:31 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,7 +33,7 @@ // All specified tests which does not belong to the class are skipped... static { // TESTS_NAMES = new String[] { "test000" }; -// TESTS_NUMBERS = new int[] { 60 }; +// TESTS_NUMBERS = new int[] { 62 }; // TESTS_RANGE = new int[] { 11, -1 }; } public static Test suite() { @@ -2168,4 +2168,32 @@ "Zork cannot be resolved to a type\n" + "----------\n"); } + //https://bugs.eclipse.org/bugs/show_bug.cgi?id=328247 + public void test062() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "public class X {\r\n" + + " private static final String CONST = \"\";\r\n" + + "\r\n" + + " public static class A {\r\n" + + " A(Integer i, String... tab) {}\r\n" + + " }\r\n" + + " \r\n" + + " Object foo(final Float f) {\r\n" + + " return new A(new Integer(0), CONST) {\r\n" + + " public String toString() {\r\n" + + " return f.toString();\r\n" + + " }\r\n" + + " };\r\n" + + " }\r\n" + + "}", + }, + ""); + String expectedOutput = + " // Method descriptor #10 (LX;Ljava/lang/Integer;[Ljava/lang/String;Ljava/lang/Float;)V\n" + + " // Stack: 3, Locals: 5\n" + + " X$1(X arg0, java.lang.Integer $anonymous0, java.lang.String... $anonymous1, java.lang.Float arg3);\n"; + checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$1.class", "X$1", expectedOutput); + } }