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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java (-1 / +5 lines)
Lines 166-173 Link Here
166
	return true;
166
	return true;
167
}
167
}
168
168
169
protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
170
	scope.problemReporter().deprecatedType(type, this, index);
171
}
172
169
protected void reportDeprecatedType(TypeBinding type, Scope scope) {
173
protected void reportDeprecatedType(TypeBinding type, Scope scope) {
170
	scope.problemReporter().deprecatedType(type, this);
174
	scope.problemReporter().deprecatedType(type, this, Integer.MAX_VALUE);
171
}
175
}
172
176
173
protected void reportInvalidType(Scope scope) {
177
protected void reportInvalidType(Scope scope) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java (-1 / +1 lines)
Lines 87-93 Link Here
87
				return null;
87
				return null;
88
			}
88
			}
89
			if (i < last && isTypeUseDeprecated(this.resolvedType, scope)) {
89
			if (i < last && isTypeUseDeprecated(this.resolvedType, scope)) {
90
				reportDeprecatedType(this.resolvedType, scope);
90
				reportDeprecatedType(this.resolvedType, scope, i);
91
			}
91
			}
92
			if (isClassScope)
92
			if (isClassScope)
93
				if (((ClassScope) scope).detectHierarchyCycle(this.resolvedType, this)) // must connect hierarchy to find inherited member types
93
				if (((ClassScope) scope).detectHierarchyCycle(this.resolvedType, this)) // must connect hierarchy to find inherited member types
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java (-1 / +5 lines)
Lines 57-63 Link Here
57
			return null;
57
			return null;
58
		}
58
		}
59
		if (isTypeUseDeprecated(type, scope))
59
		if (isTypeUseDeprecated(type, scope))
60
			reportDeprecatedType(type, scope);
60
			reportDeprecatedType(type, scope, Integer.MAX_VALUE);
61
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
61
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
62
		// raw convert all enclosing types when dealing with Javadoc references
62
		// raw convert all enclosing types when dealing with Javadoc references
63
		if (type.isGenericType() || type.isParameterizedType()) {
63
		if (type.isGenericType() || type.isParameterizedType()) {
Lines 68-73 Link Here
68
	protected void reportDeprecatedType(TypeBinding type, Scope scope) {
68
	protected void reportDeprecatedType(TypeBinding type, Scope scope) {
69
		scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers());
69
		scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers());
70
	}
70
	}
71
	
72
	protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
73
		scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers(), index);
74
	}
71
75
72
	protected void reportInvalidType(Scope scope) {
76
	protected void reportInvalidType(Scope scope) {
73
		scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers());
77
		scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers());
(-)compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java (-1 / +1 lines)
Lines 70-76 Link Here
70
			}
70
			}
71
		}
71
		}
72
		if (isTypeUseDeprecated(memberType, scope))
72
		if (isTypeUseDeprecated(memberType, scope))
73
			scope.problemReporter().deprecatedType(memberType, this);
73
			reportDeprecatedType(memberType, scope);
74
		memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
74
		memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
75
		if (memberType.isRawType()
75
		if (memberType.isRawType()
76
				&& (this.bits & IgnoreRawTypeCheck) == 0
76
				&& (this.bits & IgnoreRawTypeCheck) == 0
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (-4 / +4 lines)
Lines 188-194 Link Here
188
			} else {
188
			} else {
189
				if (typeIsConsistent && currentType.isStatic()
189
				if (typeIsConsistent && currentType.isStatic()
190
						&& (qualifyingType.isParameterizedTypeWithActualArguments() || qualifyingType.isGenericType())) {
190
						&& (qualifyingType.isParameterizedTypeWithActualArguments() || qualifyingType.isGenericType())) {
191
					scope.problemReporter().staticMemberOfParameterizedType(this, scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), null, qualifyingType));
191
					scope.problemReporter().staticMemberOfParameterizedType(this, scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), null, qualifyingType), i);
192
					typeIsConsistent = false;
192
					typeIsConsistent = false;
193
				}
193
				}
194
				ReferenceBinding enclosingType = currentType.enclosingType();
194
				ReferenceBinding enclosingType = currentType.enclosingType();
Lines 245-251 Link Here
245
					}
245
					}
246
					return this.resolvedType;
