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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (+2 lines)
Lines 851-856 Link Here
851
	int JavadocInvalidParamTagName = Javadoc + Internal + 519;
851
	int JavadocInvalidParamTagName = Javadoc + Internal + 519;
852
	/** @since 3.1 */
852
	/** @since 3.1 */
853
	int JavadocInvalidParamTagTypeParameter = Javadoc + Internal + 469;
853
	int JavadocInvalidParamTagTypeParameter = Javadoc + Internal + 469;
854
	/** @since 3.1 */
855
	int JavadocNonStaticTypeFromStaticInvocation = Javadoc + Internal + 468;
854
856
855
	/**
857
	/**
856
	 * Generics
858
	 * Generics
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-13 / +27 lines)
Lines 270-275 Link Here
270
				scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, modifiers);
270
				scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, modifiers);
271
			}
271
			}
272
		}
272
		}
273
		
274
		// Verify that there's no type variable reference
275
		// (javadoc does not accept them and this is not a referenced bug or requested enhancement)
276
		if (reference.resolvedType != null && reference.resolvedType.isTypeVariable()) {
277
			scope.problemReporter().javadocInvalidReference(reference.sourceStart, reference.sourceEnd);
278
		}
273
	}
279
	}
274
280
275
	/*
281
	/*
Lines 402-415 Link Here
402
					if (paramBindind.isTypeVariable()) {
408
					if (paramBindind.isTypeVariable()) {
403
						// Verify duplicated tags
409
						// Verify duplicated tags
404
						boolean duplicate = false;
410
						boolean duplicate = false;
405
						for (int j = 0; j < maxBindings && !duplicate; j++) {
411
						for (int j = 0; j < i && !duplicate; j++) {
406
							if (bindings[j] == param.resolvedType) {
412
							if (bindings[j] == param.resolvedType) {
407
								scope.problemReporter().javadocDuplicatedParamTag(param.token, param.sourceStart, param.sourceEnd, modifiers);
413
								scope.problemReporter().javadocDuplicatedParamTag(param.token, param.sourceStart, param.sourceEnd, modifiers);
408
								duplicate = true;
414
								duplicate = true;
409
							}
415
							}
410
						}
416
						}
411
						if (!duplicate) {
417
						if (!duplicate) {
412
							bindings[maxBindings++] = (TypeVariableBinding) param.resolvedType;
418
							bindings[i] = (TypeVariableBinding) param.resolvedType;
419
							maxBindings++;
413
						}
420
						}
414
					} else {
421
					} else {
415
						scope.problemReporter().javadocUndeclaredParamTagName(param.token, param.sourceStart, param.sourceEnd, modifiers);
422
						scope.problemReporter().javadocUndeclaredParamTagName(param.token, param.sourceStart, param.sourceEnd, modifiers);
Lines 418-436 Link Here
418
			}
425
			}
419
426
420
			// Look for undocumented type parameters
427
			// Look for undocumented type parameters
421
			if (reportMissing) {
428
			for (int i = 0; i < typeParametersLength; i++) {
422
				for (int i = 0; i < typeParametersLength; i++) {
429
				TypeParameter parameter = parameters[i];
423
					TypeParameter parameter = parameters[i];
430
				boolean found = false;
424
					boolean found = false;
431
				for (int j = 0; j < paramTypeParamLength && !found; j++) {
425
					for (int j = 0; j < maxBindings && !found; j++) {
432
					if (parameter.binding == bindings[j]) {
426
						if (parameter.binding == bindings[j]) {
433
						found = true;
427
							found = true;
434
						bindings[j] = null;
428
						}
429
					}
430
					if (!found) {
431
						scope.problemReporter().javadocMissingParamTag(parameter.name, parameter.sourceStart, parameter.sourceEnd, modifiers);
432
					}
435
					}
433
				}
436
				}
437
				if (!found && reportMissing) {
438
					scope.problemReporter().javadocMissingParamTag(parameter.name, parameter.sourceStart, parameter.sourceEnd, modifiers);
439
				}
440
			}
441
			
442
			// Report invalid param
443
			for (int i=0; i<paramTypeParamLength; i++) {
444
				if (bindings[i] != null) {
445
					JavadocSingleTypeReference param = this.paramTypeParameters[i];
446
					scope.problemReporter().javadocUndeclaredParamTagName(param.token, param.sourceStart, param.sourceEnd, modifiers);
447
				}
434
			}
448
			}
435
		}
449
		}
436
	}
450
	}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java (-1 / +5 lines)
Lines 65-71 Link Here
65
						fieldBinding = closestMatch; // ignore problem if can reach target field through it
65
						fieldBinding = closestMatch; // ignore problem if can reach target field through it
66
					}
66
					}
67
			}
67
			}
68
		}			
68
		}
69
		// When there's no valid field binding, try to resolve possible method reference without parenthesis
69
		if (!fieldBinding.isValidBinding() || !(fieldBinding instanceof FieldBinding)) {
70
		if (!fieldBinding.isValidBinding() || !(fieldBinding instanceof FieldBinding)) {
70
			if (this.receiverType instanceof ReferenceBinding) {
71
			if (this.receiverType instanceof ReferenceBinding) {
71
				ReferenceBinding refBinding = (ReferenceBinding) this.receiverType;
72
				ReferenceBinding refBinding = (ReferenceBinding) this.receiverType;
Lines 75-86 Link Here
75
				} else {
76
				} else {
76
					switch (methodBindings.length) {
77
					switch (methodBindings.length) {
77
						case 0:
78
						case 0:
79
							// no method was found: report problem
78
							scope.problemReporter().javadocInvalidField(this.sourceStart, this.sourceEnd, fieldBinding, this.receiverType, scope.getDeclarationModifiers());
80
							scope.problemReporter().javadocInvalidField(this.sourceStart, this.sourceEnd, fieldBinding, this.receiverType, scope.getDeclarationModifiers());
79
							break;
81
							break;
80
						case 1:
82
						case 1:
83
							// one method binding was found: store binding in specific field
81
							this.methodBinding = methodBindings[0];
84
							this.methodBinding = methodBindings[0];
82
							break;
85
							break;
83
						default:
86
						default:
87
							// several method binding were found: store first binding in specific field and report ambiguous error
84
							this.methodBinding = methodBindings[0];
88
							this.methodBinding = methodBindings[0];
85
							scope.problemReporter().javadocAmbiguousMethodReference(this.sourceStart, this.sourceEnd, fieldBinding, scope.getDeclarationModifiers());
89
							scope.problemReporter().javadocAmbiguousMethodReference(this.sourceStart, this.sourceEnd, fieldBinding, scope.getDeclarationModifiers());
86
							break;
90
							break;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java (+7 lines)
Lines 63-68 Link Here
63
			if (binding instanceof PackageBinding) {
63
			if (binding instanceof PackageBinding) {
64
				this.packageBinding = (PackageBinding) binding;
64
				this.packageBinding = (PackageBinding) binding;
65
			} else {
65
			} else {
66
				if (this.resolvedType.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
67
					ReferenceBinding closestMatch = ((ProblemReferenceBinding)this.resolvedType).closestMatch;
68
					if (closestMatch != null && closestMatch.isTypeVariable()) {
69
						this.resolvedType = closestMatch; // ignore problem as we want report specific javadoc one instead
70
						return resolvedType;
71
					}
72
				}
66
				reportInvalidType(scope);
73
				reportInvalidType(scope);
67
			}
74
			}
68
			return null;
75
			return null;
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-6 / +5 lines)
Lines 585-590 Link Here
585
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
585
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
586
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
586
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
587
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
587
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
588
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
588
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
589
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
589
		case IProblem.JavadocNonGenericMethod:
590
		case IProblem.JavadocNonGenericMethod:
590
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
591
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
Lines 1426-1431 Link Here
1426
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
1427
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
1427
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
1428
		case IProblem.JavadocInheritedFieldHidesEnclosingName:
1428
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
1429
		case IProblem.JavadocInheritedNameHidesEnclosingTypeName:
1430
		case IProblem.JavadocNonStaticTypeFromStaticInvocation:
1429
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
1431
		case IProblem.JavadocGenericMethodTypeArgumentMismatch:
1430
		case IProblem.JavadocNonGenericMethod:
1432
		case IProblem.JavadocNonGenericMethod:
1431
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
1433
		case IProblem.JavadocIncorrectArityForParameterizedMethod:
Lines 3441-3449 Link Here
3441
		case Ambiguous :
3443
		case Ambiguous :
3442
			id = IProblem.JavadocAmbiguousField;
3444
			id = IProblem.JavadocAmbiguousField;
3443
			break;
3445
			break;
3444
		case InheritedNameHidesEnclosingName :
3445
			id = IProblem.JavadocInheritedFieldHidesEnclosingName;
3446
			break;
3447
		case NoError : // 0
3446
		case NoError : // 0
3448
		default :
3447
		default :
3449
			needImplementation(); // want to fail to see why we were here...
3448
			needImplementation(); // want to fail to see why we were here...
Lines 3506-3514 Link Here
3506
		case Ambiguous :
3505
		case Ambiguous :
3507
			id = IProblem.JavadocAmbiguousMethod;
3506
			id = IProblem.JavadocAmbiguousMethod;
3508
			break;
3507
			break;
3509
		case InheritedNameHidesEnclosingName :
3510
			id = IProblem.JavadocInheritedMethodHidesEnclosingName;
3511
			break;
3512
		case ParameterBoundMismatch :
3508
		case ParameterBoundMismatch :
3513
			problemMethod = (ProblemMethodBinding) method;
3509
			problemMethod = (ProblemMethodBinding) method;
3514
			ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
3510
			ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
Lines 3674-3679 Link Here
3674
			case InheritedNameHidesEnclosingName :
3670
			case InheritedNameHidesEnclosingName :
3675
				id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
3671
				id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
3676
				break;
3672
				break;
3673
			case NonStaticReferenceInStaticContext :
3674
				id = IProblem.JavadocNonStaticTypeFromStaticInvocation;
3675
			    break;
3677
			case NoError : // 0
3676
			case NoError : // 0
3678
			default :
3677
			default :
3679
				needImplementation(); // want to fail to see why we were here...
3678
				needImplementation(); // want to fail to see why we were here...
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (+1 lines)
Lines 359-364 Link Here
359
460 = Empty block should be documented
359
460 = Empty block should be documented
360
360
361
### DOC 
361
### DOC 
362
468 = Cannot make a static reference to the non-static type variable {0}
362
469 = Invalid param tag type parameter name
363
469 = Invalid param tag type parameter name
363
470 = Unexpected tag
364
470 = Unexpected tag
364
471 = Missing tag for parameter {0}
365
471 = Missing tag for parameter {0}

Return to bug 101283