Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 339478 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (-1 / +2 lines)
Lines 208-213 Link Here
208
			    	((ClassScope) scope).superTypeReference = null;
208
			    	((ClassScope) scope).superTypeReference = null;
209
			    }
209
			    }
210
				int argLength = args.length;
210
				int argLength = args.length;
211
				boolean isDiamond = argLength == 0 && (i == (max -1)) && ((this.bits & ASTNode.IsDiamond) != 0);
211
				TypeBinding[] argTypes = new TypeBinding[argLength];
212
				TypeBinding[] argTypes = new TypeBinding[argLength];
212
				boolean argHasError = false;
213
				boolean argHasError = false;
213
				ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
214
				ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
Lines 246-252 Link Here
246
						this.resolvedType = scope.createArrayType(this.resolvedType, this.dimensions);
247
						this.resolvedType = scope.createArrayType(this.resolvedType, this.dimensions);
247
					}
248
					}
248
					return this.resolvedType;
249
					return this.resolvedType;
249
				} else if (argLength != typeVariables.length) { // check arity
250
				} else if (argLength != typeVariables.length && !isDiamond) { // check arity
250
					scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i);
251
					scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i);
251
					return null;
252
					return null;
252
				}
253
				}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-1 / +1 lines)
Lines 221-227 Link Here
221
				return this.resolvedType = type;
221
				return this.resolvedType = type;
222
			}
222
			}
223
			// if missing generic type, and compliance >= 1.5, then will rebuild a parameterized binding
223
			// if missing generic type, and compliance >= 1.5, then will rebuild a parameterized binding
224
		} else if (argLength != typeVariables.length) { // check arity
224
		} else if (argLength != typeVariables.length && (this.bits & ASTNode.IsDiamond) == 0) { // check arity, IsDiamond never set for 1.6-
225
			scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
225
			scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
226
			return null;
226
			return null;
227
		} else if (!currentType.isStatic()) {
227
		} else if (!currentType.isStatic()) {
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-11 / +35 lines)
Lines 1177-1182 Link Here
1177
				length);
1177
				length);
1178
		}
1178
		}
1179
		alloc.type = getTypeReference(0);
1179
		alloc.type = getTypeReference(0);
1180
		if (this.options.sourceLevel >= ClassFileConstants.JDK1_7) {
1181
			checkForDiamond(alloc.type);
1182
		}
1180
1183
1181
		//the default constructor with the correct number of argument
1184
		//the default constructor with the correct number of argument
1182
		//will be created and added by the TC (see createsInternalConstructorWithBinding)
1185
		//will be created and added by the TC (see createsInternalConstructorWithBinding)
Lines 1197-1202 Link Here
1197
		this.astLengthPtr--;
1200
		this.astLengthPtr--;
1198
	}
1201
	}
1199
}
1202
}
1203
private void checkForDiamond(TypeReference allocType) {
1204
	if (allocType instanceof ParameterizedSingleTypeReference) {
1205
		ParameterizedSingleTypeReference type = (ParameterizedSingleTypeReference) allocType;
1206
		if (type.typeArguments == TypeReference.NO_TYPE_ARGUMENTS) {
1207
			type.bits |= ASTNode.IsDiamond;
1208
		}
1209
	} 
1210
	else if (allocType instanceof ParameterizedQualifiedTypeReference) {
1211
		ParameterizedQualifiedTypeReference type = (ParameterizedQualifiedTypeReference) allocType;
1212
		if (type.typeArguments[type.typeArguments.length - 1] == TypeReference.NO_TYPE_ARGUMENTS) { // Don't care for X<>.Y<> and X<>.Y<String>
1213
			type.bits |= ASTNode.IsDiamond;
1214
		}
1215
	}
1216
}
1200
protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) {
1217
protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) {
1201
	int nameSize = this.identifierLengthStack[this.identifierLengthPtr];
1218
	int nameSize = this.identifierLengthStack[this.identifierLengthPtr];
1202
	int tokensSize = nameSize;
1219
	int tokensSize = nameSize;
Lines 2440-2446 Link Here
2440
				length);
2457
				length);
2441
		}
2458
		}
2442
		alloc.type = getTypeReference(0);
2459
		alloc.type = getTypeReference(0);