246
					return this.resolvedType;
247
				} else if (argLength != typeVariables.length) { // check arity
247
				} else if (argLength != typeVariables.length) { // check arity
248
					scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
248
					scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i);
249
					return null;
249
					return null;
250
				}
250
				}
251
				// check parameterizing non-static member type of raw type
251
				// check parameterizing non-static member type of raw type
Lines 271-277 Link Here
271
						return null;
271
						return null;
272
				if (currentOriginal.isGenericType()) {
272
				if (currentOriginal.isGenericType()) {
273
	   			    if (typeIsConsistent && qualifyingType != null && qualifyingType.isParameterizedType()) {
273
	   			    if (typeIsConsistent && qualifyingType != null && qualifyingType.isParameterizedType()) {
274
						scope.problemReporter().parameterizedMemberTypeMissingArguments(this, scope.environment().createParameterizedType(currentOriginal, null, qualifyingType));
274
						scope.problemReporter().parameterizedMemberTypeMissingArguments(this, scope.environment().createParameterizedType(currentOriginal, null, qualifyingType), i);
275
						typeIsConsistent = false;
275
						typeIsConsistent = false;
276
					}
276
					}
277
	   			    qualifyingType = scope.environment().createRawType(currentOriginal, qualifyingType); // raw type
277
	   			    qualifyingType = scope.environment().createRawType(currentOriginal, qualifyingType); // raw type
Lines 282-288 Link Here
282
				}
282
				}
283
			}
283
			}
284
			if (isTypeUseDeprecated(qualifyingType, scope))
284
			if (isTypeUseDeprecated(qualifyingType, scope))
285
				reportDeprecatedType(qualifyingType, scope);
285
				reportDeprecatedType(qualifyingType, scope, i);
286
			this.resolvedType = qualifyingType;
286
			this.resolvedType = qualifyingType;
287
		}
287
		}
288
		// array type ?
288
		// array type ?
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-10 / +33 lines)
Lines 1369-1374 Link Here
1369
	}
1369
	}
1370
}
1370
}
1371
public void deprecatedType(TypeBinding type, ASTNode location) {
1371
public void deprecatedType(TypeBinding type, ASTNode location) {
1372
	deprecatedType(type, location, Integer.MAX_VALUE);
1373
}
1374
// The argument 'index' makes sure that we demarcate partial types correctly while marking off
1375
// a deprecated type in a qualified reference (see bug 292510)
1376
public void deprecatedType(TypeBinding type, ASTNode location, int index) {
1372
	if (location == null) return; // 1G828DN - no type ref for synthetic arguments
1377
	if (location == null) return; // 1G828DN - no type ref for synthetic arguments
1373
	int severity = computeSeverity(IProblem.UsingDeprecatedType);
1378
	int severity = computeSeverity(IProblem.UsingDeprecatedType);
1374
	if (severity == ProblemSeverities.Ignore) return;
1379
	if (severity == ProblemSeverities.Ignore) return;
Lines 1379-1385 Link Here
1379
		new String[] {new String(type.shortReadableName())},
1384
		new String[] {new String(type.shortReadableName())},
1380
		severity,
1385
		severity,
1381
		location.sourceStart,
1386
		location.sourceStart,
1382
		nodeSourceEnd(null, location));
1387
		nodeSourceEnd(null, location, index));
