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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java (-3 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 56-63 Link Here
56
			}
56
			}
57
			return null;
57
			return null;
58
		}
58
		}
59
		if (isTypeUseDeprecated(type, scope))
60
			reportDeprecatedType(type, scope, Integer.MAX_VALUE);
61
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
59
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
62
		// raw convert all enclosing types when dealing with Javadoc references
60
		// raw convert all enclosing types when dealing with Javadoc references
63
		if (type.isGenericType() || type.isParameterizedType()) {
61
		if (type.isGenericType() || type.isParameterizedType()) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 86-92 Link Here
86
				scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this);
86
				scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this);
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, i);
90
				reportDeprecatedType(this.resolvedType, scope, i);
91
			}
91
			}
92
			if (isClassScope)
92
			if (isClassScope)
(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java (-1 / +2 lines)
Lines 148-154 Link Here
148
		scope.problemReporter().cannotAllocateVoidArray(this);
148
		scope.problemReporter().cannotAllocateVoidArray(this);
149
		return null;
149
		return null;
150
	}
150
	}
151
	if (isTypeUseDeprecated(type, scope)) {
151
	if (!(this instanceof QualifiedTypeReference)   // QualifiedTypeReference#getTypeBinding called above will have already checked deprecation
152
			&& isTypeUseDeprecated(type, scope)) {
152
		reportDeprecatedType(type, scope);
153
		reportDeprecatedType(type, scope);
153
	}
154
	}
154
	type = scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/);
155
	type = scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/);
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-3 / +26 lines)
Lines 1356-1375 Link Here
1356
	int severity = computeSeverity(isConstructor ? IProblem.UsingDeprecatedConstructor : IProblem.UsingDeprecatedMethod);
1356
	int severity = computeSeverity(isConstructor ? IProblem.UsingDeprecatedConstructor : IProblem.UsingDeprecatedMethod);
1357
	if (severity == ProblemSeverities.Ignore) return;
1357
	if (severity == ProblemSeverities.Ignore) return;
1358
	if (isConstructor) {
1358
	if (isConstructor) {
1359
		int start = -1;
1360
		if(location instanceof AllocationExpression) {
1361
			// omit the new keyword from the warning marker
1362
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
1363
			AllocationExpression allocationExpression = (AllocationExpression) location;
1364
			if (allocationExpression.enumConstant != null) {
1365
				start = allocationExpression.enumConstant.sourceStart;
1366
			}
1367
			start = allocationExpression.type.sourceStart;
1368
		}
1359
		this.handle(
1369
		this.handle(
1360
			IProblem.UsingDeprecatedConstructor,
1370
			IProblem.UsingDeprecatedConstructor,
1361
			new String[] {new String(method.declaringClass.readableName()), typesAsString(method.isVarargs(), method.parameters, false)},
1371
			new String[] {new String(method.declaringClass.readableName()), typesAsString(method.isVarargs(), method.parameters, false)},
1362
			new String[] {new String(method.declaringClass.shortReadableName()), typesAsString(method.isVarargs(), method.parameters, true)},
1372
			new String[] {new String(method.declaringClass.shortReadableName()), typesAsString(method.isVarargs(), method.parameters, true)},
1363
			severity,
1373
			severity,
1364
			location.sourceStart,
1374
			(start == -1) ? location.sourceStart : start,
1365
			location.sourceEnd);
1375
			location.sourceEnd);
1366
	} else {
1376
	} else {
1377
		int start = -1;
1378
		if (location instanceof MessageSend) {
1379
			// start the warning marker from the location where the name of the method starts
1380
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
1381
			start = (int) (((MessageSend)location).nameSourcePosition >>> 32);
1382
		}
1367
		this.handle(
1383
		this.handle(
1368
			IProblem.UsingDeprecatedMethod,
1384
			IProblem.UsingDeprecatedMethod,
1369
			new String[] {new String(method.declaringClass.readableName()), new String(method.selector), typesAsString(method.isVarargs(), method.parameters, false)},
1385
			new String[] {new String(method.declaringClass.readableName()), new String(method.selector), typesAsString(method.isVarargs(), method.parameters, false)},
1370
			new String[] {new String(method.declaringClass.shortReadableName()), new String(method.selector), typesAsString(method.isVarargs(), method.parameters, true)},
1386
			new String[] {new String(method.declaringClass.shortReadableName()), new String(method.selector), typesAsString(method.isVarargs(), method.parameters, true)},
1371
			severity,
1387
			severity,
1372
			location.sourceStart,
1388
			(start == -1) ? location.sourceStart : start,
1373
			location.sourceEnd);
1389
			location.sourceEnd);
1374
	}
1390
	}
1375
}
1391
}
Lines 1383-1394 Link Here
1383
	int severity = computeSeverity(IProblem.UsingDeprecatedType);
1399
	int severity = computeSeverity(IProblem.UsingDeprecatedType);
1384
	if (severity == ProblemSeverities.Ignore) return;
1400
	if (severity == ProblemSeverities.Ignore) return;
1385
	type = type.leafComponentType();
1401
	type = type.leafComponentType();
1402
	int sourceStart = -1;
1403
	if (location instanceof QualifiedTypeReference) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
1404
		QualifiedTypeReference ref = (QualifiedTypeReference) location;
1405
		if (index < Integer.MAX_VALUE) {
1406
			sourceStart = (int) (ref.sourcePositions[index] >> 32);
1407
		}
1408
	}
1386
	this.handle(
1409
	this.handle(
1387
		IProblem.UsingDeprecatedType,
1410
		IProblem.UsingDeprecatedType,
1388
		new String[] {new String(type.readableName())},
1411
		new String[] {new String(type.readableName())},
1389
		new String[] {new String(type.shortReadableName())},
1412
		new String[] {new String(type.shortReadableName())},
1390
		severity,
1413
		severity,
1391
		location.sourceStart,
1414
		(sourceStart == -1) ? location.sourceStart : sourceStart,
1392
		nodeSourceEnd(null, location, index));
1415
		nodeSourceEnd(null, location, index));
1393
}
1416
}
1394
public void disallowedTargetForAnnotation(Annotation annotation) {
1417
public void disallowedTargetForAnnotation(Annotation annotation) {
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java (-18 / +23 lines)
Lines 6959-6970 Link Here
6959
		"----------\n" +
6959
		"----------\n" +
6960
		"1. WARNING in p\\AYHelper.java (at line 7)\n" +
6960
		"1. WARNING in p\\AYHelper.java (at line 7)\n" +
6961
		"	new AY().foo();\n" +
6961
		"	new AY().foo();\n" +
6962
		"	^^^^^^^^\n" +
6962
		"	    ^^^^\n" +
6963
		"The constructor AY() is deprecated\n" +
6963
		"The constructor AY() is deprecated\n" +
6964
		"----------\n" +
6964
		"----------\n" +
6965
		"2. WARNING in p\\AYHelper.java (at line 7)\n" +
6965
		"2. WARNING in p\\AYHelper.java (at line 7)\n" +
6966
		"	new AY().foo();\n" +
6966
		"	new AY().foo();\n" +
6967
		"	^^^^^^^^^^^^^^\n" +
6967
		"	         ^^^^^\n" +
6968
		"The method foo() from the type AY is deprecated\n" +
6968
		"The method foo() from the type AY is deprecated\n" +
6969
		"----------\n");
6969
		"----------\n");
