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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (-7 / +2 lines)
Lines 265-275 Link Here
265
	public long originalComplianceLevel;
265
	public long originalComplianceLevel;
266
	/** Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
266
	/** Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
267
	public long sourceLevel;
267
	public long sourceLevel;
268
	/** Original Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} 
269
	 *  Usually same as the field sourceLevel, though the latter could deviate to create temporary sandbox
270
	 *  modes during reconcile operations. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=323633
271
	 * */
272
	public long originalSourceLevel;
273
	/** VM target level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
268
	/** VM target level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
274
	public long targetJDK;
269
	public long targetJDK;
275
	/** Source encoding format */
270
	/** Source encoding format */
Lines 964-970 Link Here
964
		// by default only lines and source attributes are generated.
959
		// by default only lines and source attributes are generated.
965
		this.produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
960
		this.produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
966
		this.complianceLevel = this.originalComplianceLevel = ClassFileConstants.JDK1_4; // by default be compliant with 1.4
961
		this.complianceLevel = this.originalComplianceLevel = ClassFileConstants.JDK1_4; // by default be compliant with 1.4
967
		this.sourceLevel = this.originalSourceLevel = ClassFileConstants.JDK1_3; //1.3 source behavior by default
962
		this.sourceLevel = ClassFileConstants.JDK1_3; //1.3 source behavior by default
968
		this.targetJDK = ClassFileConstants.JDK1_2; // default generates for JVM1.2
963
		this.targetJDK = ClassFileConstants.JDK1_2; // default generates for JVM1.2
969
964
970
		this.defaultEncoding = null; // will use the platform default encoding
965
		this.defaultEncoding = null; // will use the platform default encoding
Lines 1131-1137 Link Here
1131
		}
1126
		}
1132
		if ((optionValue = optionsMap.get(OPTION_Source)) != null) {
1127
		if ((optionValue = optionsMap.get(OPTION_Source)) != null) {
1133
			long level = versionToJdkLevel(optionValue);
1128
			long level = versionToJdkLevel(optionValue);
1134
			if (level != 0) this.sourceLevel = this.originalSourceLevel = level;
1129
			if (level != 0) this.sourceLevel = level;
1135
		}
1130
		}
1136
		if ((optionValue = optionsMap.get(OPTION_TargetPlatform)) != null) {
1131
		if ((optionValue = optionsMap.get(OPTION_TargetPlatform)) != null) {
1137
			long level = versionToJdkLevel(optionValue);
1132
			long level = versionToJdkLevel(optionValue);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (-9 / +8 lines)
Lines 149-155 Link Here
149
	this.fPackage = packageBinding;
149
	this.fPackage = packageBinding;
150
	this.fileName = binaryType.getFileName();
150
	this.fileName = binaryType.getFileName();
151
151
152
	char[] typeSignature = environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5 ? binaryType.getGenericSignature() : null;
152
	// Unconditionally internalize generics see https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
153
	char[] typeSignature = binaryType.getGenericSignature();
153
	this.typeVariables = typeSignature != null && typeSignature.length > 0 && typeSignature[0] == '<'
154
	this.typeVariables = typeSignature != null && typeSignature.length > 0 && typeSignature[0] == '<'
154
		? null // is initialized in cachePartsFrom (called from LookupEnvironment.createBinaryTypeFrom())... must set to null so isGenericType() answers true
155
		? null // is initialized in cachePartsFrom (called from LookupEnvironment.createBinaryTypeFrom())... must set to null so isGenericType() answers true
155
		: Binding.NO_TYPE_VARIABLES;
156
		: Binding.NO_TYPE_VARIABLES;
Lines 260-271 Link Here
260
			}
261
			}
261
		}
262
		}
262
263
263
		long sourceLevel = this.environment.globalOptions.originalSourceLevel;
264
		long sourceLevel = this.environment.globalOptions.sourceLevel;
264
		char[] typeSignature = null;
265
		char[] typeSignature = binaryType.getGenericSignature();
265
		if (sourceLevel >= ClassFileConstants.JDK1_5) {
266
		this.tagBits |= binaryType.getTagBits();
266
			typeSignature = binaryType.getGenericSignature();
267
		
267
			this.tagBits |= binaryType.getTagBits();
268
		}
269
		char[][][] missingTypeNames = binaryType.getMissingTypeNames();
268
		char[][][] missingTypeNames = binaryType.getMissingTypeNames();
