Lines 309-315
Link Here
|
309 |
} |
309 |
} |
310 |
|
310 |
|
311 |
// @param tags |
311 |
// @param tags |
312 |
resolveParamTags(methScope, reportMissing); |
312 |
boolean considerParamRefAsUsage = !methScope.compilerOptions().reportUnusedParameterWhenDocumented; |
|
|
313 |
resolveParamTags(methScope, reportMissing, considerParamRefAsUsage); |
313 |
resolveTypeParameterTags(methScope, reportMissing); |
314 |
resolveTypeParameterTags(methScope, reportMissing); |
314 |
|
315 |
|
315 |
// @return tags |
316 |
// @return tags |
Lines 339-345
Link Here
|
339 |
// Resolve param tags with invalid syntax |
340 |
// Resolve param tags with invalid syntax |
340 |
int length = this.invalidParameters == null ? 0 : this.invalidParameters.length; |
341 |
int length = this.invalidParameters == null ? 0 : this.invalidParameters.length; |
341 |
for (int i = 0; i < length; i++) { |
342 |
for (int i = 0; i < length; i++) { |
342 |
this.invalidParameters[i].resolve(methScope, false); |
343 |
this.invalidParameters[i].resolve(methScope, false, false); |
343 |
} |
344 |
} |
344 |
} |
345 |
} |
345 |
|
346 |
|
Lines 445-470
Link Here
|
445 |
/* |
446 |
/* |
446 |
* Resolve @param tags while method scope |
447 |
* Resolve @param tags while method scope |
447 |
*/ |
448 |
*/ |
448 |
private void resolveParamTags(MethodScope methScope, boolean reportMissing) { |
449 |
private void resolveParamTags(MethodScope scope, boolean reportMissing, boolean considerParamRefAsUsage) { |
449 |
AbstractMethodDeclaration md = methScope.referenceMethod(); |
450 |
AbstractMethodDeclaration methodDecl = scope.referenceMethod(); |
450 |
int paramTagsSize = this.paramReferences == null ? 0 : this.paramReferences.length; |
451 |
int paramTagsSize = this.paramReferences == null ? 0 : this.paramReferences.length; |
451 |
|
452 |
|
452 |
// If no referenced method (field initializer for example) then report a problem for each param tag |
453 |
// If no referenced method (field initializer for example) then report a problem for each param tag |
453 |
if (md == null) { |
454 |
if (methodDecl == null) { |
454 |
for (int i = 0; i < paramTagsSize; i++) { |
455 |
for (int i = 0; i < paramTagsSize; i++) { |
455 |
JavadocSingleNameReference param = this.paramReferences[i]; |
456 |
JavadocSingleNameReference param = this.paramReferences[i]; |
456 |
methScope.problemReporter().javadocUnexpectedTag(param.tagSourceStart, param.tagSourceEnd); |
457 |
scope.problemReporter().javadocUnexpectedTag(param.tagSourceStart, param.tagSourceEnd); |
457 |
} |
458 |
} |
458 |
return; |
459 |
return; |
459 |
} |
460 |
} |
460 |
|
461 |
|
461 |
// If no param tags then report a problem for each method argument |
462 |
// If no param tags then report a problem for each method argument |
462 |
int argumentsSize = md.arguments == null ? 0 : md.arguments.length; |
463 |
int argumentsSize = methodDecl.arguments == null ? 0 : methodDecl.arguments.length; |
463 |
if (paramTagsSize == 0) { |
464 |
if (paramTagsSize == 0) { |
464 |
if (reportMissing) { |
465 |
if (reportMissing) { |
465 |
for (int i = 0; i < argumentsSize; i++) { |
466 |
for (int i = 0; i < argumentsSize; i++) { |
466 |
Argument arg = md.arguments[i]; |
467 |
Argument arg = methodDecl.arguments[i]; |
467 |
methScope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, md.binding.modifiers); |
468 |
scope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, methodDecl.binding.modifiers); |
468 |
} |
469 |
} |
469 |
} |
470 |
} |
470 |
} else { |
471 |
} else { |
Lines 474-486
Link Here
|
474 |
// Scan all @param tags |
475 |
// Scan all @param tags |
475 |
for (int i = 0; i < paramTagsSize; i++) { |
476 |
for (int i = 0; i < paramTagsSize; i++) { |
476 |
JavadocSingleNameReference param = this.paramReferences[i]; |
477 |
JavadocSingleNameReference param = this.paramReferences[i]; |
477 |
param.resolve(methScope); |
478 |
param.resolve(scope, true, considerParamRefAsUsage); |
478 |
if (param.binding != null && param.binding.isValidBinding()) { |
479 |
if (param.binding != null && param.binding.isValidBinding()) { |
479 |
// Verify duplicated tags |
480 |
// Verify duplicated tags |
480 |
boolean found = false; |
481 |
boolean found = false; |
481 |
for (int j = 0; j < maxBindings && !found; j++) { |
482 |
for (int j = 0; j < maxBindings && !found; j++) { |
482 |
if (bindings[j] == param.binding) { |
483 |
if (bindings[j] == param.binding) { |
483 |
methScope.problemReporter().javadocDuplicatedParamTag(param.token, param.sourceStart, param.sourceEnd, md.binding.modifiers); |
484 |
scope.problemReporter().javadocDuplicatedParamTag(param.token, param.sourceStart, param.sourceEnd, methodDecl.binding.modifiers); |
484 |
found = true; |
485 |
found = true; |
485 |
} |
486 |
} |
486 |
} |
487 |
} |
Lines 493-499
Link Here
|
493 |
// Look for undocumented arguments |
494 |
// Look for undocumented arguments |
494 |
if (reportMissing) { |
495 |
if (reportMissing) { |
495 |
for (int i = 0; i < argumentsSize; i++) { |
496 |
for (int i = 0; i < argumentsSize; i++) { |
496 |
Argument arg = md.arguments[i]; |
497 |
Argument arg = methodDecl.arguments[i]; |
497 |
boolean found = false; |
498 |
boolean found = false; |
498 |
for (int j = 0; j < maxBindings && !found; j++) { |
499 |
for (int j = 0; j < maxBindings && !found; j++) { |
499 |
LocalVariableBinding binding = bindings[j]; |
500 |
LocalVariableBinding binding = bindings[j]; |
Lines 502-508
Link Here
|
502 |
} |
503 |
} |
503 |
} |
504 |
} |
504 |
if (!found) { |
505 |
if (!found) { |
505 |
methScope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, md.binding.modifiers); |
506 |
scope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, methodDecl.binding.modifiers); |
506 |
} |
507 |
} |
507 |
} |
508 |
} |
508 |
} |
509 |
} |