6970
}
6970
}
Lines 9313-9319 Link Here
9313
		"----------\n" +
9313
		"----------\n" +
9314
		"1. WARNING in p\\ea\\EAHelper.java (at line 4)\n" +
9314
		"1. WARNING in p\\ea\\EAHelper.java (at line 4)\n" +
9315
		"	new EA().foo();\n" +
9315
		"	new EA().foo();\n" +
9316
		"	^^^^^^^^^^^^^^\n" +
9316
		"	         ^^^^^\n" +
9317
		"The method foo() from the type EA is deprecated\n" +
9317
		"The method foo() from the type EA is deprecated\n" +
9318
		"----------\n"
9318
		"----------\n"
9319
	);
9319
	);
Lines 10992-10998 Link Here
10992
		"----------\n" +
10992
		"----------\n" +
10993
		"4. WARNING in X.java (at line 15)\n" +
10993
		"4. WARNING in X.java (at line 15)\n" +
10994
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
10994
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
10995
		"	        ^^^^^^^^^^^\n" +
10995
		"	              ^^^^^\n" +
10996
		"The method foo() from the type I is deprecated\n" +
10996
		"The method foo() from the type I is deprecated\n" +
10997
		"----------\n" +
10997
		"----------\n" +
10998
		"5. WARNING in X.java (at line 20)\n" +
10998
		"5. WARNING in X.java (at line 20)\n" +
Lines 11012-11018 Link Here
11012
		"----------\n" +
11012
		"----------\n" +
11013
		"8. WARNING in X.java (at line 25)\n" +
11013
		"8. WARNING in X.java (at line 25)\n" +
11014
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11014
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11015
		"	^^^^^^^^^^^\n" +
11015
		"	      ^^^^^\n" +
11016
		"The method foo() from the type I is deprecated\n" +
11016
		"The method foo() from the type I is deprecated\n" +
11017
		"----------\n",
11017
		"----------\n",
11018
		null,
11018
		null,
Lines 11104-11115 Link Here
11104
		"----------\n" +
11104
		"----------\n" +
11105
		"6. WARNING in X.java (at line 15)\n" +
11105
		"6. WARNING in X.java (at line 15)\n" +
11106
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
11106
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
11107
		"	        ^^^^^^^^^^^\n" +
11107
		"	              ^^^^^\n" +
11108
		"The method foo() from the type I is deprecated\n" +
11108
		"The method foo() from the type I is deprecated\n" +
11109
		"----------\n" +
11109
		"----------\n" +
11110
		"7. WARNING in X.java (at line 18)\n" +
11110
		"7. WARNING in X.java (at line 18)\n" +
11111
		"	int j = someI.bar(); // should complain about bar() deprecation	\n" +
11111
		"	int j = someI.bar(); // should complain about bar() deprecation	\n" +
11112
		"	        ^^^^^^^^^^^\n" +
11112
		"	              ^^^^^\n" +
11113
		"The method bar() from the type I is deprecated\n" +
11113
		"The method bar() from the type I is deprecated\n" +
11114
		"----------\n" +
11114
		"----------\n" +
11115
		"8. WARNING in X.java (at line 20)\n" +
11115
		"8. WARNING in X.java (at line 20)\n" +
Lines 11134-11145 Link Here
11134
		"----------\n" +
11134
		"----------\n" +
11135
		"12. WARNING in X.java (at line 25)\n" +
11135
		"12. WARNING in X.java (at line 25)\n" +
11136
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11136
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11137
		"	^^^^^^^^^^^\n" +
11137
		"	      ^^^^^\n" +
11138
		"The method foo() from the type I is deprecated\n" +
11138
		"The method foo() from the type I is deprecated\n" +
11139
		"----------\n" +
11139
		"----------\n" +
11140
		"13. WARNING in X.java (at line 30)\n" +
11140
		"13. WARNING in X.java (at line 30)\n" +
11141
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11141
		"	someI.foo(); // should complain about foo() deprecation	\n" +
11142
		"	^^^^^^^^^^^\n" +
11142
		"	      ^^^^^\n" +
11143
		"The method foo() from the type I is deprecated\n" +
11143
		"The method foo() from the type I is deprecated\n" +
11144
		"----------\n",
11144
		"----------\n",
11145
		null,
11145
		null,
Lines 12308-12314 Link Here
12308
			"}	\n",
12308
			"}	\n",
12309
		},
12309
		},
12310
		"----------\n" +
12310
		"----------\n" +
12311
		"1. WARNING in p\\X.java (at line 4)\n" +
12311
		"1. WARNING in p\\X.java (at line 3)\n" + 
12312
		"	private class Y {	\n" + 
12313
		"	              ^\n" + 
12314
		"The type X.Y is never used locally\n" + 
12315
		"----------\n" + 
12316
		"2. WARNING in p\\X.java (at line 4)\n" +
12312
		"	public class Z {	\n" +
12317
		"	public class Z {	\n" +
12313
		"	             ^\n" +
12318
		"	             ^\n" +
12314
		"The type X.Y.Z is never used locally\n" +
12319
		"The type X.Y.Z is never used locally\n" +
Lines 14161-14172 Link Here
14161
		"----------\n" +
14166
		"----------\n" +
14162
		"1. WARNING in p\\AYHelper.java (at line 7)\n" +
14167
		"1. WARNING in p\\AYHelper.java (at line 7)\n" +
14163
		"	new AY().foo();\n" +
14168
		"	new AY().foo();\n" +
14164
		"	^^^^^^^^\n" +
14169
		"	    ^^^^\n" +
14165
		"The constructor AY() is deprecated\n" +
14170
		"The constructor AY() is deprecated\n" +
14166
		"----------\n" +
14171
		"----------\n" +
14167
		"2. WARNING in p\\AYHelper.java (at line 7)\n" +
14172
		"2. WARNING in p\\AYHelper.java (at line 7)\n" +
14168
		"	new AY().foo();\n" +
14173
		"	new AY().foo();\n" +
14169
		"	^^^^^^^^^^^^^^\n" +
14174
		"	         ^^^^^\n" +
14170
		"The method foo() from the type AY is deprecated\n" +
14175
		"The method foo() from the type AY is deprecated\n" +
14171
		"----------\n");
14176
		"----------\n");
14172
}
14177
}
Lines 15069-15075 Link Here
15069
		"----------\n" +
15074
		"----------\n" +
15070
		"3. WARNING in X.java (at line 15)\n" +
15075
		"3. WARNING in X.java (at line 15)\n" +
15071
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
15076
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
15072
		"	        ^^^^^^^^^^^\n" +
15077
		"	              ^^^^^\n" +
15073
		"The method foo() from the type I is deprecated\n" +
15078
		"The method foo() from the type I is deprecated\n" +
15074
		"----------\n" +
15079
		"----------\n" +
15075
		"4. WARNING in X.java (at line 20)\n" +
15080
		"4. WARNING in X.java (at line 20)\n" +
Lines 15089-15095 Link Here
15089
		"----------\n" +
15094
		"----------\n" +