1383
}
1388
}
1384
public void disallowedTargetForAnnotation(Annotation annotation) {
1389
public void disallowedTargetForAnnotation(Annotation annotation) {
1385
	this.handle(
1390
	this.handle(
Lines 2651-2656 Link Here
2651
		sourceEnd);
2656
		sourceEnd);
2652
}
2657
}
2653
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) {
2658
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) {
2659
	incorrectArityForParameterizedType(location, type, argumentTypes, Integer.MAX_VALUE);
2660
}
2661
public void incorrectArityForParameterizedType(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes, int index) {
2654
    if (location == null) {
2662
    if (location == null) {
2655
		this.handle(
2663
		this.handle(
2656
			IProblem.IncorrectArityForParameterizedType,
2664
			IProblem.IncorrectArityForParameterizedType,
Lines 2666-2672 Link Here
2666
		new String[] {new String(type.readableName()), typesAsString(false, argumentTypes, false)},
2674
		new String[] {new String(type.readableName()), typesAsString(false, argumentTypes, false)},
2667
		new String[] {new String(type.shortReadableName()), typesAsString(false, argumentTypes, true)},
2675
		new String[] {new String(type.shortReadableName()), typesAsString(false, argumentTypes, true)},
2668
		location.sourceStart,
2676
		location.sourceStart,
2669
		location.sourceEnd);
2677
		nodeSourceEnd(null, location, index));
2670
}
2678
}
2671
public void incorrectLocationForNonEmptyDimension(ArrayAllocationExpression expression, int index) {
2679
public void incorrectLocationForNonEmptyDimension(ArrayAllocationExpression expression, int index) {
2672
	this.handle(
2680
	this.handle(
Lines 3982-3987 Link Here
3982
	}
3990
	}
3983
}
3991
}
3984
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) {
3992
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) {
3993
	javadocDeprecatedType(type, location, modifiers, Integer.MAX_VALUE);
3994
}
3995
public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers, int index) {
3985
	if (location == null) return; // 1G828DN - no type ref for synthetic arguments
3996
	if (location == null) return; // 1G828DN - no type ref for synthetic arguments
3986
	int severity = computeSeverity(IProblem.JavadocUsingDeprecatedType);
3997
	int severity = computeSeverity(IProblem.JavadocUsingDeprecatedType);
3987
	if (severity == ProblemSeverities.Ignore) return;
3998
	if (severity == ProblemSeverities.Ignore) return;
Lines 3995-4001 Link Here
3995
				new String[] {new String(type.shortReadableName())},
4006
				new String[] {new String(type.shortReadableName())},
3996
				severity,
4007
				severity,
3997
				location.sourceStart,
4008
				location.sourceStart,
3998
				location.sourceEnd);
4009
				nodeSourceEnd(null, location, index));
3999
		}
4010
		}
4000
	}
4011
	}
4001
}
4012
}
Lines 5227-5233 Link Here
5227
			if (index == 0) {
5238
			if (index == 0) {
5228
				return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]);
5239
				return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]);
5229
			} else {
5240
			} else {
5230
				return (int) (ref.sourcePositions[index]);
5241
				int length = ref.sourcePositions.length;
5242
				if (index < length) {
5243
					return (int) (ref.sourcePositions[index]);
5244
				}
5245
				return (int) (ref.sourcePositions[0]);
5231
			}
5246
			}
5232
		}
5247
		}
5233
		FieldBinding[] otherFields = ref.otherBindings;
5248
		FieldBinding[] otherFields = ref.otherBindings;
Lines 5254-5260 Link Here
5254
	} else if (node instanceof ArrayQualifiedTypeReference) {
5269
	} else if (node instanceof ArrayQualifiedTypeReference) {
5255
		ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node;
5270
		ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node;
5256
		int length = reference.sourcePositions.length;
5271
		int length = reference.sourcePositions.length;
5272
		if (index < length) {
5273
			return (int) reference.sourcePositions[index];
5274
		}
5257
		return (int) reference.sourcePositions[length - 1];
5275
		return (int) reference.sourcePositions[length - 1];
5276
	} else if (node instanceof QualifiedTypeReference) {
5277
		QualifiedTypeReference reference = (QualifiedTypeReference) node;
5278
		int length = reference.sourcePositions.length;
5279
		if (index < length) {
5280
			return (int) reference.sourcePositions[index];
5281
		}
5258
	}
5282
	}
5259
	return node.sourceEnd;
5283
	return node.sourceEnd;
5260
}
5284
}
Lines 5621-5627 Link Here
5621
	}
5645
	}
5622
	return nameBuffer.toString();
5646
	return nameBuffer.toString();
