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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java (-5 / +1 lines)
Lines 28-41 Link Here
28
		this.bits |= InsideJavadoc;
28
		this.bits |= InsideJavadoc;
29
	}
29
	}
30
30
31
	/*
32
	 * Resolves type on a Block or Class scope.
33
	 */
34
	private TypeBinding internalResolveType(Scope scope) {
31
	private TypeBinding internalResolveType(Scope scope) {
35
		this.constant = Constant.NotAConstant;
32
		this.constant = Constant.NotAConstant;
36
		if (this.resolvedType != null) // is a shared type reference which was already resolved
33
		if (this.resolvedType != null) // is a shared type reference which was already resolved
37
			return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error
34
			return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error
38
35
	
39
		if (this.argument != null) {
36
		if (this.argument != null) {
40
			TypeReference typeRef = this.argument.type;
37
			TypeReference typeRef = this.argument.type;
41
			if (typeRef != null) {
38
			if (typeRef != null) {
Lines 47-53 Link Here
47
				}
44
				}
48
				if (isTypeUseDeprecated(this.resolvedType, scope)) {
45
				if (isTypeUseDeprecated(this.resolvedType, scope)) {
49
					scope.problemReporter().javadocDeprecatedType(this.resolvedType, typeRef, scope.getDeclarationModifiers());
46
					scope.problemReporter().javadocDeprecatedType(this.resolvedType, typeRef, scope.getDeclarationModifiers());
50
					return null;
51
				}
47
				}
52
				return this.resolvedType = scope.environment().convertToRawType(this.resolvedType);
48
				return this.resolvedType = scope.environment().convertToRawType(this.resolvedType);
53
			}
49
			}
(-)src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java (+46 lines)
Lines 984-987 Link Here
984
			elements
984
			elements
985
		);
985
		);
986
	}
986
	}
987
988
	/**
989
	 * Bug 171802: [javadoc][select] F3 does not work on method which have deprecated type as argument
990
	 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=171802"
991
	 */
992
	public void testBug171802() throws CoreException {
993
		this.wcOwner = new WorkingCopyOwner() {};
994
		workingCopies = new ICompilationUnit[2];
995
		workingCopies[0] = getWorkingCopy("/Tests/b171802/Y.java",
996
			"package b171802;\n" +
997
			"\n" + 
998
			"/**\n" +
999
			" * @deprecated\n" + 
1000
			" */\n" +
1001
			"public class Y {\n" + 
1002
			"\n" + 
1003
			"}\n",
1004
			wcOwner,
1005
			null/*don't compute problems*/
1006
		);
1007
		workingCopies[1] = getWorkingCopy("/Tests/b171802/X.java",
1008
			"package b171802;\n" + 
1009
			"\n" + 
1010
			"public class X {\n" + 
1011
			"	/**\n" + 
1012
			"	 * @deprecated Use {@link #bar(char[], Y)}\n" + 
1013
			"	 * instead\n" + 
1014
			"	 */\n" + 
1015
			"	void foo(char[] param1, Y param2) {}\n" + 
1016
			"\n" +	
1017
			"	/**\n" + 
1018
			"	 * @deprecated\n" + 
1019
			"	 */\n" + 
1020
			"	void bar(char[] param1, Y param2) {}\n" + 
1021
			"\n" +	
1022
			"}\n",
1023
			wcOwner,
1024
			null/*don't compute problems*/
1025
		);
1026
		IJavaElement[] elements = new IJavaElement[1];
1027
		elements[0] = selectMethod(this.workingCopies[1], "bar");
1028
		assertElementsEqual("Invalid selection(s)",
1029
			"bar(char[], Y) [in X [in [Working copy] X.java [in b171802 [in <project root> [in Tests]]]]]",
1030
			elements
1031
		);
1032
	}
987
}
1033
}

Return to bug 171802