270
		if (typeSignature == null) {
269
		if (typeSignature == null) {
271
			char[] superclassName = binaryType.getSuperclassName();
270
			char[] superclassName = binaryType.getSuperclassName();
Lines 360-366 Link Here
360
		int size = iFields.length;
359
		int size = iFields.length;
361
		if (size > 0) {
360
		if (size > 0) {
362
			this.fields = new FieldBinding[size];
361
			this.fields = new FieldBinding[size];
363
			boolean use15specifics = sourceLevel >= ClassFileConstants.JDK1_5;
362
			boolean use15specifics = true;
364
			boolean hasRestrictedAccess = hasRestrictedAccess();
363
			boolean hasRestrictedAccess = hasRestrictedAccess();
365
			int firstAnnotatedFieldIndex = -1;
364
			int firstAnnotatedFieldIndex = -1;
366
			for (int i = 0; i < size; i++) {
365
			for (int i = 0; i < size; i++) {
Lines 411-417 Link Here
411
	AnnotationBinding[][] paramAnnotations = null;
410
	AnnotationBinding[][] paramAnnotations = null;
412
	TypeBinding returnType = null;
411
	TypeBinding returnType = null;
413
412
414
	final boolean use15specifics = sourceLevel >= ClassFileConstants.JDK1_5;
413
	final boolean use15specifics = true;
415
	char[] methodSignature = use15specifics ? method.getGenericSignature() : null;
414
	char[] methodSignature = use15specifics ? method.getGenericSignature() : null;
416
	if (methodSignature == null) { // no generics
415
	if (methodSignature == null) { // no generics
417
		char[] methodDescriptor = method.getMethodDescriptor();   // of the form (I[Ljava/jang/String;)V
416
		char[] methodDescriptor = method.getMethodDescriptor();   // of the form (I[Ljava/jang/String;)V
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (-2 / +2 lines)
Lines 385-392 Link Here
385
	    SourceTypeBinding sourceType = this.referenceContext.binding;
385
	    SourceTypeBinding sourceType = this.referenceContext.binding;
386
		TypeParameter[] typeParameters = this.referenceContext.typeParameters;
386
		TypeParameter[] typeParameters = this.referenceContext.typeParameters;
387
387
388
	    // do not construct type variables if source < 1.5
388
		// If type parameters exist at all, unconditionally internalize them. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
389
		if (typeParameters == null || compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) {
389
		if (typeParameters == null || typeParameters.length == 0) {
390
		    sourceType.typeVariables = Binding.NO_TYPE_VARIABLES;
390
		    sourceType.typeVariables = Binding.NO_TYPE_VARIABLES;
391
		    return;
391
		    return;
392
		}
392
		}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java (-3 / +2 lines)
Lines 1322-1330 Link Here
1322
}
1322
}
1323
1323
1324
public MethodVerifier newMethodVerifier() {
1324
public MethodVerifier newMethodVerifier() {
1325
	return this.globalOptions.sourceLevel < ClassFileConstants.JDK1_5
1325
	// Always use MethodVerifier15, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
1326
		? new MethodVerifier(this)
1326
	return new MethodVerifier15(this);
1327
		: new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5
1328
}
1327
}
1329
1328
1330
public void releaseClassFiles(org.eclipse.jdt.internal.compiler.ClassFile[] classFiles) {
1329
public void releaseClassFiles(org.eclipse.jdt.internal.compiler.ClassFile[] classFiles) {
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java (-2 / +2 lines)
Lines 329-336 Link Here
329
	}
329
	}
330
330
331
	TypeParameter[] typeParameters = method.typeParameters();
331
	TypeParameter[] typeParameters = method.typeParameters();
332
    // do not construct type variables if source < 1.5
332
	// If type parameters exist at all, unconditionally internalize them. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
333
	if (typeParameters == null || compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) {
333
	if (typeParameters == null || typeParameters.length == 0) {
334
	    method.binding.typeVariables = Binding.NO_TYPE_VARIABLES;
334
	    method.binding.typeVariables = Binding.NO_TYPE_VARIABLES;
335
	} else {
335
	} else {
336
		method.binding.typeVariables = createTypeVariables(typeParameters, method.binding);
336
		method.binding.typeVariables = createTypeVariables(typeParameters, method.binding);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (-1 / +6 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.internal.compiler.lookup;
11
package org.eclipse.jdt.internal.compiler.lookup;
12
12
13
import org.eclipse.jdt.internal.compiler.ast.TypeParameter;
13
import org.eclipse.jdt.internal.compiler.ast.TypeParameter;
14
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
14
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
15
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
15
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
16
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
16
17
Lines 80-86 Link Here
80
}
81
}
81
boolean areReturnTypesCompatible(MethodBinding one, MethodBinding two) {
82
boolean areReturnTypesCompatible(MethodBinding one, MethodBinding two) {
82
	if (one.returnType == two.returnType) return true;
83
	if (one.returnType == two.returnType) return true;
83
	return areReturnTypesCompatible0(one, two);
84
	if (this.type.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
85
		return areReturnTypesCompatible0(one, two);
86
	} else {
87
		return areTypesEqual(one.returnType.erasure(), two.returnType.erasure());
88
	}
84
}
89
}
85
boolean areTypesEqual(TypeBinding one, TypeBinding two) {
90
boolean areTypesEqual(TypeBinding one, TypeBinding two) {
86
	if (one == two) return true;
91
	if (one == two) return true;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-2 / +2 lines)
Lines 704-711 Link Here
704
	}
704
	}
705
705
706
	public TypeVariableBinding[] createTypeVariables(TypeParameter[] typeParameters, Binding declaringElement) {
706
	public TypeVariableBinding[] createTypeVariables(TypeParameter[] typeParameters, Binding declaringElement) {
707
		// do not construct type variables if source < 1.5
707
		// If type parameters exist at all, unconditionally internalize them, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
708
		if (typeParameters == null || compilerOptions().sourceLevel < ClassFileConstants.JDK1_5)
708
		if (typeParameters == null || typeParameters.length == 0)
709
			return Binding.NO_TYPE_VARIABLES;
709
			return Binding.NO_TYPE_VARIABLES;
710
710
711
		PackageBinding unitPackage = compilationUnitScope().fPackage;
711
		PackageBinding unitPackage = compilationUnitScope().fPackage;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (-1 / +1 lines)
Lines 822-828 Link Here
822
			boolean hasMultiLines = this.scanner.currentPosition > (this.lineEnd+1);
822
			boolean hasMultiLines = this.scanner.currentPosition > (this.lineEnd+1);
823
			boolean isTypeParam = false;
823
			boolean isTypeParam = false;
824
			boolean valid = true, empty = true;
824
			boolean valid = true, empty = true;
825
			boolean mayBeGeneric = this.sourceLevel >= ClassFileConstants.JDK1_5;
825
			boolean mayBeGeneric = true; // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850
826
			int token = -1;
826
			int token = -1;
827
			nextToken: while (true) {
827
			nextToken: while (true) {
828
				this.currentTokenType = -1;
828
				this.currentTokenType = -1;
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (+3 lines)
Lines 7082-7087 Link Here
7082
    }
7082
    }
7083
}
7083
}
7084
public void unsafeReturnTypeOverride(MethodBinding currentMethod, MethodBinding inheritedMethod, SourceTypeBinding type) {
7084
public void unsafeReturnTypeOverride(MethodBinding currentMethod, MethodBinding inheritedMethod, SourceTypeBinding type) {
7085
	if (this.options.sourceLevel < ClassFileConstants.JDK1_5) {
7086
		return;
7087
	}
7085
	int severity = computeSeverity(IProblem.UnsafeReturnTypeOverride);
7088
	int severity = computeSeverity(IProblem.UnsafeReturnTypeOverride);
7086
	if (severity == ProblemSeverities.Ignore) return;
7089
	if (severity == ProblemSeverities.Ignore) return;
7087
	int start = type.sourceStart();
7090
	int start = type.sourceStart();
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java (-85 / +15 lines)
Lines 1521-1527 Link Here
1521
			"5. ERROR in X.java (at line 14)\n" +
1521
			"5. ERROR in X.java (at line 14)\n" +
1522
			"	*  {@link ComparableUtils#compareTo(Object, Object)}.\n" +
1522
			"	*  {@link ComparableUtils#compareTo(Object, Object)}.\n" +
1523
			"	                          ^^^^^^^^^\n" +
1523
			"	                          ^^^^^^^^^\n" +
1524
			"Javadoc: The method compareTo(Object, Object, Class) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
1524
			"Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
1525
			"----------\n");
1525
			"----------\n");
1526
	}
1526
	}
1527
1527
Lines 3278-3332 Link Here
3278
			"----------\n" +
3278
			"----------\n" +
3279
			"3. ERROR in test\\X.java (at line 8)\n" +
3279
			"3. ERROR in test\\X.java (at line 8)\n" +
3280
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
3280
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
3281
			"	             ^\n" +
3282
			"T cannot be resolved to a type\n" +
3283
			"----------\n" +
3284
			"4. ERROR in test\\X.java (at line 8)\n" +
3285
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
3286
			"	                          ^\n" +
3281
			"	                          ^\n" +
3287
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3282
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3288
			"----------\n" +
3283
			"----------\n" +
3289
			"5. ERROR in test\\X.java (at line 8)\n" +
3284
			"4. ERROR in test\\X.java (at line 19)\n" +
3290
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
3291
			"	                          ^\n" +
3292
			"T cannot be resolved to a type\n" +
3293
			"----------\n" +
3294
			"6. ERROR in test\\X.java (at line 15)\n" +
3295
			"	* @param <T>\n" +
3296
			"	         ^^^\n" +
3297
			"Javadoc: Invalid param tag name\n" +
3298
			"----------\n" +
3299
			"7. ERROR in test\\X.java (at line 19)\n" +
3300
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3285
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3301
			"	        ^^^^^^^^^^^^^^^^\n" +
3286
			"	        ^^^^^^^^^^^^^^^^\n" +
3302
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3287
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3303
			"----------\n" +
3288
			"----------\n" +
3304
			"8. ERROR in test\\X.java (at line 19)\n" +
3289
			"5. ERROR in test\\X.java (at line 19)\n" +
3305
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3290
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3306
			"	                            ^\n" +
3291
			"	                            ^\n" +
3307
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3292
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3308
			"----------\n" +
3293
			"----------\n" +
3309
			"9. ERROR in test\\X.java (at line 19)\n" +
3294
			"6. ERROR in test\\X.java (at line 19)\n" +
3310
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3311
			"	                            ^\n" +
3312
			"T cannot be resolved to a type\n" +
3313
			"----------\n" +
3314
			"10. ERROR in test\\X.java (at line 19)\n" +
3315
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3295
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3316
			"	                                         ^\n" +
3296
			"	                                         ^\n" +
3317
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3297
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3318
			"----------\n" +
3298
			"----------\n" +
3319
			"11. ERROR in test\\X.java (at line 19)\n" +
3299
			"7. ERROR in test\\X.java (at line 24)\n" +
3320
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
3321
			"	                                         ^\n" +
3322
			"T cannot be resolved to a type\n" +
3323
			"----------\n" +
3324
			"12. ERROR in test\\X.java (at line 22)\n" +
3325
			"	* @param <T>\n" +
3326
			"	         ^^^\n" +
3327
			"Javadoc: Invalid param tag name\n" +
3328
			"----------\n" +
3329
			"13. ERROR in test\\X.java (at line 24)\n" +
3330
			"	class G<T> {}\n" +
3300
			"	class G<T> {}\n" +
3331
			"	        ^\n" +
3301
			"	        ^\n" +
3332
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3302
			"Syntax error, type parameters are only available if source level is 1.5\n" +
Lines 3373-3467 Link Here
3373
				"}\n"
3343
				"}\n"
3374
			},
3344
			},
3375
			"----------\n" +
3345
			"----------\n" +
3376
			"1. ERROR in test\\X.java (at line 6)\n" +
3346
			"1. ERROR in test\\X.java (at line 9)\n" +
3377
			"	* @param <T>\n" +
3378
			"	         ^^^\n" +
3379
			"Javadoc: Invalid param tag name\n" +
3380
			"----------\n" +
3381
			"2. ERROR in test\\X.java (at line 9)\n" +
3382
			"	public <T> X(Class<T> classT) {\n" +
3347
			"	public <T> X(Class<T> classT) {\n" +
3383
			"	        ^\n" +
3348
			"	        ^\n" +
3384
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3349
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3385
			"----------\n" +
3350
			"----------\n" +
3386
			"3. ERROR in test\\X.java (at line 9)\n" +
3351
			"2. ERROR in test\\X.java (at line 9)\n" +
3387
			"	public <T> X(Class<T> classT) {\n" +
3352
			"	public <T> X(Class<T> classT) {\n" +
3388
			"	                   ^\n" +
3353
			"	                   ^\n" +
3389
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3354
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3390
			"----------\n" +
3355
			"----------\n" +
3391
			"4. ERROR in test\\X.java (at line 9)\n" +
3356
			"3. ERROR in test\\X.java (at line 16)\n" +
3392
			"	public <T> X(Class<T> classT) {\n" +
3393
			"	                   ^\n" +
3394
			"T cannot be resolved to a type\n" +
3395
			"----------\n" +
3396
			"5. ERROR in test\\X.java (at line 12)\n" +
3397
			"	* @param <T>\n" +
3398
			"	         ^^^\n" +
3399
			"Javadoc: Invalid param tag name\n" +
3400
			"----------\n" +
3401
			"6. ERROR in test\\X.java (at line 16)\n" +
3402
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3357
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3403
			"	        ^\n" +
3358
			"	        ^\n" +
3404
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3359
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3405
			"----------\n" +
3360
			"----------\n" +
3406
			"7. ERROR in test\\X.java (at line 16)\n" +
3361
			"4. ERROR in test\\X.java (at line 16)\n" +
3407
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3362
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3408
			"	                 ^\n" +
3363
			"	                 ^\n" +
3409
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3364
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3410
			"----------\n" +
3365
			"----------\n" +
3411
			"8. ERROR in test\\X.java (at line 16)\n" +
3366
			"5. ERROR in test\\X.java (at line 16)\n" +
3412
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3413
			"	                 ^\n" +
3414
			"T cannot be resolved to a type\n" +
3415
			"----------\n" +
3416
			"9. ERROR in test\\X.java (at line 16)\n" +
3417
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3367
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3418
			"	                              ^\n" +
3368
			"	                              ^\n" +
3419
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3369
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3420
			"----------\n" +
3370
			"----------\n" +
3421
			"10. ERROR in test\\X.java (at line 16)\n" +
3371
			"6. ERROR in test\\X.java (at line 25)\n" +
3422
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
3423
			"	                              ^\n" +
3424
			"T cannot be resolved to a type\n" +
3425
			"----------\n" +
3426
			"11. ERROR in test\\X.java (at line 25)\n" +
3427
			"	public <T> Y(Class<T> classT) {\n" +
3372
			"	public <T> Y(Class<T> classT) {\n" +
3428
			"	        ^\n" +
3373
			"	        ^\n" +
3429
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3374
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3430
			"----------\n" +
3375
			"----------\n" +
3431
			"12. ERROR in test\\X.java (at line 25)\n" +
3376
			"7. ERROR in test\\X.java (at line 25)\n" +
3432
			"	public <T> Y(Class<T> classT) {\n" +
3377
			"	public <T> Y(Class<T> classT) {\n" +
3433
			"	                   ^\n" +
3378
			"	                   ^\n" +
3434
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3379
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3435
			"----------\n" +
3380
			"----------\n" +
3436
			"13. ERROR in test\\X.java (at line 25)\n" +
3381
			"8. ERROR in test\\X.java (at line 32)\n" +
3437
			"	public <T> Y(Class<T> classT) {\n" +
3438
			"	                   ^\n" +
3439
			"T cannot be resolved to a type\n" +
3440
			"----------\n" +
3441
			"14. ERROR in test\\X.java (at line 32)\n" +
3442
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3382
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3443
			"	        ^^^^^^^^^^^^^^^^\n" +
3383
			"	        ^^^^^^^^^^^^^^^^\n" +
3444
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3384
			"Syntax error, type parameters are only available if source level is 1.5\n" +
3445
			"----------\n" +
3385
			"----------\n" +
3446
			"15. ERROR in test\\X.java (at line 32)\n" +
3386
			"9. ERROR in test\\X.java (at line 32)\n" +
3447
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3387
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3448
			"	                                ^\n" +
3388
			"	                                ^\n" +
3449
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3389
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3450
			"----------\n" +
3390
			"----------\n" +
3451
			"16. ERROR in test\\X.java (at line 32)\n" +
3391
			"10. ERROR in test\\X.java (at line 32)\n" +
3452
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3453
			"	                                ^\n" +
3454
			"T cannot be resolved to a type\n" +
3455
			"----------\n" +
3456
			"17. ERROR in test\\X.java (at line 32)\n" +
3457
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3392
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3458
			"	                                             ^\n" +
3393
			"	                                             ^\n" +
3459
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3394
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
3460
			"----------\n" +
3461
			"18. ERROR in test\\X.java (at line 32)\n" +
3462
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
3463
			"	                                             ^\n" +
3464
			"T cannot be resolved to a type\n" +
3465
			"----------\n");
3395
			"----------\n");