5623
}
5647
}
5624
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type) {
5648
public void parameterizedMemberTypeMissingArguments(ASTNode location, TypeBinding type, int index) {
5625
	if (location == null) { // binary case
5649
	if (location == null) { // binary case
5626
	    this.handle(
5650
	    this.handle(
5627
			IProblem.MissingArgumentsForParameterizedMemberType,
5651
			IProblem.MissingArgumentsForParameterizedMemberType,
Lines 5637-5643 Link Here
5637
		new String[] {new String(type.readableName())},
5661
		new String[] {new String(type.readableName())},
5638
		new String[] {new String(type.shortReadableName())},
5662
		new String[] {new String(type.shortReadableName())},
5639
		location.sourceStart,
5663
		location.sourceStart,
5640
		location.sourceEnd);
5664
		nodeSourceEnd(null, location, index));
5641
}
5665
}
5642
public void parseError(
5666
public void parseError(
5643
	int startPosition,
5667
	int startPosition,
Lines 5968-5974 Link Here
5968
		new String[] {new String(type.readableName()), new String(type.erasure().readableName()), },
5992
		new String[] {new String(type.readableName()), new String(type.erasure().readableName()), },
5969
		new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),},
5993
		new String[] {new String(type.shortReadableName()),new String(type.erasure().shortReadableName()),},
5970
		location.sourceStart,
5994
		location.sourceStart,
5971
		nodeSourceEnd(null, location));
5995
		nodeSourceEnd(null, location, Integer.MAX_VALUE));
5972
}
5996
}
5973
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) {
5997
public void recursiveConstructorInvocation(ExplicitConstructorCall constructorCall) {
5974
	this.handle(
5998
	this.handle(
Lines 6270-6276 Link Here
6270
		type.sourceStart(),
6294
		type.sourceStart(),
6271
		type.sourceEnd());
6295
		type.sourceEnd());
6272
}
6296
}
6273
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type) {
6297
public void staticMemberOfParameterizedType(ASTNode location, ReferenceBinding type, int index) {
6274
	if (location == null) { // binary case
6298
	if (location == null) { // binary case
6275
	    this.handle(
6299
	    this.handle(
6276
			IProblem.StaticMemberOfParameterizedType,
6300
			IProblem.StaticMemberOfParameterizedType,
Lines 6281-6287 Link Here
6281
			0);
6305
			0);
6282
	    return;
6306
	    return;
6283
	}
6307
	}
6284
	int end = location.sourceEnd;
6285
	/*if (location instanceof ArrayTypeReference) {
6308
	/*if (location instanceof ArrayTypeReference) {
6286
		ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location;
6309
		ArrayTypeReference arrayTypeReference = (ArrayTypeReference) location;
6287
		if (arrayTypeReference.token != null && arrayTypeReference.token.length == 0) return;
6310
		if (arrayTypeReference.token != null && arrayTypeReference.token.length == 0) return;
Lines 6292-6298 Link Here
6292
		new String[] {new String(type.readableName()), new String(type.enclosingType().readableName()), },
6315
		new String[] {new String(type.readableName()), new String(type.enclosingType().readableName()), },
6293
		new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), },
6316
		new String[] {new String(type.shortReadableName()), new String(type.enclosingType().shortReadableName()), },
6294
		location.sourceStart,
6317
		location.sourceStart,
6295
		end);
6318
		nodeSourceEnd(null, location, index));
6296
}
6319
}
6297
public void stringConstantIsExceedingUtf8Limit(ASTNode location) {
6320
public void stringConstantIsExceedingUtf8Limit(ASTNode location) {
6298
	this.handle(
6321
	this.handle(
(-)src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java (-3 / +3 lines)
Lines 593-599 Link Here
593
		"----------\n" + /* expected compiler log */
593
		"----------\n" + /* expected compiler log */
594
		"1. ERROR in p\\M1.java (at line 4)\n" +
594
		"1. ERROR in p\\M1.java (at line 4)\n" +
595
		"	a.N1.N2.N3 m = null;\n" +
595
		"	a.N1.N2.N3 m = null;\n" +
596
		"	^^^^^^^^^^\n" +
596
		"	^^^^^^^\n" +
597
		"The type N1.N2 is deprecated\n" +
597
		"The type N1.N2 is deprecated\n" +
598
		"----------\n" +
598
		"----------\n" +
599
		"2. ERROR in p\\M1.java (at line 4)\n" +
599
		"2. ERROR in p\\M1.java (at line 4)\n" +
Lines 644-650 Link Here
644
		"----------\n" + /* expected compiler log */
644
		"----------\n" + /* expected compiler log */
645
		"1. ERROR in p\\M1.java (at line 4)\n" +
645
		"1. ERROR in p\\M1.java (at line 4)\n" +
646
		"	a.N1.N2.N3 m = null;\n" +
646
		"	a.N1.N2.N3 m = null;\n" +
647
		"	^^^^^^^^^^\n" +
647
		"	^^^^^^^\n" +
648
		"The type N1.N2 is deprecated\n" +
648
		"The type N1.N2 is deprecated\n" +
649
		"----------\n" +
649
		"----------\n" +
650
		"2. ERROR in p\\M1.java (at line 4)\n" +
650
		"2. ERROR in p\\M1.java (at line 4)\n" +
Lines 739-745 Link Here
739
		"----------\n" + /* expected compiler log */
739
		"----------\n" + /* expected compiler log */
740
		"1. ERROR in p\\M1.java (at line 4)\n" +
740
		"1. ERROR in p\\M1.java (at line 4)\n" +
741
		"	a.N1.N2.N3 m = null;\n" +
741
		"	a.N1.N2.N3 m = null;\n" +
742
		"	^^^^^^^^^^\n" +
742
		"	^^^^^^^\n" +
743
		"The type N1.N2 is deprecated\n" +
743
		"The type N1.N2 is deprecated\n" +
744
		"----------\n" +
744
		"----------\n" +
745
		"2. ERROR in p\\M1.java (at line 4)\n" +
745
		"2. ERROR in p\\M1.java (at line 4)\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java (-1 / +1 lines)
Lines 137-143 Link Here
137
		"----------\n" +
137
		"----------\n" +
138
		"1. ERROR in p\\M1.java (at line 4)\n" +
138
		"1. ERROR in p\\M1.java (at line 4)\n" +
139
		"	a.N1.N2.N3 m = null;\n" +
139
		"	a.N1.N2.N3 m = null;\n" +
140
		"	^^^^^^^^^^\n" +
140
		"	^^^^^^^\n" +
141
		"The type N1.N2 is deprecated\n" +
141
		"The type N1.N2 is deprecated\n" +
142
		"----------\n" +
142
		"----------\n" +
143
		"2. ERROR in p\\M1.java (at line 4)\n" +
143
		"2. ERROR in p\\M1.java (at line 4)\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-4 / +32 lines)
Lines 8520-8526 Link Here
8520
			"----------\n" +
8520
			"----------\n" +
8521
			"1. ERROR in X.java (at line 11)\n" +
8521
			"1. ERROR in X.java (at line 11)\n" +
8522
			"	X<String>.A.B<String> bs;\n" +
8522
			"	X<String>.A.B<String> bs;\n" +
8523
			"	^^^^^^^^^^^^^\n" +
8523
			"	^^^^^^^^^^^\n" +
8524
			"The member type X<String>.A must be parameterized, since it is qualified with a parameterized type\n" +
8524
			"The member type X<String>.A must be parameterized, since it is qualified with a parameterized type\n" +
8525
			"----------\n");
8525
			"----------\n");
