Lines 1295-1300
Link Here
|
1295 |
} |
1295 |
} |
1296 |
return null; // should never reach this point |
1296 |
return null; // should never reach this point |
1297 |
} |
1297 |
} |
|
|
1298 |
private void reportDeprecatedUsagesFor(MethodBinding method) { |
1299 |
// Deferred deprecation reporting. Now that the method verification is over, we are able to discover if |
1300 |
// ``method'' overrides an abstract method. If it does and that method is deprecated, then ``method'' itself |
1301 |
// should be considered to be implicitly deprecated. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206 |
1302 |
if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) |
1303 |
return; |
1304 |
|
1305 |
AbstractMethodDeclaration methodDecl = method.sourceMethod(); |
1306 |
if (methodDecl == null) |
1307 |
return; // method could not be resolved in previous iteration |
1308 |
|
1309 |
TypeReference[] exceptionTypes = methodDecl.thrownExceptions; |
1310 |
if (exceptionTypes != null) { |
1311 |
int size = exceptionTypes.length; |
1312 |
for (int i = 0; i < size; i++) { |
1313 |
TypeReference anException = exceptionTypes[i]; |
1314 |
if (anException != null && anException.resolvedType != null) { |
1315 |
if(!anException.resolvedType.isValidBinding()) |
1316 |
continue; |
1317 |
if (anException.isTypeUseDeprecated(anException.resolvedType, methodDecl.scope)) { |
1318 |
methodDecl.scope.problemReporter().deprecatedType(anException.resolvedType, anException); |
1319 |
} |
1320 |
} |
1321 |
} |
1322 |
} |
1323 |
|
1324 |
Argument[] arguments = methodDecl.arguments; |
1325 |
if (arguments != null) { |
1326 |
int size = arguments.length; |
1327 |
|
1328 |
for (int i = 0; i < size; i++) { |
1329 |
Argument anArgument = arguments[i]; |
1330 |
if (anArgument != null && anArgument.type != null && anArgument.type.resolvedType != null) { |
1331 |
if (!anArgument.type.resolvedType.isValidBinding()) |
1332 |
continue; |
1333 |
if (anArgument.isTypeUseDeprecated(anArgument.type.resolvedType, methodDecl.scope)) { |
1334 |
methodDecl.scope.problemReporter().deprecatedType(anArgument.type.resolvedType, anArgument); |
1335 |
} |
1336 |
} |
1337 |
} |
1338 |
} |
1339 |
|
1340 |
if (!method.isConstructor() && methodDecl instanceof MethodDeclaration) { |
1341 |
TypeReference returnType = ((MethodDeclaration) methodDecl).returnType; |
1342 |
if (returnType != null && returnType.resolvedType != null && returnType.resolvedType.isValidBinding()) { |
1343 |
if (returnType.isTypeUseDeprecated(returnType.resolvedType, methodDecl.scope)) { |
1344 |
methodDecl.scope.problemReporter().deprecatedType(returnType.resolvedType, returnType); |
1345 |
} |
1346 |
} |
1347 |
} |
1348 |
} |
1298 |
public MethodBinding resolveTypesFor(MethodBinding method) { |
1349 |
public MethodBinding resolveTypesFor(MethodBinding method) { |
1299 |
if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) |
1350 |
if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) |
1300 |
return method; |
1351 |
return method; |
Lines 1617-1620
Link Here
|
1617 |
for (int i = this.memberTypes.length; --i >= 0;) |
1668 |
for (int i = this.memberTypes.length; --i >= 0;) |
1618 |
((SourceTypeBinding) this.memberTypes[i]).verifyMethods(verifier); |
1669 |
((SourceTypeBinding) this.memberTypes[i]).verifyMethods(verifier); |
1619 |
} |
1670 |
} |
|
|
1671 |
void reportDeprecatedTypesInSignatures() { |
1672 |
|
1673 |
for (int i = 0, length = this.methods.length; i < length; i++) |
1674 |
this.reportDeprecatedUsagesFor(this.methods[i]); |
1675 |
|
1676 |
for (int i = this.memberTypes.length; --i >= 0;) |
1677 |
((SourceTypeBinding) this.memberTypes[i]).reportDeprecatedTypesInSignatures(); |
1678 |
|
1679 |
} |
1620 |
} |
1680 |
} |