3466
	}
3396
	}
3467
3397
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java (-85 / +15 lines)
Lines 1521-1527 Link Here
1521
			"5. ERROR in X.java (at line 14)\n" +
1521
			"5. ERROR in X.java (at line 14)\n" +
1522
			"	*  {@link ComparableUtils#compareTo(Object, Object)}.\n" +
1522
			"	*  {@link ComparableUtils#compareTo(Object, Object)}.\n" +
1523
			"	                          ^^^^^^^^^\n" +
1523
			"	                          ^^^^^^^^^\n" +
1524
			"Javadoc: The method compareTo(Object, Object, Class) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
1524
			"Javadoc: The method compareTo(Object, Object, Class<T>) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
1525
			"----------\n");
1525
			"----------\n");
1526
	}
1526
	}
1527
1527
Lines 2722-2776 Link Here
2722
			"----------\n" +
2722
			"----------\n" +
2723
			"3. ERROR in test\\X.java (at line 8)\n" +
2723
			"3. ERROR in test\\X.java (at line 8)\n" +
2724
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
2724
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
2725
			"	             ^\n" +
2726
			"T cannot be resolved to a type\n" +
2727
			"----------\n" +
2728
			"4. ERROR in test\\X.java (at line 8)\n" +
2729
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
2730
			"	                          ^\n" +