2443
2460
		if (this.options.sourceLevel >= ClassFileConstants.JDK1_7) {
2461
			checkForDiamond(alloc.type);
2462
		}
2444
		length = this.genericsLengthStack[this.genericsLengthPtr--];
2463
		length = this.genericsLengthStack[this.genericsLengthPtr--];
2445
		this.genericsPtr -= length;
2464
		this.genericsPtr -= length;
2446
		System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
2465
		System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
Lines 2504-2509 Link Here
2504
				length);
2523
				length);
2505
		}
2524
		}
2506
		alloc.type = getTypeReference(0);
2525
		alloc.type = getTypeReference(0);
2526
		if (this.options.sourceLevel >= ClassFileConstants.JDK1_7) {
2527
			checkForDiamond(alloc.type);
2528
		}		
2507
2529
2508
		length = this.genericsLengthStack[this.genericsLengthPtr--];
2530
		length = this.genericsLengthStack[this.genericsLengthPtr--];
2509
		this.genericsPtr -= length;
2531
		this.genericsPtr -= length;
Lines 3956-3961 Link Here
3956
	// zero type arguments == <>
3978
	// zero type arguments == <>
3957
	pushOnGenericsLengthStack(-1);
3979
	pushOnGenericsLengthStack(-1);
3958
	concatGenericsLists();
3980
	concatGenericsLists();
3981
	this.intPtr--;	// pop the null dimension pushed in by consumeReferenceType, as we have no type between <>, getTypeReference won't kick in 