15090
		"7. WARNING in X.java (at line 25)\n" +
15095
		"7. WARNING in X.java (at line 25)\n" +
15091
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15096
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15092
		"	^^^^^^^^^^^\n" +
15097
		"	      ^^^^^\n" +
15093
		"The method foo() from the type I is deprecated\n" +
15098
		"The method foo() from the type I is deprecated\n" +
15094
		"----------\n",
15099
		"----------\n",
15095
		null,
15100
		null,
Lines 15182-15193 Link Here
15182
		"----------\n" +
15187
		"----------\n" +
15183
		"6. WARNING in X.java (at line 15)\n" +
15188
		"6. WARNING in X.java (at line 15)\n" +
15184
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
15189
		"	int i = someI.foo(); // should complain about foo() deprecation	\n" +
15185
		"	        ^^^^^^^^^^^\n" +
15190
		"	              ^^^^^\n" +
15186
		"The method foo() from the type I is deprecated\n" +
15191
		"The method foo() from the type I is deprecated\n" +
15187
		"----------\n" +
15192
		"----------\n" +
15188
		"7. WARNING in X.java (at line 18)\n" +
15193
		"7. WARNING in X.java (at line 18)\n" +
15189
		"	int j = someI.bar(); // should complain about bar() deprecation	\n" +
15194
		"	int j = someI.bar(); // should complain about bar() deprecation	\n" +
15190
		"	        ^^^^^^^^^^^\n" +
15195
		"	              ^^^^^\n" +
15191
		"The method bar() from the type I is deprecated\n" +
15196
		"The method bar() from the type I is deprecated\n" +
15192
		"----------\n" +
15197
		"----------\n" +
15193
		"8. WARNING in X.java (at line 20)\n" +
15198
		"8. WARNING in X.java (at line 20)\n" +
Lines 15212-15223 Link Here
15212
		"----------\n" +
15217
		"----------\n" +
15213
		"12. WARNING in X.java (at line 25)\n" +
15218
		"12. WARNING in X.java (at line 25)\n" +
15214
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15219
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15215
		"	^^^^^^^^^^^\n" +
15220
		"	      ^^^^^\n" +
15216
		"The method foo() from the type I is deprecated\n" +
15221
		"The method foo() from the type I is deprecated\n" +
15217
		"----------\n" +
15222
		"----------\n" +
15218
		"13. WARNING in X.java (at line 30)\n" +
15223
		"13. WARNING in X.java (at line 30)\n" +
15219
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15224
		"	someI.foo(); // should complain about foo() deprecation	\n" +
15220
		"	^^^^^^^^^^^\n" +
15225
		"	      ^^^^^\n" +
15221
		"The method foo() from the type I is deprecated\n" +
15226
		"The method foo() from the type I is deprecated\n" +
15222
		"----------\n",
15227
		"----------\n",
15223
		null,
15228
		null,