8526
	}
8526
	}
Lines 8545-8551 Link Here
8545
			"----------\n" +
8545
			"----------\n" +
8546
			"1. ERROR in X.java (at line 11)\n" +
8546
			"1. ERROR in X.java (at line 11)\n" +
8547
			"	X<String>.A.B<String> bs;\n" +
8547
			"	X<String>.A.B<String> bs;\n" +
8548
			"	^^^^^^^^^^^^^\n" +
8548
			"	^^^^^^^^^^^\n" +
8549
			"The member type X<String>.A cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<String>\n" +
8549
			"The member type X<String>.A cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<String>\n" +
8550
			"----------\n");
8550
			"----------\n");
8551
	}
8551
	}
Lines 23948-23954 Link Here
23948
		"----------\n" +
23948
		"----------\n" +
23949
		"1. ERROR in X.java (at line 4)\n" +
23949
		"1. ERROR in X.java (at line 4)\n" +
23950
		"	X<?>.B[] b = new X<?>.B[1];\n" +
23950
		"	X<?>.B[] b = new X<?>.B[1];\n" +
23951
		"	^^^^^^^^\n" +
23951
		"	^^^^^^\n" +
23952
		"The member type X<?>.B cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<?>\n" +
23952
		"The member type X<?>.B cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<?>\n" +
23953
		"----------\n" +
23953
		"----------\n" +
23954
		"2. ERROR in X.java (at line 4)\n" +