2725
			"	                          ^\n" +
2731
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2726
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2732
			"----------\n" +
2727
			"----------\n" +
2733
			"5. ERROR in test\\X.java (at line 8)\n" +
2728
			"4. ERROR in test\\X.java (at line 19)\n" +
2734
			"	public <T> G<T> foo(Class<T> stuffClass) {\n" +
2735
			"	                          ^\n" +
2736
			"T cannot be resolved to a type\n" +
2737
			"----------\n" +
2738
			"6. ERROR in test\\X.java (at line 15)\n" +
2739
			"	* @param <T>\n" +
2740
			"	         ^^^\n" +
2741
			"Javadoc: Invalid param tag name\n" +
2742
			"----------\n" +
2743
			"7. ERROR in test\\X.java (at line 19)\n" +
2744
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2729
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2745
			"	        ^^^^^^^^^^^^^^^^\n" +
2730
			"	        ^^^^^^^^^^^^^^^^\n" +
2746
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2731
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2747
			"----------\n" +
2732
			"----------\n" +
2748
			"8. ERROR in test\\X.java (at line 19)\n" +
2733
			"5. ERROR in test\\X.java (at line 19)\n" +
2749
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2734
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2750
			"	                            ^\n" +
2735
			"	                            ^\n" +
2751
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2736
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2752
			"----------\n" +