(-)src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java (-2 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009, Walter Harley and others.
2
 * Copyright (c) 2009, 2010 Walter Harley and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Walter Harley (eclipse@cafewalter.com) - initial implementation
9
 *     Walter Harley (eclipse@cafewalter.com) - initial implementation
10
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.builder;
12
package org.eclipse.jdt.core.tests.builder;
12
13
Lines 259-265 Link Here
259
260
260
		env.addClass( this.srcRoot, "question", "package-info", deprecatedQuestion );
261
		env.addClass( this.srcRoot, "question", "package-info", deprecatedQuestion );
261
		incrementalBuild( this.projectPath );
262
		incrementalBuild( this.projectPath );
262
		expectingOnlySpecificProblemFor(notypesPath, new Problem("", "The type SimpleAnnotation is deprecated", notypesPath, 1, 26, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$
263
		expectingOnlySpecificProblemFor(notypesPath, new Problem("", "The type SimpleAnnotation is deprecated", notypesPath, 10, 26, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$
263
264
264
		env.addClass( this.srcRoot, "question", "package-info", question );
265
		env.addClass( this.srcRoot, "question", "package-info", question );
265
		incrementalBuild( this.projectPath );
266
		incrementalBuild( this.projectPath );
(-)src/org/eclipse/jdt/core/tests/builder/DependencyTests.java (-7 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-20 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.builder;
11
package org.eclipse.jdt.core.tests.builder;
12
12
13
import junit.framework.*;
13
import junit.framework.Test;
14
14
15
import org.eclipse.core.resources.IMarker;
15
import org.eclipse.core.resources.IMarker;
16
import org.eclipse.core.runtime.IPath;
17
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IPath;
18
import org.eclipse.jdt.core.JavaModelException;
18
import org.eclipse.jdt.core.JavaModelException;
19
import org.eclipse.jdt.core.compiler.CategorizedProblem;
19
import org.eclipse.jdt.core.compiler.CategorizedProblem;
20
import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
20
import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
Lines 1237-1254 Link Here
1237
	expectingOnlyProblemsFor(new IPath[] {M1Path});
1237
	expectingOnlyProblemsFor(new IPath[] {M1Path});
1238
	expectingSpecificProblemFor(M1Path,
1238
	expectingSpecificProblemFor(M1Path,
1239
		new Problem("", "The type N1.N2.N3 is deprecated",
1239
		new Problem("", "The type N1.N2.N3 is deprecated",
1240
			M1Path, 190, 200, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1240
			M1Path, 198, 200, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1241
	expectingSpecificProblemFor(M1Path,
1241
	expectingSpecificProblemFor(M1Path,
1242
		new Problem("",	"The method foo() from the type N1.N2.N3 is deprecated",
1242
		new Problem("",	"The method foo() from the type N1.N2.N3 is deprecated",
1243
			M1Path, 215, 222, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1243
			M1Path, 217, 222, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1244
	M1Path = env.addClass(rootPath, "p", "M1", M1Contents);
1244
	M1Path = env.addClass(rootPath, "p", "M1", M1Contents);
1245
	incrementalBuild(projectPath);
1245
	incrementalBuild(projectPath);
1246
	expectingOnlyProblemsFor(new IPath[] {M1Path});
1246
	expectingOnlyProblemsFor(new IPath[] {M1Path});
1247
	expectingSpecificProblemFor(M1Path,
1247
	expectingSpecificProblemFor(M1Path,
1248
		new Problem("", "The type N1.N2.N3 is deprecated",
1248
		new Problem("", "The type N1.N2.N3 is deprecated",
1249
			M1Path, 190, 200, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1249
			M1Path, 198, 200, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1250
	expectingSpecificProblemFor(M1Path,
1250
	expectingSpecificProblemFor(M1Path,
1251
		new Problem("",	"The method foo() from the type N1.N2.N3 is deprecated",
1251
		new Problem("",	"The method foo() from the type N1.N2.N3 is deprecated",
1252
			M1Path, 215, 222, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1252
			M1Path, 217, 222, CategorizedProblem.CAT_DEPRECATION, IMarker.SEVERITY_WARNING));
1253
}
1253
}
1254
}
1254
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (-8 / +8 lines)
Lines 3640-3646 Link Here
3640
			"----------\n" +
3640
			"----------\n" +
3641
			"3. WARNING in Y.java (at line 2)\n" +
3641
			"3. WARNING in Y.java (at line 2)\n" +
3642
			"	void foo(){ super.foo(); }\n" +
3642
			"	void foo(){ super.foo(); }\n" +
3643
			"	            ^^^^^^^^^^^\n" +
3643
			"	                  ^^^^^\n" +
3644
			"The method foo() from the type X is deprecated\n" +
3644
			"The method foo() from the type X is deprecated\n" +
3645
			"----------\n" +
3645
			"----------\n" +
3646
			"4. ERROR in Y.java (at line 3)\n" +
3646
			"4. ERROR in Y.java (at line 3)\n" +
Lines 3677-3683 Link Here
3677
			"----------\n" +
3677
			"----------\n" +
3678
			"3. WARNING in Y.java (at line 2)\n" +
3678
			"3. WARNING in Y.java (at line 2)\n" +
3679
			"	void foo(){ super.foo(); }\n" +
3679
			"	void foo(){ super.foo(); }\n" +
3680
			"	            ^^^^^^^^^^^\n" +
3680
			"	                  ^^^^^\n" +
3681
			"The method foo() from the type X is deprecated\n" +
3681
			"The method foo() from the type X is deprecated\n" +
3682
			"----------\n" +
3682
			"----------\n" +
3683
			"4. ERROR in Y.java (at line 3)\n" +
3683
			"4. ERROR in Y.java (at line 3)\n" +
Lines 4041-4047 Link Here
4041
            "----------\n" +
4041
            "----------\n" +
4042
    		"1. WARNING in X.java (at line 7)\n" +
4042
    		"1. WARNING in X.java (at line 7)\n" +
4043
    		"	W.deprecated();\n" +
4043
    		"	W.deprecated();\n" +
4044
    		"	^^^^^^^^^^^^^^\n" +
4044
    		"	  ^^^^^^^^^^^^\n" +
4045
    		"The method deprecated() from the type W is deprecated\n" +
4045
    		"The method deprecated() from the type W is deprecated\n" +
4046
    		"----------\n" +
4046
    		"----------\n" +
4047
    		"2. WARNING in X.java (at line 8)\n" +
4047
    		"2. WARNING in X.java (at line 8)\n" +
Lines 4281-4287 Link Here
4281
    		"----------\n" +
4281
    		"----------\n" +
4282
    		"3. WARNING in X.java (at line 8)\n" +
4282
    		"3. WARNING in X.java (at line 8)\n" +
4283
    		"	W.deprecated();\n" +
4283
    		"	W.deprecated();\n" +
4284
    		"	^^^^^^^^^^^^^^\n" +
4284
    		"	  ^^^^^^^^^^^^\n" +
4285
    		"The method deprecated() from the type W is deprecated\n" +
4285
    		"The method deprecated() from the type W is deprecated\n" +
4286
    		"----------\n" +
4286
    		"----------\n" +
4287
    		"4. WARNING in X.java (at line 9)\n" +
4287
    		"4. WARNING in X.java (at line 9)\n" +
Lines 4549-4560 Link Here
4549
		"----------\n" + 
4549
		"----------\n" + 
4550
		"2. ERROR in X.java (at line 2)\n" + 
4550
		"2. ERROR in X.java (at line 2)\n" + 
4551
		"	public class X extends p.OldStuff {\n" + 
4551
		"	public class X extends p.OldStuff {\n" + 
4552
		"	                       ^^^^^^^^^^\n" + 
4552
		"	                         ^^^^^^^^\n" + 
4553
		"The type OldStuff is deprecated\n" + 
4553
		"The type OldStuff is deprecated\n" + 
4554
		"----------\n" + 
4554
		"----------\n" + 
4555
		"3. ERROR in X.java (at line 8)\n" + 
4555
		"3. ERROR in X.java (at line 8)\n" + 
4556
		"	super.foo();\n" + 
4556
		"	super.foo();\n" + 
4557
		"	^^^^^^^^^^^\n" + 
4557
		"	      ^^^^^\n" + 
4558
		"The method foo() from the type OldStuff is deprecated\n" + 
4558
		"The method foo() from the type OldStuff is deprecated\n" + 
4559
		"----------\n",
4559
		"----------\n",
4560
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4560
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
Lines 4581-4587 Link Here
4581
		"----------\n" +
4581
		"----------\n" +
4582
		"1. WARNING in X.java (at line 1)\n" +
4582
		"1. WARNING in X.java (at line 1)\n" +
4583
		"	public class X extends p.OldStuff {\n" +
4583
		"	public class X extends p.OldStuff {\n" +
4584
		"	                       ^^^^^^^^^^\n" +
4584
		"	                         ^^^^^^^^\n" +
4585
		"The type OldStuff is deprecated\n" +
4585
		"The type OldStuff is deprecated\n" +
4586
		"----------\n" +
4586
		"----------\n" +
4587
		"----------\n" +
4587
		"----------\n" +
Lines 6029-6035 Link Here
6029
    		"----------\n" +
6029
    		"----------\n" +
6030
    		"1. WARNING in X.java (at line 3)\n" +
6030
    		"1. WARNING in X.java (at line 3)\n" +
6031
    		"	Y.initialize i;\n" +
6031
    		"	Y.initialize i;\n" +
6032
    		"	^^^^^^^^^^^^\n" +
6032
    		"	  ^^^^^^^^^^\n" +
6033
    		"The type Y.initialize is deprecated\n" +
6033
    		"The type Y.initialize is deprecated\n" +
6034
    		"----------\n" +
6034
    		"----------\n" +
6035
    		"----------\n" +
6035
    		"----------\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java (-11 / +11 lines)
Lines 13-22 Link Here
13
import java.util.HashMap;
13
import java.util.HashMap;
14
import java.util.Map;
14
import java.util.Map;
15
15
16
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
17
18
import junit.framework.Test;
16
import junit.framework.Test;
19
17
18
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
19
20
public class Deprecated15Test extends AbstractRegressionTest {
20
public class Deprecated15Test extends AbstractRegressionTest {
21
public Deprecated15Test(String name) {
21
public Deprecated15Test(String name) {
22
	super(name);
22
	super(name);
Lines 84-105 Link Here
84
		"7. WARNING in Y.java (at line 9)\n" +
84
		"7. WARNING in Y.java (at line 9)\n" +
85
		"	p.X x;\n" +
85
		"	p.X x;\n" +
86
		"	^^^\n" +
86
		"	^^^\n" +
87
		"The type X is deprecated\n" +
87
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
88
		"----------\n" +
88
		"----------\n" +
89
		"8. WARNING in Y.java (at line 9)\n" +
89
		"8. WARNING in Y.java (at line 9)\n" +
90
		"	p.X x;\n" +
90
		"	p.X x;\n" +
91
		"	^^^\n" +
91
		"	  ^\n" +
92
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
92
		"The type X<T> is deprecated\n" +
93
		"----------\n" +
93
		"----------\n" +
94
		"9. WARNING in Y.java (at line 10)\n" +
94
		"9. WARNING in Y.java (at line 10)\n" +
95
		"	p.X[] xs = { x };\n" +
95
		"	p.X[] xs = { x };\n" +
96
		"	^^^\n" +
96
		"	^^^\n" +
97
		"The type X is deprecated\n" +
97
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
98
		"----------\n" +
98
		"----------\n" +
99
		"10. WARNING in Y.java (at line 10)\n" +
99
		"10. WARNING in Y.java (at line 10)\n" +
100
		"	p.X[] xs = { x };\n" +
100
		"	p.X[] xs = { x };\n" +
101
		"	^^^\n" +
101
		"	  ^\n" +
102
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
102
		"The type X<T> is deprecated\n" +
103
		"----------\n",
103
		"----------\n",
104
		null,
104
		null,
105
		true,
105
		true,
Lines 138-154 Link Here
138
		"----------\n" +
138
		"----------\n" +
139
		"1. ERROR in p\\M1.java (at line 4)\n" +
139
		"1. ERROR in p\\M1.java (at line 4)\n" +
140
		"	a.N1.N2.N3 m = null;\n" +
140
		"	a.N1.N2.N3 m = null;\n" +
141
		"	^^^^^^^\n" +
141
		"	     ^^\n" +
142
		"The type N1.N2 is deprecated\n" +
142
		"The type N1.N2 is deprecated\n" +
143
		"----------\n" +
143
		"----------\n" +
144
		"2. ERROR in p\\M1.java (at line 4)\n" +
144
		"2. ERROR in p\\M1.java (at line 4)\n" +
145
		"	a.N1.N2.N3 m = null;\n" +
145
		"	a.N1.N2.N3 m = null;\n" +
146
		"	^^^^^^^^^^\n" +
146
		"	        ^^\n" +
147
		"The type N1.N2.N3 is deprecated\n" +
147
		"The type N1.N2.N3 is deprecated\n" +
148
		"----------\n" +
148
		"----------\n" +
149
		"3. ERROR in p\\M1.java (at line 5)\n" +
149
		"3. ERROR in p\\M1.java (at line 5)\n" +
150
		"	m.foo();\n" +
150
		"	m.foo();\n" +
151
		"	^^^^^^^\n" +
151
		"	  ^^^^^\n" +
152
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
152
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
153
		"----------\n",
153
		"----------\n",
154
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
154
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java (-13 / +88 lines)
Lines 164-170 Link Here
164
		"----------\n" +
164
		"----------\n" +
165
		"2. WARNING in p\\Warning.java (at line 7)\n" +
165
		"2. WARNING in p\\Warning.java (at line 7)\n" +
166
		"	dateObj.UTC(1,2,3,4,5,6);\n" +
166
		"	dateObj.UTC(1,2,3,4,5,6);\n" +
167
		"	^^^^^^^^^^^^^^^^^^^^^^^^\n" +
167
		"	        ^^^^^^^^^^^^^^^^\n" +
168
		"The method UTC(int, int, int, int, int, int) from the type Date is deprecated\n" +
168
		"The method UTC(int, int, int, int, int, int) from the type Date is deprecated\n" +
169
		"----------\n");
169
		"----------\n");
170
}
170
}
Lines 197-203 Link Here
197
		"----------\n" +
197
		"----------\n" +
198
		"1. WARNING in A.java (at line 1)\n" +
198
		"1. WARNING in A.java (at line 1)\n" +
199
		"	public class A extends X.Y {}\n" +
199
		"	public class A extends X.Y {}\n" +
200
		"	                       ^^^\n" +
200
		"	                         ^\n" +
201
		"The type X.Y is deprecated\n" +
201
		"The type X.Y is deprecated\n" +
202
		"----------\n",// expected output
202
		"----------\n",// expected output
203
		null,
203
		null,
Lines 549-560 Link Here
549
		"----------\n" +
549
		"----------\n" +
550
		"5. WARNING in Y.java (at line 9)\n" +
550
		"5. WARNING in Y.java (at line 9)\n" +
551
		"	p.X x;\n" +
551
		"	p.X x;\n" +
552
		"	^^^\n" +
552
		"	  ^\n" +
553
		"The type X is deprecated\n" +
553
		"The type X is deprecated\n" +
554
		"----------\n" +
554
		"----------\n" +
555
		"6. WARNING in Y.java (at line 10)\n" +
555
		"6. WARNING in Y.java (at line 10)\n" +
556
		"	p.X[] xs = { x };\n" +
556
		"	p.X[] xs = { x };\n" +
557
		"	^^^\n" +
557
		"	  ^\n" +
558
		"The type X is deprecated\n" +
558
		"The type X is deprecated\n" +
559
		"----------\n");
559
		"----------\n");
560
}
560
}
Lines 594-610 Link Here
594
		"----------\n" + /* expected compiler log */
594
		"----------\n" + /* expected compiler log */
595
		"1. ERROR in p\\M1.java (at line 4)\n" +
595
		"1. ERROR in p\\M1.java (at line 4)\n" +
596
		"	a.N1.N2.N3 m = null;\n" +
596
		"	a.N1.N2.N3 m = null;\n" +
597
		"	^^^^^^^\n" +
597
		"	     ^^\n" +
598
		"The type N1.N2 is deprecated\n" +
598
		"The type N1.N2 is deprecated\n" +
599
		"----------\n" +
599
		"----------\n" +
600
		"2. ERROR in p\\M1.java (at line 4)\n" +
600
		"2. ERROR in p\\M1.java (at line 4)\n" +
601
		"	a.N1.N2.N3 m = null;\n" +
601
		"	a.N1.N2.N3 m = null;\n" +
602
		"	^^^^^^^^^^\n" +
602
		"	        ^^\n" +
603
		"The type N1.N2.N3 is deprecated\n" +
603
		"The type N1.N2.N3 is deprecated\n" +
604
		"----------\n" +
604
		"----------\n" +
605
		"3. ERROR in p\\M1.java (at line 5)\n" +
605
		"3. ERROR in p\\M1.java (at line 5)\n" +
606
		"	m.foo();\n" +
606
		"	m.foo();\n" +
607
		"	^^^^^^^\n" +
607
		"	  ^^^^^\n" +
608
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
608
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
609
		"----------\n",
609
		"----------\n",
610
		// javac options
610
		// javac options
Lines 646-662 Link Here
646
		"----------\n" + /* expected compiler log */
646
		"----------\n" + /* expected compiler log */
647
		"1. ERROR in p\\M1.java (at line 4)\n" +
647
		"1. ERROR in p\\M1.java (at line 4)\n" +
648
		"	a.N1.N2.N3 m = null;\n" +
648
		"	a.N1.N2.N3 m = null;\n" +
649
		"	^^^^^^^\n" +
649
		"	     ^^\n" +
650
		"The type N1.N2 is deprecated\n" +
650
		"The type N1.N2 is deprecated\n" +
651
		"----------\n" +
651
		"----------\n" +
652
		"2. ERROR in p\\M1.java (at line 4)\n" +
652
		"2. ERROR in p\\M1.java (at line 4)\n" +
653
		"	a.N1.N2.N3 m = null;\n" +
653
		"	a.N1.N2.N3 m = null;\n" +
654
		"	^^^^^^^^^^\n" +
654
		"	        ^^\n" +
655
		"The type N1.N2.N3 is deprecated\n" +
655
		"The type N1.N2.N3 is deprecated\n" +
656
		"----------\n" +
656
		"----------\n" +
657
		"3. ERROR in p\\M1.java (at line 5)\n" +
657
		"3. ERROR in p\\M1.java (at line 5)\n" +
658
		"	m.foo();\n" +
658
		"	m.foo();\n" +
659
		"	^^^^^^^\n" +
659
		"	  ^^^^^\n" +
660
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
660
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
661
		"----------\n",
661
		"----------\n",
662
		// javac options
662
		// javac options
Lines 742-758 Link Here
742
		"----------\n" + /* expected compiler log */
742
		"----------\n" + /* expected compiler log */
743
		"1. ERROR in p\\M1.java (at line 4)\n" +
743
		"1. ERROR in p\\M1.java (at line 4)\n" +
744
		"	a.N1.N2.N3 m = null;\n" +
744
		"	a.N1.N2.N3 m = null;\n" +
745
		"	^^^^^^^\n" +
745
		"	     ^^\n" +
746
		"The type N1.N2 is deprecated\n" +
746
		"The type N1.N2 is deprecated\n" +
747
		"----------\n" +
747
		"----------\n" +
748
		"2. ERROR in p\\M1.java (at line 4)\n" +
748
		"2. ERROR in p\\M1.java (at line 4)\n" +
749
		"	a.N1.N2.N3 m = null;\n" +
749
		"	a.N1.N2.N3 m = null;\n" +
750
		"	^^^^^^^^^^\n" +
750
		"	        ^^\n" +
751
		"The type N1.N2.N3 is deprecated\n" +
751
		"The type N1.N2.N3 is deprecated\n" +
752
		"----------\n" +
752
		"----------\n" +
753
		"3. ERROR in p\\M1.java (at line 5)\n" +
753
		"3. ERROR in p\\M1.java (at line 5)\n" +
754
		"	m.foo();\n" +
754
		"	m.foo();\n" +
755
		"	^^^^^^^\n" +
755
		"	  ^^^^^\n" +
756
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
756
		"The method foo() from the type N1.N2.N3 is deprecated\n" +
757
		"----------\n",
757
		"----------\n",
758
		// javac options
758
		// javac options
Lines 799-804 Link Here
799
		// javac options
799
		// javac options
800
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
800
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
801
}
801
}
802
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
803
public void test020() {
804
	Map customOptions = new HashMap();
805
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
806
	runNegativeTest(
807
		// test directory preparation
808
		true /* flush output directory */,
809
		new String[] { /* test files */
810
			"a.b.c.d/Deprecated.java",
811
			"package a.b.c.d;\n" +
812
			"public class Deprecated {\n" +
813
			"	/** @deprecated */\n" +
814
			"	public class Inner {\n" +
815
			"		/** @deprecated */\n" +
816
			"		public class Inn {\n" +
817
			"		}\n" +
818
			"	}\n" +
819
			"	/** @deprecated */\n" +
820
			"	public Deprecated foo(){ return null;}\n" +
821
			"	/** @deprecated */\n" +
822
			"	public Deprecated goo(){ return null;}\n" +
823
			"	/** @deprecated */\n" +
824
			"	public static Deprecated bar(){ return null;}\n" +
825
			"}\n",
826
			"a.b.c.d.e/T.java",
827
			"package a.b.c.d.e;\n" +
828
			"import a.b.c.d.Deprecated;\n" +
829
			"public class T {\n" +
830
			"	a.b.c.d.Deprecated f;\n" +
831
			"	a.b.c.d.Deprecated.Inner.Inn g;\n" +
832
			"	Deprecated.Inner i;\n" +
833
			"	public void m() {\n" +
834
			"		f.foo().goo();\n" +
835
			"		a.b.c.d.Deprecated.bar();\n" +
836
			"	}\n" +
837
			"}"
838
		},
839
		// compiler options
840
		null /* no class libraries */,
841
		customOptions /* custom options */,
842
		// compiler results
843
		"----------\n" + /* expected compiler log */
844
		"1. ERROR in a.b.c.d.e\\T.java (at line 5)\n" + 
845
		"	a.b.c.d.Deprecated.Inner.Inn g;\n" + 
846
		"	                   ^^^^^\n" + 
847
		"The type Deprecated.Inner is deprecated\n" + 
848
		"----------\n" + 
849
		"2. ERROR in a.b.c.d.e\\T.java (at line 5)\n" + 
850
		"	a.b.c.d.Deprecated.Inner.Inn g;\n" + 
851
		"	                         ^^^\n" + 
852
		"The type Deprecated.Inner.Inn is deprecated\n" + 
853
		"----------\n" + 
854
		"3. ERROR in a.b.c.d.e\\T.java (at line 6)\n" + 
855
		"	Deprecated.Inner i;\n" + 
856
		"	           ^^^^^\n" + 
857
		"The type Deprecated.Inner is deprecated\n" + 
858
		"----------\n" + 
859
		"4. ERROR in a.b.c.d.e\\T.java (at line 8)\n" + 
860
		"	f.foo().goo();\n" + 
861
		"	  ^^^^^\n" + 
862
		"The method foo() from the type Deprecated is deprecated\n" + 
863
		"----------\n" + 
864
		"5. ERROR in a.b.c.d.e\\T.java (at line 8)\n" + 
865
		"	f.foo().goo();\n" + 
866
		"	        ^^^^^\n" + 
867
		"The method goo() from the type Deprecated is deprecated\n" + 
868
		"----------\n" + 
869
		"6. ERROR in a.b.c.d.e\\T.java (at line 9)\n" + 
870
		"	a.b.c.d.Deprecated.bar();\n" + 
871
		"	                   ^^^^^\n" + 
872
		"The method bar() from the type Deprecated is deprecated\n" + 
873
		"----------\n",
874
		// javac options
875
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
876
}
802
public static Class testClass() {
877
public static Class testClass() {
803
	return DeprecatedTest.class;
878
	return DeprecatedTest.class;
804
}
879
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-1 / +6 lines)
Lines 30-36 Link Here
30
	// Static initializer to specify tests subset using TESTS_* static variables
30
	// Static initializer to specify tests subset using TESTS_* static variables
31
	// All specified tests which does not belong to the class are skipped...
31
	// All specified tests which does not belong to the class are skipped...
32
	static {
32
	static {
33
//		TESTS_NAMES = new String[] { "test0788" };
33
//		TESTS_NAMES = new String[] { "test1245" };
34
//		TESTS_NUMBERS = new int[] { 1455 };
34
//		TESTS_NUMBERS = new int[] { 1455 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
36
	}
36
	}
Lines 42628-42633 Link Here
42628
		"	public class X<T extends Secondary.Private> {\n" +
42628
		"	public class X<T extends Secondary.Private> {\n" +
42629
		"	                         ^^^^^^^^^^^^^^^^^\n" +
42629
		"	                         ^^^^^^^^^^^^^^^^^\n" +
42630
		"The type Secondary.Private is not visible\n" +
42630
		"The type Secondary.Private is not visible\n" +
42631
		"----------\n" +
42632
		"2. WARNING in X.java (at line 4)\n" + 
42633
		"	static private class Private {}\n" + 
42634
		"	                     ^^^^^^^\n" + 
42635
		"The type Secondary.Private is never used locally\n" + 
42631
		"----------\n");
42636
		"----------\n");
42632
}
42637
}
42633
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
42638
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
(-)src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java (-8 / +8 lines)
Lines 5491-5502 Link Here
5491
		"----------\n" +
5491
		"----------\n" +
5492
		"3. WARNING in p\\X.java (at line 6)\n" +
5492
		"3. WARNING in p\\X.java (at line 6)\n" +
5493
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5493
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5494
		"	^^^^\n" +
5494
		"	  ^^\n" +
5495
		"The type A.M2 is deprecated\n" +
5495
		"The type A.M2 is deprecated\n" +
5496
		"----------\n" +
5496
		"----------\n" +
5497
		"4. WARNING in p\\X.java (at line 6)\n" +
5497
		"4. WARNING in p\\X.java (at line 6)\n" +
5498
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5498
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5499
		"	^^^^^^^^\n" +
5499
		"	     ^^^\n" +
5500
		"The type A.M1.MM1 is deprecated\n" +
5500
		"The type A.M1.MM1 is deprecated\n" +
5501
		"----------\n" +
5501
		"----------\n" +
5502
		"5. WARNING in p\\X.java (at line 6)\n" +
5502
		"5. WARNING in p\\X.java (at line 6)\n" +
Lines 5506-5517 Link Here
5506
		"----------\n" +
5506
		"----------\n" +
5507
		"6. WARNING in p\\X.java (at line 6)\n" +
5507
		"6. WARNING in p\\X.java (at line 6)\n" +
5508
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5508
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5509
		"	                ^^^^\n" +
5509
		"	                  ^^\n" +
5510
		"The type A.M2 is deprecated\n" +
5510
		"The type A.M2 is deprecated\n" +
5511
		"----------\n" +
5511
		"----------\n" +
5512
		"7. WARNING in p\\X.java (at line 6)\n" +
5512
		"7. WARNING in p\\X.java (at line 6)\n" +
5513
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5513
		"	A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
5514
		"	                ^^^^^^^^\n" +
5514
		"	                     ^^^\n" +
5515
		"The type A.M1.MM1 is deprecated\n" +
5515
		"The type A.M1.MM1 is deprecated\n" +
5516
		"----------\n" +
5516
		"----------\n" +
5517
		"8. WARNING in p\\X.java (at line 7)\n" +
5517
		"8. WARNING in p\\X.java (at line 7)\n" +
Lines 5521-5532 Link Here
5521
		"----------\n" +
5521
		"----------\n" +
5522
		"9. WARNING in p\\X.java (at line 7)\n" +
5522
		"9. WARNING in p\\X.java (at line 7)\n" +
5523
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5523
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5524
		"	^^^^\n" +
5524
		"	  ^^\n" +
5525
		"The type A.M2 is deprecated\n" +
5525
		"The type A.M2 is deprecated\n" +
5526
		"----------\n" +
5526
		"----------\n" +
5527
		"10. WARNING in p\\X.java (at line 7)\n" +
5527
		"10. WARNING in p\\X.java (at line 7)\n" +
5528
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5528
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5529
		"	^^^^^^^^\n" +
5529
		"	     ^^^\n" +
5530
		"The type A.M1.MM1 is deprecated\n" +
5530
		"The type A.M1.MM1 is deprecated\n" +
5531
		"----------\n" +
5531
		"----------\n" +
5532
		"11. WARNING in p\\X.java (at line 7)\n" +
5532
		"11. WARNING in p\\X.java (at line 7)\n" +
Lines 5536-5547 Link Here
5536
		"----------\n" +
5536
		"----------\n" +
5537
		"12. WARNING in p\\X.java (at line 7)\n" +
5537
		"12. WARNING in p\\X.java (at line 7)\n" +
5538
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5538
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5539
		"	                   ^^^^\n" +
5539
		"	                     ^^\n" +
5540
		"The type A.M2 is deprecated\n" +
5540
		"The type A.M2 is deprecated\n" +
5541
		"----------\n" +
5541
		"----------\n" +
5542
		"13. WARNING in p\\X.java (at line 7)\n" +
5542
		"13. WARNING in p\\X.java (at line 7)\n" +
5543
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5543
		"	A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
5544
		"	                   ^^^^^^^^\n" +
5544
		"	                        ^^^\n" +
5545
		"The type A.M1.MM1 is deprecated\n" +
5545
		"The type A.M1.MM1 is deprecated\n" +
5546
		"----------\n" +
5546
		"----------\n" +
5547
		"14. ERROR in p\\X.java (at line 16)\n" +
5547
		"14. ERROR in p\\X.java (at line 16)\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (-1 / +1 lines)
Lines 3386-3392 Link Here
3386
		"----------\n" +
3386
		"----------\n" +
3387
		"1. ERROR in X.java (at line 12)\n" +
3387
		"1. ERROR in X.java (at line 12)\n" +
3388
		"	new Y().bar();\n" +
3388
		"	new Y().bar();\n" +
3389
		"	^^^^^^^^^^^^^\n" +
3389
		"	        ^^^^^\n" +
3390
		"The method bar() from the type Y is deprecated\n" +
3390
		"The method bar() from the type Y is deprecated\n" +
3391
		"----------\n",
3391
		"----------\n",
3392
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
3392
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java (-4 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 66-72 Link Here
66
			"----------\n"
66
			"----------\n"
67
				+ "1. WARNING in X.java (at line 4)\n"
67
				+ "1. WARNING in X.java (at line 4)\n"
68
				+ "	new Z();\n"
68
				+ "	new Z();\n"
69
				+ "	^^^^^^^\n"
69
				+ "	    ^^^\n"
70
				+ "The constructor Z() is deprecated\n"
70
				+ "The constructor Z() is deprecated\n"
71
				+ "----------\n",
71
				+ "----------\n",
72
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
72
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
Lines 100-106 Link Here
100
			"----------\n"
100
			"----------\n"
101
				+ "1. WARNING in X.java (at line 4)\n"
101
				+ "1. WARNING in X.java (at line 4)\n"
102
				+ "	new Z(2);\n"
102
				+ "	new Z(2);\n"
103
				+ "	^^^^^^^^\n"
103
				+ "	    ^^^^\n"
104
				+ "The constructor Z(int) is deprecated\n"
104
				+ "The constructor Z(int) is deprecated\n"
105
				+ "----------\n");
105
				+ "----------\n");
106
	}
106
	}
Lines 135-141 Link Here
135
			"----------\n"
135
			"----------\n"
136
				+ "1. WARNING in X.java (at line 4)\n"
136
				+ "1. WARNING in X.java (at line 4)\n"
137
				+ "	new Z();\n"
137
				+ "	new Z();\n"
138
				+ "	^^^^^^^\n"
138
				+ "	    ^^^\n"
139
				+ "The constructor Z() is deprecated\n"
139
				+ "The constructor Z() is deprecated\n"
140
				+ "----------\n"
140
				+ "----------\n"
141
				+ "----------\n"
141
				+ "----------\n"
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java (-4 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 983-989 Link Here
983
			"----------\n"
983
			"----------\n"
984
				+ "1. WARNING in X.java (at line 3)\n"
984
				+ "1. WARNING in X.java (at line 3)\n"
985
				+ "	x.foo();\n"
985
				+ "	x.foo();\n"
986
				+ "	^^^^^^^\n"
986
				+ "	  ^^^^^\n"
987
				+ "The method foo() from the type IX is deprecated\n"
987
				+ "The method foo() from the type IX is deprecated\n"
988
				+ "----------\n",
988
				+ "----------\n",
989
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
989
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
Lines 1075-1081 Link Here
1075
			"----------\n"
1075
			"----------\n"
1076
				+ "1. WARNING in X.java (at line 4)\n"
1076
				+ "1. WARNING in X.java (at line 4)\n"
1077
				+ "	x.foo(2);\n"
1077
				+ "	x.foo(2);\n"
1078
				+ "	^^^^^^^^\n"
1078
				+ "	  ^^^^^^\n"
1079
				+ "The method foo(int) from the type IX is deprecated\n"
1079
				+ "The method foo(int) from the type IX is deprecated\n"
1080
				+ "----------\n");
1080
				+ "----------\n");
1081
	}
1081
	}
Lines 1109-1115 Link Here
1109
			"----------\n"
1109
			"----------\n"
1110
				+ "1. WARNING in X.java (at line 4)\n"
1110
				+ "1. WARNING in X.java (at line 4)\n"
1111
				+ "	x.foo(2);\n"
1111
				+ "	x.foo(2);\n"
1112
				+ "	^^^^^^^^\n"
1112
				+ "	  ^^^^^^\n"
1113
				+ "The method foo(int) from the type IX is deprecated\n"
1113
				+ "The method foo(int) from the type IX is deprecated\n"
1114
				+ "----------\n"
1114
				+ "----------\n"
1115
				+ "----------\n"
1115
				+ "----------\n"
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java (-8 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 76-82 Link Here
76
			"----------\n"
76
			"----------\n"
77
				+ "1. WARNING in X.java (at line 4)\n"
77
				+ "1. WARNING in X.java (at line 4)\n"
78
				+ "	new Z().foo();\n"
78
				+ "	new Z().foo();\n"
79
				+ "	^^^^^^^^^^^^^\n"
79
				+ "	        ^^^^^\n"
80
				+ "The method foo() from the type Z is deprecated\n"
80
				+ "The method foo() from the type Z is deprecated\n"
81
				+ "----------\n",
81
				+ "----------\n",
82
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
82
				null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
Lines 173-179 Link Here
173
		"----------\n" +
173
		"----------\n" +
174
		"1. WARNING in X.java (at line 4)\n" +
174
		"1. WARNING in X.java (at line 4)\n" +
175
		"	new Z().foo(2);\n" +
175
		"	new Z().foo(2);\n" +
176
		"	^^^^^^^^^^^^^^\n" +
176
		"	        ^^^^^^\n" +
177
		"The method foo(int) from the type Z is deprecated\n" +
177
		"The method foo(int) from the type Z is deprecated\n" +
178
		"----------\n"
178
		"----------\n"
179
				);
179
				);
Lines 210-216 Link Here
210
		"----------\n" +
210
		"----------\n" +
211
		"1. WARNING in X.java (at line 4)\n" +
211
		"1. WARNING in X.java (at line 4)\n" +
212
		"	new Z().foo(2);\n" +
212
		"	new Z().foo(2);\n" +
213
		"	^^^^^^^^^^^^^^\n" +
213
		"	        ^^^^^^\n" +
214
		"The method foo(int) from the type Z is deprecated\n" +
214
		"The method foo(int) from the type Z is deprecated\n" +
215
		"----------\n" +
215
		"----------\n" +
216
		"----------\n" +
216
		"----------\n" +
Lines 278-284 Link Here
278
		"----------\n" +
278
		"----------\n" +
279
		"1. WARNING in X.java (at line 4)\n" +
279
		"1. WARNING in X.java (at line 4)\n" +
280
		"	new Z().foo(2);\n" +
280
		"	new Z().foo(2);\n" +
281
		"	^^^^^^^^^^^^^^\n" +
281
		"	        ^^^^^^\n" +
282
		"The method foo(int) from the type Z is deprecated\n" +
282
		"The method foo(int) from the type Z is deprecated\n" +
283
		"----------\n"
283
		"----------\n"
284
				);
