View | Details | Raw Unified | Return to bug 328247
Collapse All | Expand All

(-)model/org/eclipse/jdt/core/Signature.java (-2 / +11 lines)
Lines 2202-2209 Link Here
2202
	// parameters
2202
	// parameters
2203
	buffer.append('(');
2203
	buffer.append('(');
2204
	char[][] pts = getParameterTypes(methodSignature);
2204
	char[][] pts = getParameterTypes(methodSignature);
2205
	for (int i = 0, max = pts.length; i < max; i++) {
2205
	// search for the last array in the signature
2206
		if (i == max - 1) {
2206
	int max = pts.length;
2207
	int index = max - 1;
2208
	loop: for (int i = index; i >= 0; i--) {
2209
		if (pts[i][0] == Signature.C_ARRAY) {
2210
			break loop;
2211
		}
2212
		index--;
2213
	}
2214
	for (int i = 0; i < max; i++) {
2215
		if (i == index) {
2207
			appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer, isVargArgs);
2216
			appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer, isVargArgs);
2208
		} else {
2217
		} else {
2209
			appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer);
2218
			appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java (-2 / +30 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 33-39 Link Here
33
	// All specified tests which does not belong to the class are skipped...
33
	// All specified tests which does not belong to the class are skipped...
34
	static {
34
	static {
35
//		TESTS_NAMES = new String[] { "test000" };
35
//		TESTS_NAMES = new String[] { "test000" };
36
//		TESTS_NUMBERS = new int[] { 60 };
36
//		TESTS_NUMBERS = new int[] { 62 };
37
//		TESTS_RANGE = new int[] { 11, -1 };
37
//		TESTS_RANGE = new int[] { 11, -1 };
38
	}
38
	}
39
	public static Test suite() {
39
	public static Test suite() {
Lines 2168-2171 Link Here
2168
				"Zork cannot be resolved to a type\n" +
2168
				"Zork cannot be resolved to a type\n" +
2169
				"----------\n");
2169
				"----------\n");
2170
	}
2170
	}
2171
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=328247
2172
	public void test062() throws Exception {
2173
		this.runConformTest(
2174
			new String[] {
2175
				"X.java",
2176
				"public class X {\r\n" + 
2177
				"	private static final String CONST = \"\";\r\n" + 
2178
				"\r\n" + 
2179
				"	public static class A {\r\n" + 
2180
				"		A(Integer i, String... tab) {}\r\n" + 
2181
				"	}\r\n" + 
2182
				"	\r\n" + 
2183
				"	Object foo(final Float f) {\r\n" + 
2184
				"		return new A(new Integer(0), CONST) {\r\n" + 
2185
				"			public String toString() {\r\n" + 
2186
				"				return f.toString();\r\n" + 
2187
				"			}\r\n" + 
2188
				"		};\r\n" + 
2189
				"	}\r\n" + 
2190
				"}",
2191
			},
2192
			"");
2193
		String expectedOutput =
2194
			"  // Method descriptor #10 (LX;Ljava/lang/Integer;[Ljava/lang/String;Ljava/lang/Float;)V\n" + 
2195
			"  // Stack: 3, Locals: 5\n" + 
2196
			"  X$1(X arg0, java.lang.Integer $anonymous0, java.lang.String... $anonymous1, java.lang.Float arg3);\n";
2197
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$1.class", "X$1", expectedOutput);
2198
	}
2171
}
2199
}

Return to bug 328247