2737
			"----------\n" +
2753
			"9. ERROR in test\\X.java (at line 19)\n" +
2738
			"6. ERROR in test\\X.java (at line 19)\n" +
2754
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2755
			"	                            ^\n" +
2756
			"T cannot be resolved to a type\n" +
2757
			"----------\n" +
2758
			"10. ERROR in test\\X.java (at line 19)\n" +
2759
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2739
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2760
			"	                                         ^\n" +
2740
			"	                                         ^\n" +
2761
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2741
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2762
			"----------\n" +
2742
			"----------\n" +
2763
			"11. ERROR in test\\X.java (at line 19)\n" +
2743
			"7. ERROR in test\\X.java (at line 24)\n" +
2764
			"	public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
2765
			"	                                         ^\n" +
2766
			"T cannot be resolved to a type\n" +
2767
			"----------\n" +
2768
			"12. ERROR in test\\X.java (at line 22)\n" +
2769
			"	* @param <T>\n" +
2770
			"	         ^^^\n" +
2771
			"Javadoc: Invalid param tag name\n" +
2772
			"----------\n" +
2773
			"13. ERROR in test\\X.java (at line 24)\n" +
2774
			"	class G<T> {}\n" +
2744
			"	class G<T> {}\n" +
2775
			"	        ^\n" +