23954
		"2. ERROR in X.java (at line 4)\n" +
Lines 45991-45997 Link Here
45991
			"----------\n" +
45991
			"----------\n" +
45992
			"1. WARNING in X.java (at line 2)\n" +
45992
			"1. WARNING in X.java (at line 2)\n" +
45993
			"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" +
45993
			"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" +
45994
			"	^^^^^^^^^^^^^^^^^^^^^\n" +
45994
			"	^^^^^^^^^^^^^^\n" +
45995
			"The type DeprecatedType<T> is deprecated\n" +
45995
			"The type DeprecatedType<T> is deprecated\n" +
45996
			"----------\n" +
45996
			"----------\n" +
45997
			"2. WARNING in X.java (at line 2)\n" +
45997
			"2. WARNING in X.java (at line 2)\n" +
Lines 49884-49887 Link Here
49884
		""
49884
		""
49885
	);
49885
	);
49886
}
49886
}
49887
// Test to verify that partial types in a parameterized qualified reference are
49888
// demarcated correctly while annotating an arity problem in case of wrong number of arguments.
49889
// Related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=292510
49890
public void test1457() {
49891
	this.runNegativeTest(
49892
		new String[] {
49893
			"test/X.java",
49894
			"package test;\n" +
49895
				"// Valid Parameterized Type Declaration\n" +
49896
				"public class X<A1, A2> {\n" +
49897
				"	public class Y<A3,A4,A5> {\n" +
49898
				"		public class Z<A6> {\n" +
49899
				"		}\n" +
49900
				"	}\n" +
49901
				"}\n" +
49902
				"// Invalid Valid Type Syntax (too many parameters)\n" +
49903
				"class Y {\n" +
49904
				"	X<String, Number>.Y<String,Integer>.Z<String> x;\n" +
49905
				"}\n"
49906
		},
49907
		"----------\n" +
49908
		"1. ERROR in test\\X.java (at line 11)\n" +
49909
		"	X<String, Number>.Y<String,Integer>.Z<String> x;\n" +
49910
		"	^^^^^^^^^^^^^^^^^^^\n" +
49911
		"Incorrect number of arguments for type X<String,Number>.Y; it cannot be parameterized with arguments <String, Integer>\n" +
49912
		"----------\n"
49913
	);
49914
}
49887
}
49915
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (+44 lines)
Lines 8586-8590 Link Here
8586
			"}\n"
8586
			"}\n"
8587
		});
8587
		});
8588
}
8588
}
8589
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=292510
8590
// Test to verify that partial types are demarcated correctly while
8591
// annotating a deprecated type error in javadoc.
8592
public void testBug292510() {
8593
	Map options = getCompilerOptions();
8594
	options.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
8595
	runNegativeTest(
8596
		true,
8597
		new String[] {
8598
			"X.java",
8599
			"/**  @deprecated */\n" +
8600
				"public class X {\n" +
8601
				"    public class XX {\n" +
8602
				"        public class XXX {\n" +
8603
				"        }\n" +
8604
				"    }\n" +
8605
				"}\n",
8606
			"Y.java",
8607
			"/**\n" +
8608
				" * @see X.XX.XXX\n" +
8609
				" */\n" +
8610
				"public class Y {\n" +
8611
				"}\n"},
8612
		null,
8613
		options,
8614
		"----------\n" +
8615
		"1. ERROR in Y.java (at line 2)\n" +
8616
		"	* @see X.XX.XXX\n" +
8617
		"	       ^\n" +
8618
		"Javadoc: The type X is deprecated\n" +
8619
		"----------\n" +
8620
		"2. ERROR in Y.java (at line 2)\n" +
8621
		"	* @see X.XX.XXX\n" +
8622
		"	       ^^^^\n" +
8623
		"Javadoc: The type X.XX is deprecated\n" +
8624
		"----------\n" +
8625
		"3. ERROR in Y.java (at line 2)\n" +
8626
		"	* @see X.XX.XXX\n" +
8627
		"	       ^^^^^^^^\n" +
8628
		"Javadoc: The type X.XX.XXX is deprecated\n" +
8629
		"----------\n",
8630
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
8631
	);
8632
}
8589
8633
8590
}
8634
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java (-8 / +8 lines)
Lines 5485-5496 Link Here
5485
		"----------\n" +