284
				);
Lines 316-322 Link Here
316
		"----------\n" +
316
		"----------\n" +
317
		"1. WARNING in X.java (at line 4)\n" +
317
		"1. WARNING in X.java (at line 4)\n" +
318
		"	new Z().foo(2);\n" +
318
		"	new Z().foo(2);\n" +
319
		"	^^^^^^^^^^^^^^\n" +
319
		"	        ^^^^^^\n" +
320
		"The method foo(int) from the type Z is deprecated\n" +
320
		"The method foo(int) from the type Z is deprecated\n" +
321
		"----------\n" +
321
		"----------\n" +
322
		"----------\n" +
322
		"----------\n" +
Lines 384-390 Link Here
384
		"----------\n" +
384
		"----------\n" +
385
		"1. WARNING in X.java (at line 4)\n" +
385
		"1. WARNING in X.java (at line 4)\n" +
386
		"	new Z().foo(2);\n" +
386
		"	new Z().foo(2);\n" +
387
		"	^^^^^^^^^^^^^^\n" +
387
		"	        ^^^^^^\n" +
388
		"The method foo(int) from the type Z is deprecated\n" +
388
		"The method foo(int) from the type Z is deprecated\n" +
389
		"----------\n"
389
		"----------\n"
390
				);
390
				);