2745
			"	        ^\n" +
2776
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2746
			"Syntax error, type parameters are only available if source level is 1.5\n" +
Lines 2818-2912 Link Here
2818
				"}\n"
2788
				"}\n"
2819
			},
2789
			},
2820
			"----------\n" +
2790
			"----------\n" +
2821
			"1. ERROR in test\\X.java (at line 6)\n" +
2791
			"1. ERROR in test\\X.java (at line 9)\n" +
2822
			"	* @param <T>\n" +
2823
			"	         ^^^\n" +
2824
			"Javadoc: Invalid param tag name\n" +
2825
			"----------\n" +
2826
			"2. ERROR in test\\X.java (at line 9)\n" +
2827
			"	public <T> X(Class<T> classT) {\n" +
2792
			"	public <T> X(Class<T> classT) {\n" +
2828
			"	        ^\n" +
2793
			"	        ^\n" +
2829
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2794
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2830
			"----------\n" +
2795
			"----------\n" +
2831
			"3. ERROR in test\\X.java (at line 9)\n" +
2796
			"2. ERROR in test\\X.java (at line 9)\n" +
2832
			"	public <T> X(Class<T> classT) {\n" +
2797
			"	public <T> X(Class<T> classT) {\n" +
2833
			"	                   ^\n" +
2798
			"	                   ^\n" +
2834
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2799
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2835
			"----------\n" +
2800
			"----------\n" +
2836
			"4. ERROR in test\\X.java (at line 9)\n" +
2801
			"3. ERROR in test\\X.java (at line 16)\n" +
2837
			"	public <T> X(Class<T> classT) {\n" +
2838
			"	                   ^\n" +
2839
			"T cannot be resolved to a type\n" +
2840
			"----------\n" +
2841
			"5. ERROR in test\\X.java (at line 12)\n" +
2842
			"	* @param <T>\n" +
2843
			"	         ^^^\n" +
2844
			"Javadoc: Invalid param tag name\n" +
2845
			"----------\n" +
2846
			"6. ERROR in test\\X.java (at line 16)\n" +
2847
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2802
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2848
			"	        ^\n" +
2803
			"	        ^\n" +
2849
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2804
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2850
			"----------\n" +
2805
			"----------\n" +
2851
			"7. ERROR in test\\X.java (at line 16)\n" +
2806
			"4. ERROR in test\\X.java (at line 16)\n" +
2852
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2807
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2853
			"	                 ^\n" +
2808
			"	                 ^\n" +
2854
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2809
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2855
			"----------\n" +
2810
			"----------\n" +