5485
		"----------\n" +
5486
		"2. WARNING in p\\X.java (at line 6)\n" +
5486
		"2. WARNING in p\\X.java (at line 6)\n" +
5487
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5487
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5488
		"	^^^^^^^^\n" +
5488
		"	^\n" +
5489
		"The type A is deprecated\n" +
5489
		"The type A is deprecated\n" +
5490
		"----------\n" +
5490
		"----------\n" +
5491
		"3. WARNING in p\\X.java (at line 6)\n" +
5491
		"3. WARNING in p\\X.java (at line 6)\n" +
5492
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5492
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5493
		"	^^^^^^^^\n" +
5493
		"	^^^^\n" +
5494
		"The type A.M2 is deprecated\n" +
5494
		"The type A.M2 is deprecated\n" +
5495
		"----------\n" +
5495
		"----------\n" +
5496
		"4. WARNING in p\\X.java (at line 6)\n" +
5496
		"4. WARNING in p\\X.java (at line 6)\n" +
Lines 5500-5511 Link Here
5500
		"----------\n" +
5500
		"----------\n" +
5501
		"5. WARNING in p\\X.java (at line 6)\n" +
5501
		"5. WARNING in p\\X.java (at line 6)\n" +
5502
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5502
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5503
		"	                ^^^^^^^^\n" +
5503
		"	                ^\n" +
5504
		"The type A is deprecated\n" +
5504
		"The type A is deprecated\n" +
5505
		"----------\n" +
5505
		"----------\n" +
5506
		"6. WARNING in p\\X.java (at line 6)\n" +
5506
		"6. WARNING in p\\X.java (at line 6)\n" +
5507
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5507
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5508
		"	                ^^^^^^^^\n" +
5508
		"	                ^^^^\n" +
5509
		"The type A.M2 is deprecated\n" +
5509
		"The type A.M2 is deprecated\n" +
5510
		"----------\n" +
5510
		"----------\n" +
5511
		"7. WARNING in p\\X.java (at line 6)\n" +
5511
		"7. WARNING in p\\X.java (at line 6)\n" +
Lines 5515-5526 Link Here
5515
		"----------\n" +
5515
		"----------\n" +
5516
		"8. WARNING in p\\X.java (at line 7)\n" +
5516
		"8. WARNING in p\\X.java (at line 7)\n" +
5517
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5517
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5518
		"	^^^^^^^^\n" +
5518
		"	^\n" +
5519
		"The type A is deprecated\n" +
5519
		"The type A is deprecated\n" +
5520
		"----------\n" +
5520
		"----------\n" +
5521
		"9. WARNING in p\\X.java (at line 7)\n" +
5521
		"9. WARNING in p\\X.java (at line 7)\n" +
5522
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5522
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5523
		"	^^^^^^^^\n" +
5523
		"	^^^^\n" +
5524
		"The type A.M2 is deprecated\n" +
5524
		"The type A.M2 is deprecated\n" +
5525
		"----------\n" +
5525
		"----------\n" +
5526
		"10. WARNING in p\\X.java (at line 7)\n" +
5526
		"10. WARNING in p\\X.java (at line 7)\n" +
Lines 5530-5541 Link Here
5530
		"----------\n" +
5530
		"----------\n" +
5531
		"11. WARNING in p\\X.java (at line 7)\n" +
5531
		"11. WARNING in p\\X.java (at line 7)\n" +
5532
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5532
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5533
		"	                   ^^^^^^^^\n" +
5533
		"	                   ^\n" +
5534
		"The type A is deprecated\n" +
5534
		"The type A is deprecated\n" +
5535
		"----------\n" +
5535
		"----------\n" +
5536
		"12. WARNING in p\\X.java (at line 7)\n" +
5536
		"12. WARNING in p\\X.java (at line 7)\n" +
5537
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5537
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5538
		"	                   ^^^^^^^^\n" +
5538
		"	                   ^^^^\n" +
5539
		"The type A.M2 is deprecated\n" +
5539
		"The type A.M2 is deprecated\n" +
5540
		"----------\n" +
5540
		"----------\n" +
5541
		"13. WARNING in p\\X.java (at line 7)\n" +
5541
		"13. WARNING in p\\X.java (at line 7)\n" +

Return to bug 292510