3959
}
3982
}
3960
protected void consumeImportDeclaration() {
3983
protected void consumeImportDeclaration() {
3961
	// SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
3984
	// SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
Lines 8900-8907 Link Here
8900
	if (identifierLength == 1 && numberOfIdentifiers == 1) {
8923
	if (identifierLength == 1 && numberOfIdentifiers == 1) {
8901
		int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
8924
		int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
8902
		TypeReference[] typeArguments = null;
8925
		TypeReference[] typeArguments = null;
8903
		boolean isDiamond = currentTypeArgumentsLength < 0;
8926
		if (currentTypeArgumentsLength < 0) {
8904
		if (isDiamond) {
8905
			typeArguments = TypeReference.NO_TYPE_ARGUMENTS;
8927
			typeArguments = TypeReference.NO_TYPE_ARGUMENTS;
8906
		} else {
8928
		} else {
8907
			typeArguments = new TypeReference[currentTypeArgumentsLength];
8929
			typeArguments = new TypeReference[currentTypeArgumentsLength];
Lines 8912-8920 Link Here
8912
		if (dim != 0) {
8934
		if (dim != 0) {
8913
			parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition;
8935
			parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition;
8914
		}
8936
		}
8915
		if (isDiamond) {
8937
		/* We used to eagerly mark the PSTR as constituting diamond usage if we encountered <>, but that is too eager and
8916
			parameterizedSingleTypeReference.bits |= ASTNode.IsDiamond;
8938
		   complicates error handling by making it hard to distinguish legitimate use cases from ill formed ones. We are
8917
		}
8939
		   more discriminating now and tag a type as being diamond only where <> can legally occur. 
8940
		   See https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478#c11
8941
		*/
8918
		return parameterizedSingleTypeReference;
8942
		return parameterizedSingleTypeReference;
8919
	} else {
8943
	} else {
8920
		TypeReference[][] typeArguments = new TypeReference[numberOfIdentifiers][];
8944
		TypeReference[][] typeArguments = new TypeReference[numberOfIdentifiers][];
Lines 8922-8928 Link Here
8922
		long[] positions = new long[numberOfIdentifiers];
8946
		long[] positions = new long[numberOfIdentifiers];
8923
		int index = numberOfIdentifiers;
8947
		int index = numberOfIdentifiers;
8924
		int currentIdentifiersLength = identifierLength;
8948
		int currentIdentifiersLength = identifierLength;
8925
		boolean isDiamond = false;
8926
		while (index > 0) {
8949
		while (index > 0) {
8927
			int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
8950
			int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
8928
			if (currentTypeArgumentsLength > 0) {
8951
			if (currentTypeArgumentsLength > 0) {
Lines 8931-8937 Link Here
8931
			} else if (currentTypeArgumentsLength < 0) {
8954
			} else if (currentTypeArgumentsLength < 0) {
8932
				// diamond case for qualified type reference (java.util.ArrayList<>)
8955
				// diamond case for qualified type reference (java.util.ArrayList<>)
8933
				typeArguments[index - 1] = TypeReference.NO_TYPE_ARGUMENTS;
8956
				typeArguments[index - 1] = TypeReference.NO_TYPE_ARGUMENTS;
8934
				isDiamond = true;
8935
			}
8957
			}
8936
			switch(currentIdentifiersLength) {
8958
			switch(currentIdentifiersLength) {
8937
				case 1 :
8959
				case 1 :
Lines 8954-8962 Link Here
8954
		if (dim != 0) {
8976
		if (dim != 0) {
8955
			parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition;
8977
			parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition;
8956
		}
8978
		}
8957
		if (isDiamond) {
8979
		/* We used to eagerly mark the PQTR as constituting diamond usage if we encountered <>, but that is too eager and
8958
			parameterizedQualifiedTypeReference.bits |= ASTNode.IsDiamond;
8980
		   complicates error handling by making it hard to distinguish legitimate use cases from ill formed ones. We are
8959
		}
8981
		   more discriminating now and tag a type as being diamond only where <> can legally occur. 
8982
		   See https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478#c11
8983
		*/
8960
		return parameterizedQualifiedTypeReference;
8984
		return parameterizedQualifiedTypeReference;
8961
	}
8985
	}
8962
}
8986
}
(-)dom/org/eclipse/jdt/core/dom/ASTConverter.java (-1 / +16 lines)
Lines 3349-3355 Link Here
3349
		if (this.resolveBindings) {
3349
		if (this.resolveBindings) {
3350
			this.recordNodes(type, typeReference);
3350
			this.recordNodes(type, typeReference);
3351
		}
3351
		}
3352
		if ((typeReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.IsDiamond) != 0) {
3352
		boolean sawDiamond = false;
3353
		if (typeReference instanceof ParameterizedSingleTypeReference) {
3354
			ParameterizedSingleTypeReference pstr = (ParameterizedSingleTypeReference) typeReference;
3355
			if (pstr.typeArguments == TypeReference.NO_TYPE_ARGUMENTS) {
3356
				sawDiamond = true;
3357
			}
3358
		} else if (typeReference instanceof ParameterizedQualifiedTypeReference) {
3359
			ParameterizedQualifiedTypeReference pqtr = (ParameterizedQualifiedTypeReference) typeReference;
3360
			for (int i = 0, len = pqtr.typeArguments.length; i < len; i++) {
3361
				if (pqtr.typeArguments[i] == TypeReference.NO_TYPE_ARGUMENTS) {
3362
					sawDiamond = true;
3363
					break;
3364
				}
3365
			}
3366
		} 
3367
		if (sawDiamond) {
3353
			switch(this.ast.apiLevel) {
3368
			switch(this.ast.apiLevel) {
3354
				case AST.JLS2_INTERNAL :
3369
				case AST.JLS2_INTERNAL :
3355
				case AST.JLS3 :
3370
				case AST.JLS3 :
(-)model/org/eclipse/jdt/core/Signature.java (-7 / +16 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 *
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     IBM Corporation - added J2SE 1.5 support
14
 *     IBM Corporation - added J2SE 1.5 support
Lines 851-862 Link Here
851
		checkPos = checkNextChar(typeName, '<', pos, length, true);
855
		checkPos = checkNextChar(typeName, '<', pos, length, true);
852
		if (checkPos > 0) {
856
		if (checkPos > 0) {
853
			buffer.append(C_GENERIC_START);
857
			buffer.append(C_GENERIC_START);
854
		    pos = encodeTypeSignature(typeName, checkPos, isResolved, length, buffer);
858
			// Stop gap fix for <>.
855
		    while ((checkPos = checkNextChar(typeName, ',', pos, length, true)) > 0) {
859
			if ((pos = checkNextChar(typeName, '>', checkPos, length, true)) > 0) {
856
			    pos = encodeTypeSignature(typeName, checkPos, isResolved, length, buffer);
860
				buffer.append(C_GENERIC_END);
857
		    }
861
			} else {
858
		    pos = checkNextChar(typeName, '>', pos, length, false);
862
				pos = encodeTypeSignature(typeName, checkPos, isResolved, length, buffer);
859
			buffer.append(C_GENERIC_END);
863
				while ((checkPos = checkNextChar(typeName, ',', pos, length, true)) > 0) {
864
					pos = encodeTypeSignature(typeName, checkPos, isResolved, length, buffer);
865
				}
866
				pos = checkNextChar(typeName, '>', pos, length, false);
867
				buffer.append(C_GENERIC_END);
868
			}
860
		}
869
		}
861
		checkPos = checkNextChar(typeName, '.', pos, length, true);
870
		checkPos = checkNextChar(typeName, '.', pos, length, true);
862
		if (checkPos > 0) {
871
		if (checkPos > 0) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java (+191 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 282152 - [1.5][compiler] Generics code rejected by Eclipse but accepted by javac
14
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 282152 - [1.5][compiler] Generics code rejected by Eclipse but accepted by javac
Lines 1740-1743 Link Here
1740
		compilerOptions15,
1744
		compilerOptions15,
1741
		null);
1745
		null);
1742
}
1746
}
1747
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478
1748
// To verify that diamond construct is not allowed in source level 1.6 or below
1749
public void test339478a() {
1750
	if (this.complianceLevel >= ClassFileConstants.JDK1_7)
1751
		return;
1752
	this.runNegativeTest(
1753
		new String[] {
1754
			"X.java",
1755
			"public class X<T> {\n" + 
1756
			"	public static void main(String[] args) {\n" + 
1757
			"		X<String> x = new X<>();\n" + 
1758
			"		x.testFunction(\"SUCCESS\");\n" + 
1759
			"	}\n" +
1760
			"	public void testFunction(T param){\n" +
1761
			"		System.out.println(param);\n" +
1762
			"	}\n" + 
1763
			"}",
1764
		},
1765
		"----------\n" + 
1766
		"1. ERROR in X.java (at line 3)\n" + 
1767
		"	X<String> x = new X<>();\n" + 
1768
		"	                  ^\n" + 
1769
		"Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" + 
1770
		"----------\n");
1771
}
1772
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339478
1773
// To verify that diamond construct is not allowed in source level 1.6 or below
1774
public void test339478b() {
1775
	this.runNegativeTest(
1776
		new String[] {
1777
			"X.java",
1778
			"public class X<T> {\n" +
1779
			"	public static void main(String[] args) {\n" + 
1780
			"		X<> x1 = null;\n" +
1781
			"	}\n" +
1782
			"}",
1783
		},
1784
		"----------\n" + 
1785
		"1. ERROR in X.java (at line 3)\n" + 
1786
		"	X<> x1 = null;\n" + 
1787
		"	^\n" + 
1788
		"Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" + 
1789
		"----------\n");
1790
}
1791
public void test339478c() {
1792
	this.runNegativeTest(
1793
		new String[] {
1794
			"X.java",
1795
			"import java.util.Map;\n" +
1796
			"public class X implements Map<> {\n" +
1797
			"    static Map<> foo (Map<> x) { \n" +
1798
			"        return null;\n" +
1799
			"    }\n" +
1800
			"}\n",
1801
		},
1802
		"----------\n" + 
1803
		"1. ERROR in X.java (at line 2)\n" + 
1804
		"	public class X implements Map<> {\n" + 
1805
		"	                          ^^^\n" + 
1806
		"Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" + 
1807
		"----------\n" + 
1808
		"2. ERROR in X.java (at line 3)\n" + 
1809
		"	static Map<> foo (Map<> x) { \n" + 
1810
		"	       ^^^\n" + 
1811
		"Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" + 
1812
		"----------\n" + 
1813
		"3. ERROR in X.java (at line 3)\n" + 
1814
		"	static Map<> foo (Map<> x) { \n" + 
1815
		"	                  ^^^\n" + 
1816
		"Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" + 
1817
		"----------\n");
1818
}
1819
public void test339478d() {
1820
	this.runNegativeTest(
1821
		new String[] {
1822
			"X.java",
1823
			"import java.util.Map;\n" +
1824
			"public class X  {\n" +
1825
			"    static Map<> foo () { \n" +
1826
			"        return null;\n" +
1827
			"    }\n" +
1828
			"}\n",
1829
		},
1830
		"----------\n" + 
1831
		"1. ERROR in X.java (at line 3)\n" + 
1832
		"	static Map<> foo () { \n" + 
1833
		"	       ^^^\n" + 
1834
		"Incorrect number of arguments for type Map<K,V>; it cannot be parameterized with arguments <>\n" + 
1835
		"----------\n");
1836
}
1837
public void test339478e() {
1838
	this.runNegativeTest(
1839
		new String[] {
1840
			"X.java",
1841
			"public class X<T>  {\n" +
1842
			"    class Y<K> {\n" +
1843
			"    }\n" +
1844
			"    public static void main(String [] args) {\n" +
1845
			"        X<String>.Y<> [] y = null; \n" +
1846
			"    }\n" +
1847
			"}\n",
1848
		},
1849
		"----------\n" + 
1850
		"1. ERROR in X.java (at line 5)\n" + 
1851
		"	X<String>.Y<> [] y = null; \n" + 
1852
		"	^^^^^^^^^^^\n" + 
1853
		"Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" + 
1854
		"----------\n");
1855
}
1856
public void test339478f() {
1857
	this.runNegativeTest(
1858
		new String[] {
1859
			"X.java",
1860
			"public class X<T>  {\n" +
1861
			"    class Y<K> {\n" +
1862
			"    }\n" +
1863
			"    public static void main(String [] args) {\n" +
1864
			"        X<String>.Y<>  y = null; \n" +
1865
			"    }\n" +
1866
			"}\n",
1867
		},
1868
		"----------\n" + 
1869
		"1. ERROR in X.java (at line 5)\n" + 
1870
		"	X<String>.Y<>  y = null; \n" + 
1871
		"	^^^^^^^^^^^\n" + 
1872
		"Incorrect number of arguments for type X<String>.Y; it cannot be parameterized with arguments <>\n" + 
1873
		"----------\n");
1874
}
1875
public void test339478g() {
1876
	this.runNegativeTest(
1877
		new String[] {
1878
			"X.java",
1879
			"public class X<T>  {\n" +
1880
			"    public void foo(Object x) {\n" +
1881
			"        if (x instanceof X<>) {    \n" +
1882
			"        }\n" +
1883
			"    }\n" +
1884
			"}\n",
1885
		},
1886
		"----------\n" + 
1887
		"1. ERROR in X.java (at line 3)\n" + 
1888
		"	if (x instanceof X<>) {    \n" + 
1889
		"	                 ^\n" + 
1890
		"Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" + 
1891
		"----------\n");
1892
}
1893
public void test339478h() {
1894
	this.runNegativeTest(
1895
		new String[] {
1896
			"X.java",
1897
			"public class X<T>  {\n" +
1898
			"    public void foo(Object x) throws X.Y<>.LException {\n" +
1899
			"    }\n" +
1900
			"    static class Y<T> {\n" +
1901
			"    static class LException extends Throwable {}\n" +
1902
			"    }\n" +
1903
			"}\n",
1904
		},
1905
		"----------\n" + 
1906
		"1. ERROR in X.java (at line 2)\n" + 
1907
		"	public void foo(Object x) throws X.Y<>.LException {\n" + 
1908
		"	                                 ^^^\n" + 
1909
		"Incorrect number of arguments for type X.Y; it cannot be parameterized with arguments <>\n" + 
1910
		"----------\n" + 
1911
		"2. WARNING in X.java (at line 5)\n" + 
1912
		"	static class LException extends Throwable {}\n" + 
1913
		"	             ^^^^^^^^^^\n" + 
1914
		"The serializable class LException does not declare a static final serialVersionUID field of type long\n" + 
1915
		"----------\n");
1916
}
1917
public void test339478i() {
1918
	this.runNegativeTest(
1919
		new String[] {
1920
			"X.java",
1921
			"public class X<T>  {\n" +
1922
			"    public void foo () {\n" +
1923
			"        Object o = new X<> [10];\n" +
1924
			"    }\n" +
1925
			"}\n",
1926
		},
1927
		"----------\n" + 
1928
		"1. ERROR in X.java (at line 3)\n" + 
1929
		"	Object o = new X<> [10];\n" + 
1930
		"	               ^\n" + 
1931
		"Incorrect number of arguments for type X<T>; it cannot be parameterized with arguments <>\n" + 
1932
		"----------\n");
1933
}
1743
}
1934
}

Return to bug 339478