2856
			"8. ERROR in test\\X.java (at line 16)\n" +
2811
			"5. ERROR in test\\X.java (at line 16)\n" +
2857
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2858
			"	                 ^\n" +
2859
			"T cannot be resolved to a type\n" +
2860
			"----------\n" +
2861
			"9. ERROR in test\\X.java (at line 16)\n" +
2862
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2812
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2863
			"	                              ^\n" +
2813
			"	                              ^\n" +
2864
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2814
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2865
			"----------\n" +
2815
			"----------\n" +
2866
			"10. ERROR in test\\X.java (at line 16)\n" +
2816
			"6. ERROR in test\\X.java (at line 25)\n" +
2867
			"	public <T> Class<T> foo(Class<T> classT) {\n" +
2868
			"	                              ^\n" +
2869
			"T cannot be resolved to a type\n" +
2870
			"----------\n" +
2871
			"11. ERROR in test\\X.java (at line 25)\n" +
2872
			"	public <T> Y(Class<T> classT) {\n" +
2817
			"	public <T> Y(Class<T> classT) {\n" +
2873
			"	        ^\n" +
2818
			"	        ^\n" +
2874
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2819
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2875
			"----------\n" +
2820
			"----------\n" +
2876
			"12. ERROR in test\\X.java (at line 25)\n" +
2821
			"7. ERROR in test\\X.java (at line 25)\n" +
2877
			"	public <T> Y(Class<T> classT) {\n" +
2822
			"	public <T> Y(Class<T> classT) {\n" +
2878
			"	                   ^\n" +
2823
			"	                   ^\n" +
2879
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2824
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2880
			"----------\n" +
2825
			"----------\n" +
2881
			"13. ERROR in test\\X.java (at line 25)\n" +
2826
			"8. ERROR in test\\X.java (at line 32)\n" +
2882
			"	public <T> Y(Class<T> classT) {\n" +
2883
			"	                   ^\n" +
2884
			"T cannot be resolved to a type\n" +
2885
			"----------\n" +
2886
			"14. ERROR in test\\X.java (at line 32)\n" +
2887
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2827
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2888
			"	        ^^^^^^^^^^^^^^^^\n" +
2828
			"	        ^^^^^^^^^^^^^^^^\n" +
2889
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2829
			"Syntax error, type parameters are only available if source level is 1.5\n" +
2890
			"----------\n" +
2830
			"----------\n" +
2891
			"15. ERROR in test\\X.java (at line 32)\n" +
2831
			"9. ERROR in test\\X.java (at line 32)\n" +
2892
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2832
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2893
			"	                                ^\n" +
2833
			"	                                ^\n" +
2894
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2834
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2895
			"----------\n" +
2835
			"----------\n" +
2896
			"16. ERROR in test\\X.java (at line 32)\n" +
2836
			"10. ERROR in test\\X.java (at line 32)\n" +
2897
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2898
			"	                                ^\n" +
2899
			"T cannot be resolved to a type\n" +
2900
			"----------\n" +
2901
			"17. ERROR in test\\X.java (at line 32)\n" +
2902
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2837
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2903
			"	                                             ^\n" +
2838
			"	                                             ^\n" +
2904
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2839
			"Syntax error, parameterized types are only available if source level is 1.5\n" +
2905
			"----------\n" +
2906
			"18. ERROR in test\\X.java (at line 32)\n" +
2907
			"	public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
2908
			"	                                             ^\n" +
2909
			"T cannot be resolved to a type\n" +
2910
			"----------\n"
2840
			"----------\n"
2911
		);
2841
		);
2912
	}
2842
	}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-1 / +1 lines)
Lines 11011-11017 Link Here
11011
		"----------\n");
11011
		"----------\n");
