View | Details | Raw Unified | Return to bug 99260 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java (-4 / +32 lines)
Lines 20-30 Link Here
20
20
21
	// Static initializer to specify tests subset using TESTS_* static variables
21
	// Static initializer to specify tests subset using TESTS_* static variables
22
	// All specified tests which does not belong to the class are skipped...
22
	// All specified tests which does not belong to the class are skipped...
23
//	static {
23
	static {
24
//		TESTS_NAMES = new String[] { "test000" };
24
//		TESTS_NAMES = new String[] { "test000" };
25
//		TESTS_NUMBERS = new int[] { 24, 25 };
25
//		TESTS_NUMBERS = new int[] { 30 };
26
//		TESTS_RANGE = new int[] { 11, -1 };
26
//		TESTS_RANGE = new int[] { 11, -1 };
27
//	}
27
	}
28
	public static Test suite() {
28
	public static Test suite() {
29
		Test suite = buildTestSuite(testClass());
29
		Test suite = buildTestSuite(testClass());
30
		TESTS_COUNTERS.put(testClass().getName(), new Integer(suite.countTestCases()));
30
		TESTS_COUNTERS.put(testClass().getName(), new Integer(suite.countTestCases()));
Lines 1134-1138 Link Here
1134
			"	^^^^\n" + 
1134
			"	^^^^\n" + 
1135
			"Zork cannot be resolved to a type\n" + 
1135
			"Zork cannot be resolved to a type\n" + 
1136
			"----------\n");
1136
			"----------\n");
1137
	}		
1137
	}
1138
	
1139
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=99260
1140
	public void test030() {
1141
		this.runConformTest(
1142
			new String[] {
1143
				"X.java",
1144
				"import java.io.Serializable;\n" +
1145
				"public class X {\n" +
1146
				"	public static void main(String[] args) {\n" +
1147
				"		audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", new Integer(0));\n" +
1148
				"		audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", \"Y\");\n" +
1149
				"		audit(\"osvaldo\", \"localhost\", \"logged\", new Float(0), new java.awt.Point(0, 0));\n" +
1150
				"	}\n" +
1151
				"	public static <A extends Serializable> void audit(String login,\n" +
1152
				"			String address, String event, A... args) {\n" +
1153
				"		for (A a : args) {\n" +
1154
				"			System.out.println(a.getClass());\n" +
1155
				"		}\n" +
1156
				"	}\n" +
1157
				"}",
1158
			},
1159
			"class java.lang.String\n" + 
1160
			"class java.lang.Integer\n" + 
1161
			"class java.lang.String\n" + 
1162
			"class java.lang.String\n" + 
1163
			"class java.lang.Float\n" + 
1164
			"class java.awt.Point");
1165
	}
1138
}
1166
}

Return to bug 99260