Lines 421-427 Link Here
421
		"----------\n" +
421
		"----------\n" +
422
		"1. WARNING in X.java (at line 4)\n" +
422
		"1. WARNING in X.java (at line 4)\n" +
423
		"	new Z().foo(2);\n" +
423
		"	new Z().foo(2);\n" +
424
		"	^^^^^^^^^^^^^^\n" +
424
		"	        ^^^^^^\n" +
425
		"The method foo(int) from the type Z is deprecated\n" +
425
		"The method foo(int) from the type Z is deprecated\n" +
426
		"----------\n" +
426
		"----------\n" +
427
		"----------\n" +
427
		"----------\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java (-1 / +6 lines)
Lines 3359-3365 Link Here
3359
			"	^\n" +
3359
			"	^\n" +
3360
			"The type Foo.Private is not visible\n" +
3360
			"The type Foo.Private is not visible\n" +
3361
			"----------\n" +
3361
			"----------\n" +
3362
			"3. WARNING in X.java (at line 13)\n" +
3362
			"3. WARNING in X.java (at line 12)\n" +
3363
			"	private class Private {\n" + 
3364
			"	              ^^^^^^^\n" + 
3365
			"The type Foo.Private is never used locally\n" + 
3366
			"----------\n" + 
3367
			"4. WARNING in X.java (at line 13)\n" +
3363
			"	private void foo(){}\n" +
3368
			"	private void foo(){}\n" +
3364
			"	             ^^^^^\n" +
3369
			"	             ^^^^^\n" +
3365
			"The method foo() from the type Foo.Private is never used locally\n" +
3370
			"The method foo() from the type Foo.Private is never used locally\n" +

Return to bug 300031