11012
}
11012
}
11013
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850 
11013
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850 
11014
public void _test213() {
11014
public void test213() {
11015
	Map compilerOptions15 = getCompilerOptions();
11015
	Map compilerOptions15 = getCompilerOptions();
11016
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
11016
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
11017
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
11017
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java (-10 / +15 lines)
Lines 3379-3430 Link Here
3379
				"	^^^^\n" +
3379
				"	^^^^\n" +
3380
				"The method bar1() from the type X refers to the missing type Zork\n" +
3380
				"The method bar1() from the type X refers to the missing type Zork\n" +
3381
				"----------\n" +
3381
				"----------\n" +
3382
				"2. ERROR in X.java (at line 6)\n" +
3382
				"2. ERROR in X.java (at line 5)\n" + 
3383
				"	bar2();\n" + 
3384
				"	^^^^\n" + 
3385
				"The method bar2() from the type X refers to the missing type Zork\n" + 
3386
				"----------\n" + 
3387
				"3. ERROR in X.java (at line 6)\n" +
3383
				"	bar3(null);\n" +
3388
				"	bar3(null);\n" +
3384
				"	^^^^\n" +
3389
				"	^^^^\n" +
3385
				"The method bar3(Zork) from the type X refers to the missing type Zork\n" +
3390
				"The method bar3(Zork) from the type X refers to the missing type Zork\n" +
3386
				"----------\n" +
3391
				"----------\n" +
3387
				"3. ERROR in X.java (at line 7)\n" +
3392
				"4. ERROR in X.java (at line 7)\n" +
3388
				"	bar4(null,null);\n" +
3393
				"	bar4(null,null);\n" +
3389
				"	^^^^\n" +
3394
				"	^^^^\n" +
3390
				"The method bar4(Zork) from the type X refers to the missing type Zork\n" +
3395
				"The method bar4(Zork) from the type X refers to the missing type Zork\n" +
3391
				"----------\n" +
3396
				"----------\n" +
3392
				"4. ERROR in X.java (at line 9)\n" +
3397
				"5. ERROR in X.java (at line 9)\n" +
3393
				"	Zork<String> bar1() {}\n" +
3398
				"	Zork<String> bar1() {}\n" +
3394
				"	^^^^\n" +
3399
				"	^^^^\n" +
3395
				"Zork cannot be resolved to a type\n" +
3400
				"Zork cannot be resolved to a type\n" +
3396
				"----------\n" +
3401
				"----------\n" +
3397
				"5. ERROR in X.java (at line 9)\n" +
3402
				"6. ERROR in X.java (at line 9)\n" +
3398
				"	Zork<String> bar1() {}\n" +
3403
				"	Zork<String> bar1() {}\n" +
3399
				"	     ^^^^^^\n" +
3404
				"	     ^^^^^^\n" +
3400
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3405
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3401
				"----------\n" +
3406
				"----------\n" +
3402
				"6. ERROR in X.java (at line 10)\n" +
3407
				"7. ERROR in X.java (at line 10)\n" +
3403
				"	List<Zork> bar2() {}\n" +
3408
				"	List<Zork> bar2() {}\n" +
3404
				"	     ^^^^\n" +
3409
				"	     ^^^^\n" +
3405
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3410
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3406
				"----------\n" +
3411
				"----------\n" +
3407
				"7. ERROR in X.java (at line 10)\n" +
3412
				"8. ERROR in X.java (at line 10)\n" +
3408
				"	List<Zork> bar2() {}\n" +
3413
				"	List<Zork> bar2() {}\n" +
3409
				"	     ^^^^\n" +
3414
				"	     ^^^^\n" +
3410
				"Zork cannot be resolved to a type\n" +
3415
				"Zork cannot be resolved to a type\n" +
3411
				"----------\n" +
3416
				"----------\n" +
3412
				"8. ERROR in X.java (at line 11)\n" +
3417
				"9. ERROR in X.java (at line 11)\n" +
3413
				"	void bar3(Zork<String> z) {}\n" +
3418
				"	void bar3(Zork<String> z) {}\n" +
3414
				"	          ^^^^\n" +
3419
				"	          ^^^^\n" +
3415
				"Zork cannot be resolved to a type\n" +
3420
				"Zork cannot be resolved to a type\n" +
3416
				"----------\n" +
3421
				"----------\n" +
3417
				"9. ERROR in X.java (at line 11)\n" +
3422
				"10. ERROR in X.java (at line 11)\n" +
3418
				"	void bar3(Zork<String> z) {}\n" +
3423
				"	void bar3(Zork<String> z) {}\n" +
3419
				"	               ^^^^^^\n" +
3424
				"	               ^^^^^^\n" +
3420
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3425
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3421
				"----------\n" +
3426
				"----------\n" +
3422
				"10. ERROR in X.java (at line 12)\n" +
3427
				"11. ERROR in X.java (at line 12)\n" +
3423
				"	void bar4(Zork<String,String> z) {}\n" +
3428
				"	void bar4(Zork<String,String> z) {}\n" +
3424
				"	          ^^^^\n" +
3429
				"	          ^^^^\n" +
3425
				"Zork cannot be resolved to a type\n" +
3430
				"Zork cannot be resolved to a type\n" +
3426
				"----------\n" +
3431
				"----------\n" +
3427
				"11. ERROR in X.java (at line 12)\n" +
3432
				"12. ERROR in X.java (at line 12)\n" +
3428
				"	void bar4(Zork<String,String> z) {}\n" +
3433
				"	void bar4(Zork<String,String> z) {}\n" +
3429
				"	               ^^^^^^^^^^^^^\n" +
3434
				"	               ^^^^^^^^^^^^^\n" +
3430
				"Syntax error, parameterized types are only available if source level is 1.5\n" +
3435
				"Syntax error, parameterized types are only available if source level is 1.5\n" +

Return to bug 324850