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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-1 lines)
Lines 4139-4145 Link Here
4139
				return;
4139
				return;
4140
			}
4140
			}
4141
			break;
4141
			break;
4142
		case ProblemReasons.ReceiverTypeNotVisible:
4143
		case ProblemReasons.NotVisible :
4142
		case ProblemReasons.NotVisible :
4144
			id = IProblem.JavadocNotVisibleMethod;
4143
			id = IProblem.JavadocNotVisibleMethod;
4145
			break;
4144
			break;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java (-2 / +2 lines)
Lines 41-47 Link Here
41
		// Base type promotion
41
		// Base type promotion
42
		this.constant = Constant.NotAConstant;
42
		this.constant = Constant.NotAConstant;
43
		if (this.receiver == null) {
43
		if (this.receiver == null) {
44
			this.actualReceiverType = scope.enclosingSourceType();
44
			this.actualReceiverType = scope.enclosingReceiverType();
45
		} else if (scope.kind == Scope.CLASS_SCOPE) {
45
		} else if (scope.kind == Scope.CLASS_SCOPE) {
46
			this.actualReceiverType = this.receiver.resolveType((ClassScope) scope);
46
			this.actualReceiverType = this.receiver.resolveType((ClassScope) scope);
47
		} else {
47
		} else {
Lines 79-85 Link Here
79
			return null;
79
			return null;
80
		}
80
		}
81
		this.actualReceiverType = scope.environment().convertToRawType(this.receiver.resolvedType);
81
		this.actualReceiverType = scope.environment().convertToRawType(this.receiver.resolvedType);
82
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
82
		ReferenceBinding enclosingType = scope.enclosingReceiverType();
83
		if (enclosingType==null ? false : enclosingType.isCompatibleWith(this.actualReceiverType)) {
83
		if (enclosingType==null ? false : enclosingType.isCompatibleWith(this.actualReceiverType)) {
84
			this.bits |= ASTNode.SuperAccess;
84
			this.bits |= ASTNode.SuperAccess;
85
		}
85
		}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java (-5 / +3 lines)
Lines 16-27 Link Here
16
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
16
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
17
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
17
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
18
import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
18
import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
19
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
20
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
19
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
21
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
20
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
22
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
21
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
23
import org.eclipse.jdt.internal.compiler.lookup.Scope;
22
import org.eclipse.jdt.internal.compiler.lookup.Scope;
24
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
23
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
24
import org.eclipse.jdt.internal.core.util.Util;
25
25
26
26
27
public class JavadocSingleTypeReference extends SingleTypeReference {
27
public class JavadocSingleTypeReference extends SingleTypeReference {
Lines 86-95 Link Here
86
		}
86
		}
87
		if (isTypeUseDeprecated(this.resolvedType, scope))
87
		if (isTypeUseDeprecated(this.resolvedType, scope))
88
			reportDeprecatedType(this.resolvedType, scope);
88
			reportDeprecatedType(this.resolvedType, scope);
89
		if (this.resolvedType instanceof ParameterizedTypeBinding) {
89
		
90
			this.resolvedType = ((ParameterizedTypeBinding)this.resolvedType).genericType();
90
		return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope);
91
		}
92
		return this.resolvedType;
93
	}
91
	}
94
92
95
	/* (non-Javadoc)
93
	/* (non-Javadoc)
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java (-5 / +3 lines)
Lines 16-24 Link Here
16
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
16
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
17
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
17
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
18
import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
18
import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
19
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
20
import org.eclipse.jdt.internal.compiler.lookup.Scope;
19
import org.eclipse.jdt.internal.compiler.lookup.Scope;
21
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
20
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
21
import org.eclipse.jdt.internal.core.util.Util;
22
22
23
23
24
public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
24
public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
Lines 74-83 Link Here
74
		}
74
		}
75
		if (isTypeUseDeprecated(this.resolvedType, scope))
75
		if (isTypeUseDeprecated(this.resolvedType, scope))
76
			reportDeprecatedType(this.resolvedType, scope);
76
			reportDeprecatedType(this.resolvedType, scope);
77
		if (this.resolvedType instanceof ParameterizedTypeBinding) {
77
		
78
			this.resolvedType = ((ParameterizedTypeBinding)this.resolvedType).genericType();
78
		return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope);
79
		}
80
		return this.resolvedType;
81
	}
79
	}
82
80
83
	public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) {
81
	public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java (-3 / +5 lines)
Lines 13-18 Link Here
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
14
import org.eclipse.jdt.internal.compiler.impl.Constant;
14
import org.eclipse.jdt.internal.compiler.impl.Constant;
15
import org.eclipse.jdt.internal.compiler.lookup.*;
15
import org.eclipse.jdt.internal.compiler.lookup.*;
16
import org.eclipse.jdt.internal.core.util.Util;
16
17
17
public class JavadocImplicitTypeReference extends TypeReference {
18
public class JavadocImplicitTypeReference extends TypeReference {
18
	
19
	
Lines 36-42 Link Here
36
	 */
37
	 */
37
	protected TypeBinding getTypeBinding(Scope scope) {
38
	protected TypeBinding getTypeBinding(Scope scope) {
38
		this.constant = Constant.NotAConstant;
39
		this.constant = Constant.NotAConstant;
39
		return this.resolvedType = scope.enclosingSourceType();
40
		return this.resolvedType = scope.enclosingReceiverType();
40
	}
41
	}
41
42
42
	public char[] getLastToken() {
43
	public char[] getLastToken() {
Lines 67-73 Link Here
67
		if (this.resolvedType != null) // is a shared type reference which was already resolved
68
		if (this.resolvedType != null) // is a shared type reference which was already resolved
68
			return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error
69
			return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error
69
70
70
		this.resolvedType = scope.enclosingSourceType();
71
		this.resolvedType = scope.enclosingReceiverType();
71
		if (this.resolvedType == null)
72
		if (this.resolvedType == null)
72
			return null; // detected cycle while resolving hierarchy	
73
			return null; // detected cycle while resolving hierarchy	
73
		if (!this.resolvedType.isValidBinding()) {
74
		if (!this.resolvedType.isValidBinding()) {
Lines 76-82 Link Here
76
		}
77
		}
77
		if (isTypeUseDeprecated(this.resolvedType, scope))
78
		if (isTypeUseDeprecated(this.resolvedType, scope))
78
			reportDeprecatedType(this.resolvedType, scope);
79
			reportDeprecatedType(this.resolvedType, scope);
79
		return this.resolvedType;
80
81
		return this.resolvedType = Util.deepConvertToRawType(this.resolvedType, scope);
80
	}
82
	}
81
83
82
	protected void reportInvalidType(Scope scope) {
84
	protected void reportInvalidType(Scope scope) {
(-)model/org/eclipse/jdt/internal/core/util/Util.java (-1 / +35 lines)
Lines 44-49 Link Here
44
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
44
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
45
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
45
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
46
import org.eclipse.jdt.internal.compiler.impl.Constant;
46
import org.eclipse.jdt.internal.compiler.impl.Constant;
47
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
48
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
49
import org.eclipse.jdt.internal.compiler.lookup.Scope;
50
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
47
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
51
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
48
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
52
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
49
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
53
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
Lines 392-398 Link Here
392
	public static String convertTypeSignature(char[] sig, int start, int length) {
396
	public static String convertTypeSignature(char[] sig, int start, int length) {
393
		return new String(sig, start, length).replace('/', '.');
397
		return new String(sig, start, length).replace('/', '.');
394
	}
398
	}
395
	
399
	/**
400
	 * Specific to references used in Javadocs (@see, @link)
401
	 * Returns the given binding's raw type binding.
402
	 * May retrieve and convert to raw types all parameterized enclosing types of the given TypeBinding.
403
	 * @param type the TypeBinding to raw convert
404
	 * @param scope the scope within which the conversion occurs 
405
	 * @return TypeBinding the raw converted TypeBinding
406
	 */
407
	public static TypeBinding deepConvertToRawType(TypeBinding type, Scope scope) {
408
		LookupEnvironment environment = scope.environment();
409
		TypeBinding rawTypeBinding = environment.convertToRawType(type);
410
		if (!rawTypeBinding.isParameterizedType()) {
411
			return rawTypeBinding;
412
		}
413
		char[][] memberTypesNames = new char[5][];
414
		int idx = -1; // member types level
415
		while (rawTypeBinding.isParameterizedType()) {
416
			TypeBinding enclosing = rawTypeBinding.enclosingType();
417
			if (enclosing == null) break;
418
			if (++idx == memberTypesNames.length) {
419
				System.arraycopy(memberTypesNames, 0, memberTypesNames = new char[memberTypesNames.length*2][], 0, idx);
420
			}
421
			memberTypesNames[idx] = rawTypeBinding.sourceName();
422
			rawTypeBinding = enclosing;
423
		}
424
		// raw convert all member types
425
		for (int i=idx; i>=0; i--) {
426
			rawTypeBinding = environment.convertToRawType(((ReferenceBinding) rawTypeBinding).getMemberType(memberTypesNames[i]));
427
		}
428
		return rawTypeBinding;
429
	}
396
	/*
430
	/*
397
	 * Returns the default java extension (".java").
431
	 * Returns the default java extension (".java").
398
	 * To be used when the extension is not known.
432
	 * To be used when the extension is not known.
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java (-4 / +8 lines)
Lines 2418-2426 Link Here
2418
			IBinding binding = seeRef.resolveBinding();
2418
			IBinding binding = seeRef.resolveBinding();
2419
			assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
2419
			assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
2420
			ITypeBinding typeBinding = (ITypeBinding)binding;
2420
			ITypeBinding typeBinding = (ITypeBinding)binding;
2421
			assertTrue(seeRef.toString()+" should have a generic type binding", typeBinding.isGenericType());
2421
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
2422
			// only have RawTypeBinding in Javadocs
2423
			assertFalse(seeRef.toString()+" should NOT have a generic type binding", typeBinding.isGenericType());
2422
			assertFalse(seeRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType());
2424
			assertFalse(seeRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType());
2423
			assertFalse(seeRef.toString()+" should NOT have a raw type binding", typeBinding.isRawType());
2425
			assertTrue(seeRef.toString()+" should have a raw type binding", typeBinding.isRawType());
2424
			// Get inline tag simple name reference in second tag
2426
			// Get inline tag simple name reference in second tag
2425
			assertEquals("Invalid number of fragments for inline tag element: "+inlineTag, 1, inlineTag.fragments().size());
2427
			assertEquals("Invalid number of fragments for inline tag element: "+inlineTag, 1, inlineTag.fragments().size());
2426
			node = (ASTNode) inlineTag.fragments().get(0);
2428
			node = (ASTNode) inlineTag.fragments().get(0);
Lines 2430-2438 Link Here
2430
			binding = linkRef.resolveBinding();
2432
			binding = linkRef.resolveBinding();
2431
			assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
2433
			assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
2432
			typeBinding = (ITypeBinding)binding;
2434
			typeBinding = (ITypeBinding)binding;
2433
			assertTrue(linkRef.toString()+" should have a generic type binding", typeBinding.isGenericType());
2435
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936
2436
			// only have RawTypeBinding in Javadocs
2437
			assertFalse(linkRef.toString()+" should NOT have a generic type binding", typeBinding.isGenericType());
2434
			assertFalse(linkRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType());
2438
			assertFalse(linkRef.toString()+" should NOT have a parameterized type binding", typeBinding.isParameterizedType());
2435
			assertFalse(linkRef.toString()+" should NOT have a raw type binding", typeBinding.isRawType());
2439
			assertTrue(linkRef.toString()+" should have a raw type binding", typeBinding.isRawType());
2436
		}
2440
		}
2437
	}
2441
	}
2438
2442
(-)src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java (-1 / +1 lines)
Lines 340-346 Link Here
340
		"}";
340
		"}";
341
	completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.java", source, true, "meth");
341
	completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.java", source, true, "meth");
342
	assertSortedResults(
342
	assertSortedResults(
343
		"method[METHOD_REF]{method(Object), Ljavadoc.bugs.BasicTestBugs<TS;>;, (TS;)V, method, (s), "+this.positions+R_DRICNRNS+"}"
343
		"method[METHOD_REF]{method(Object), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.Object;)V, method, (s), "+this.positions+R_DRICNRNS+"}"
344
	);
344
	);
345
}
345
}
346
346
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java (-32 / +590 lines)
Lines 3098-3110 Link Here
3098
	 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936"
3098
	 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936"
3099
	 */
3099
	 */
3100
	public void testBug209936a() {
3100
	public void testBug209936a() {
3101
		reportMissingJavadocComments = CompilerOptions.IGNORE;
3101
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3102
		reportMissingJavadocCommentsVisibility = CompilerOptions.IGNORE;
3103
		runNegativeTest(
3102
		runNegativeTest(
3104
			new String[] {
3103
			new String[] {
3105
				"p/X.java",
3104
				"p/X.java",
3106
				"package p;\n" + 
3105
				"package p;\n" + 
3107
				"\n" + 
3108
				"public abstract class X extends Y {\n" + 
3106
				"public abstract class X extends Y {\n" + 
3109
				"	protected class A extends Member {\n" + 
3107
				"	protected class A extends Member {\n" + 
3110
				"		/**\n" + 
3108
				"		/**\n" + 
Lines 3115-3128 Link Here
3115
				"}",
3113
				"}",
3116
				"p/Y.java",
3114
				"p/Y.java",
3117
				"package p;\n" + 
3115
				"package p;\n" + 
3118
				"\n" + 
3119
				"import p1.Z;\n" + 
3116
				"import p1.Z;\n" + 
3120
				"\n" + 
3121
				"public abstract class Y extends Z<Object> {\n" + 
3117
				"public abstract class Y extends Z<Object> {\n" + 
3122
				"}",
3118
				"}",
3123
				"p1/Z.java",
3119
				"p1/Z.java",
3124
				"package p1;\n" + 
3120
				"package p1;\n" + 
3125
				"\n" + 
3126
				"public abstract class Z<T> {\n" + 
3121
				"public abstract class Z<T> {\n" + 
3127
				"	protected class Member {\n" + 
3122
				"	protected class Member {\n" + 
3128
				"		protected void foo(Object source, Object data) {\n" + 
3123
				"		protected void foo(Object source, Object data) {\n" + 
Lines 3131-3163 Link Here
3131
				"}"
3126
				"}"
3132
			},
3127
			},
3133
			"----------\n" + 
3128
			"----------\n" + 
3134
			"1. ERROR in p\\X.java (at line 6)\n" + 
3129
			"1. ERROR in p\\X.java (at line 5)\n" + 
3135
			"	* @see Member#foo(Object, Object)\n" + 
3130
			"	* @see Member#foo(Object, Object)\n" + 
3136
			"	              ^^^\n" + 
3131
			"	       ^^^^^^\n" + 
3137
			"Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible\n" + 
3132
			"Javadoc: Invalid member type qualification\n" + 
3138
			"----------\n" + 
3139
			"2. ERROR in p\\X.java (at line 8)\n" + 
3140
			"	public void foo(Object source, Object data) {}\n" + 
3141
			"	                       ^^^^^^\n" + 
3142
			"Javadoc: Missing tag for parameter source\n" + 
3143
			"----------\n" + 
3144
			"3. ERROR in p\\X.java (at line 8)\n" + 
3145
			"	public void foo(Object source, Object data) {}\n" + 
3146
			"	                                      ^^^^\n" + 
3147
			"Javadoc: Missing tag for parameter data\n" + 
3148
			"----------\n"
3133
			"----------\n"
3149
		);
3134
		);
3150
	}
3135
	}
3151
	
3136
	
3152
	public void testBug209936b() {
3137
	public void testBug209936b() {
3153
		reportMissingJavadocTags = CompilerOptions.IGNORE;
3138
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3154
		reportMissingJavadocComments = CompilerOptions.IGNORE;
3155
		reportMissingJavadocCommentsVisibility = CompilerOptions.IGNORE;
3156
		runNegativeTest(
3139
		runNegativeTest(
3157
			new String[] {
3140
			new String[] {
3158
				"p/X.java",
3141
				"p/X.java",
3159
				"package p;\n" + 
3142
				"package p;\n" + 
3160
				"\n" + 
3161
				"public abstract class X extends Y {\n" + 
3143
				"public abstract class X extends Y {\n" + 
3162
				"	protected class A extends Member {\n" + 
3144
				"	protected class A extends Member {\n" + 
3163
				"		/**\n" + 
3145
				"		/**\n" + 
Lines 3170-3193 Link Here
3170
				"package p;\n" + 
3152
				"package p;\n" + 
3171
				"\n" + 
3153
				"\n" + 
3172
				"import p1.Z;\n" + 
3154
				"import p1.Z;\n" + 
3173
				"\n" + 
3155
				"public abstract class Y extends Z<Object> {}",
3174
				"public abstract class Y extends Z<Object> {\n" + 
3175
				"}",
3176
				"p1/Z.java",
3156
				"p1/Z.java",
3177
				"package p1;\n" + 
3157
				"package p1;\n" + 
3178
				"\n" + 
3179
				"public abstract class Z<T> {\n" + 
3158
				"public abstract class Z<T> {\n" + 
3180
				"	protected class Member {\n" + 
3159
				"	protected class Member {\n" + 
3181
				"		protected void foo(Object source, Object data) {\n" + 
3160
				"		protected void foo(Object source, Object data) {}\n" + 
3182
				"		}\n" + 
3183
				"	}\n" + 
3161
				"	}\n" + 
3184
				"}"
3162
				"}"
3185
			},
3163
			},
3186
			"----------\n" + 
3164
			"----------\n" + 
3187
			"1. ERROR in p\\X.java (at line 6)\n" + 
3165
			"1. ERROR in p\\X.java (at line 5)\n" + 
3188
			"	* @see Member#foo(Object, Object)\n" + 
3166
			"	* @see Member#foo(Object, Object)\n" + 
3189
			"	              ^^^\n" + 
3167
			"	       ^^^^^^\n" + 
3190
			"Javadoc: The method foo(Object, Object) from the type Z<T>.Member is not visible\n" + 
3168
			"Javadoc: Invalid member type qualification\n" + 
3169
			"----------\n"
3170
		);
3171
	}
3172
	
3173
	public void testBug209936_GenericMemberImplicitReference() {
3174
		reportMissingJavadocTags = CompilerOptions.IGNORE;
3175
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3176
		runNegativeTest(
3177
			new String[] {
3178
				"p1/A.java",
3179
				"package p1;\n" + 
3180
				"public class A<R> {\n" + 
3181
				"	public class A1<S> {\n" + 
3182
				"		public class A2<T> {\n" + 
3183
				"			public class A3<U> {\n" + 
3184
				"				public class A4<V> {\n" + 
3185
				"					public void foo(V v) {}\n" + 
3186
				"				}\n" + 
3187
				"			}\n" + 
3188
				"		}\n" + 
3189
				"	}\n" + 
3190
				"}",
3191
				"p2/X.java",
3192
				"package p2;\n" + 
3193
				"import p1.A;\n" + 
3194
				"public class X<R> extends A<R> {\n" + 
3195
				"	public class X1<S> extends A1<S> {\n" + 
3196
				"		public class X2<T> extends A2<T> {\n" + 
3197
				"			public class X3<U> extends A3<U> {\n" + 
3198
				"				public class X4<V> extends A4<V> {\n" + 
3199
				"					/**\n" + 
3200
									// implicit type reference
3201
				"			 		 * @see #foo(Object)\n" + 
3202
				"			 		 * @see #foo(V)\n" + 
3203
				"					 */\n" + 
3204
				"					public void foo(V v) {}\n" + 
3205
				"				}\n" + 
3206
				"			}\n" + 
3207
				"		}\n" + 
3208
				"	}\n" + 
3209
				"}"
3210
			},
3211
			"----------\n" + 
3212
			"1. ERROR in p2\\X.java (at line 10)\n" + 
3213
			"	* @see #foo(V)\n" + 
3214
			"	        ^^^\n" + 
3215
			"Javadoc: The method foo(Object) in the type X.X1.X2.X3.X4 is not applicable for the arguments (V)\n" + 
3216
			"----------\n"
3217
		);
3218
	}
3219
3220
	public void testBug209936_GenericMemberSingleReference() {
3221
		reportMissingJavadocTags = CompilerOptions.IGNORE;
3222
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3223
		runNegativeTest(
3224
			new String[] {
3225
				"p1/A.java",
3226
				"package p1;\n" + 
3227
				"public class A<R> {\n" + 
3228
				"	public class A1<S> {\n" + 
3229
				"		public class A2<T> {\n" + 
3230
				"			public class A3<U> {\n" + 
3231
				"				public class A4<V> {\n" + 
3232
				"					public void foo(V v) {}\n" + 
3233
				"				}\n" + 
3234
				"			}\n" + 
3235
				"		}\n" + 
3236
				"	}\n" + 
3237
				"}",
3238
				"p2/X.java",
3239
				"package p2;\n" + 
3240
				"import p1.A;\n" + 
3241
				"public class X<R> extends A<R> {\n" + 
3242
				"	public class X1<S> extends A1<S> {\n" + 
3243
				"		public class X2<T> extends A2<T> {\n" + 
3244
				"			public class X3<U> extends A3<U> {\n" + 
3245
				"				public class X4<V> extends A4<V> {\n" + 
3246
				"					/**\n" + 
3247
									// single type reference
3248
				"			 		 * @see A4#foo(V)\n" + 
3249
				"			 		 * @see A4#foo(Object)\n" + 
3250
				"					 */\n" + 
3251
				"					public void myFoo(V v) {}\n" + 
3252
				"				}\n" + 
3253
				"			}\n" + 
3254
				"		}\n" + 
3255
				"	}\n" + 
3256
				"}"
3257
			},
3258
			"----------\n" + 
3259
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3260
			"	* @see A4#foo(V)\n" + 
3261
			"	          ^^^\n" + 
3262
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + 
3263
			"----------\n" + 
3264
			"2. ERROR in p2\\X.java (at line 10)\n" + 
3265
			"	* @see A4#foo(Object)\n" + 
3266
			"	       ^^\n" + 
3267
			"Javadoc: Invalid member type qualification\n" + 
3268
			"----------\n"
3269
		);
3270
	}
3271
	
3272
	public void testBug209936_GenericMemberQualifiedSingleReference() {
3273
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3274
		runNegativeTest(
3275
			new String[] {
3276
				"p1/A.java",
3277
				"package p1;\n" + 
3278
				"public class A<R> {\n" + 
3279
				"	public class A1<S> {\n" + 
3280
				"		public class A2<T> {\n" + 
3281
				"			public class A3<U> {\n" + 
3282
				"				public class A4<V> {\n" + 
3283
				"					public void foo(V v) {}\n" + 
3284
				"				}\n" + 
3285
				"			}\n" + 
3286
				"		}\n" + 
3287
				"	}\n" + 
3288
				"}",
3289
				"p2/X.java",
3290
				"package p2;\n" + 
3291
				"import p1.A;\n" + 
3292
				"public class X<R> extends A<R> {\n" + 
3293
				"	public class X1<S> extends A1<S> {\n" + 
3294
				"		public class X2<T> extends A2<T> {\n" + 
3295
				"			public class X3<U> extends A3<U> {\n" + 
3296
				"				public class X4<V> extends A4<V> {\n" + 
3297
				"					/**\n" + 
3298
									// qualified single type reference
3299
				"			 		 * @see A3.A4#foo(V)\n" +
3300
				"			 		 * @see A3.A4#foo(Object)\n" + 
3301
				"					 */\n" + 
3302
				"					public void foo(V v) {}\n" + 
3303
				"				}\n" + 
3304
				"			}\n" + 
3305
				"		}\n" + 
3306
				"	}\n" + 
3307
				"}"
3308
			},
3309
			"----------\n" + 
3310
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3311
			"	* @see A3.A4#foo(V)\n" + 
3312
			"	             ^^^\n" + 
3313
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + 
3314
			"----------\n"
3315
		);
3316
	}
3317
3318
	public void testBug209936_GenericMemberFullyQualifiedSingleReference() {
3319
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3320
		runNegativeTest(
3321
			new String[] {
3322
				"p1/A.java",
3323
				"package p1;\n" + 
3324
				"public class A<R> {\n" + 
3325
				"	public class A1<S> {\n" + 
3326
				"		public class A2<T> {\n" + 
3327
				"			public class A3<U> {\n" + 
3328
				"				public class A4<V> {\n" + 
3329
				"					public void foo(V v) {}\n" + 
3330
				"				}\n" + 
3331
				"			}\n" + 
3332
				"		}\n" + 
3333
				"	}\n" + 
3334
				"}",
3335
				"p2/X.java",
3336
				"package p2;\n" + 
3337
				"import p1.A;\n" + 
3338
				"public class X<R> extends A<R> {\n" + 
3339
				"	public class X1<S> extends A1<S> {\n" + 
3340
				"		public class X2<T> extends A2<T> {\n" + 
3341
				"			public class X3<U> extends A3<U> {\n" + 
3342
				"				public class X4<V> extends A4<V> {\n" + 
3343
				"					/**\n" + 
3344
									// fully qualified type reference
3345
				"			 		 * @see A.A1.A2.A3.A4#foo(V)\n" + 
3346
				"			 		 * @see A.A1.A2.A3.A4#foo(Object)\n" +
3347
				"					 */\n" + 
3348
				"					public void foo(V v) {}\n" + 
3349
				"				}\n" + 
3350
				"			}\n" + 
3351
				"		}\n" + 
3352
				"	}\n" + 
3353
				"}"
3354
			},
3355
			"----------\n" + 
3356
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3357
			"	* @see A.A1.A2.A3.A4#foo(V)\n" + 
3358
			"	                     ^^^\n" + 
3359
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (V)\n" + 
3360
			"----------\n"
3361
		);
3362
	}
3363
	
3364
	public void testBug209936_MemberImplicitReference() {
3365
		reportMissingJavadocTags = CompilerOptions.IGNORE;
3366
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3367
		runNegativeTest(
3368
			new String[] {
3369
				"p1/A.java",
3370
				"package p1;\n" + 
3371
				"public class A<R> {\n" + 
3372
				"	public class A1<S> {\n" + 
3373
				"		public class A2<T> {\n" + 
3374
				"			public class A3<U> {\n" + 
3375
				"				public class A4 {\n" + 
3376
				"					public void foo(U u) {}\n" + 
3377
				"				}\n" + 
3378
				"			}\n" + 
3379
				"		}\n" + 
3380
				"	}\n" + 
3381
				"}",
3382
				"p2/X.java",
3383
				"package p2;\n" + 
3384
				"import p1.A;\n" + 
3385
				"public class X<R> extends A<R> {\n" + 
3386
				"	public class X1<S> extends A1<S> {\n" + 
3387
				"		public class X2<T> extends A2<T> {\n" + 
3388
				"			public class X3<U> extends A3<U> {\n" + 
3389
				"				public class X4 extends A4 {\n" + 
3390
				"					/**\n" + 
3391
									// implicit reference
3392
				"			 		 * @see #foo(Object)\n" + 
3393
				"			 		 * @see #foo(U u)\n" + 
3394
				"					 */\n" + 
3395
				"					public void foo(U u) {}\n" + 
3396
				"				}\n" + 
3397
				"			}\n" + 
3398
				"		}\n" + 
3399
				"	}\n" + 
3400
				"}"
3401
			},
3402
			"----------\n" + 
3403
			"1. ERROR in p2\\X.java (at line 10)\r\n" + 
3404
			"	* @see #foo(U u)\r\n" + 
3405
			"	        ^^^\n" + 
3406
			"Javadoc: The method foo(Object) in the type X.X1.X2.X3.X4 is not applicable for the arguments (U)\n" + 
3407
			"----------\n"
3408
		);
3409
	}
3410
3411
	public void testBug209936_MemberSingleReference1(){
3412
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3413
		runNegativeTest(
3414
			new String[] {
3415
				"p1/A.java",
3416
				"package p1;\n" + 
3417
				"public class A<R> {\n" + 
3418
				"	public class A1<S> {\n" + 
3419
				"		public class A2<T> {\n" + 
3420
				"			public class A3 {\n" + 
3421
				"				public class A4 {\n" + 
3422
				"					public void foo(T t) {}\n" + 
3423
				"				}\n" + 
3424
				"			}\n" + 
3425
				"		}\n" + 
3426
				"	}\n" + 
3427
				"}",
3428
				"p2/X.java",
3429
				"package p2;\n" + 
3430
				"import p1.A;\n" + 
3431
				"public class X<R> extends A<R> {\n" + 
3432
				"	public class X1<S> extends A1<S> {\n" + 
3433
				"		public class X2<T> extends A2<T> {\n" + 
3434
				"			public class X3 extends A3 {\n" + 
3435
				"				public class X4 extends A4 {\n" + 
3436
				"					/**\n" + 
3437
									// single type reference
3438
				"			 		 * @see A4#foo(Object)\n" + 
3439
				"			 		 * @see A4#foo(T)\n" +
3440
				"					 */\n" + 
3441
				"					public void foo(T t) {}\n" + 
3442
				"				}\n" + 
3443
				"			}\n" + 
3444
				"		}\n" + 
3445
				"	}\n" + 
3446
				"}"
3447
			},
3448
			"----------\n" + 
3449
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3450
			"	* @see A4#foo(Object)\n" + 
3451
			"	       ^^\n" + 
3452
			"Javadoc: Invalid member type qualification\n" + 
3453
			"----------\n" + 
3454
			"2. ERROR in p2\\X.java (at line 10)\n" + 
3455
			"	* @see A4#foo(T)\n" + 
3456
			"	          ^^^\n" + 
3457
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + 
3458
			"----------\n"
3459
		);
3460
	}
3461
3462
	public void testBug209936_MemberSingleReference2(){
3463
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3464
		runNegativeTest(
3465
			new String[] {
3466
				"p1/A.java",
3467
				"package p1;\n" + 
3468
				"public class A<R> {\n" + 
3469
				"	public class A1<S> {\n" + 
3470
				"		public class A2 {\n" + 
3471
				"			public class A3 {\n" + 
3472
				"				public class A4 {\n" + 
3473
				"					public void foo(S s) {}\n" + 
3474
				"				}\n" + 
3475
				"			}\n" + 
3476
				"		}\n" + 
3477
				"	}\n" + 
3478
				"}",
3479
				"p2/X.java",
3480
				"package p2;\n" + 
3481
				"import p1.A;\n" + 
3482
				"public class X<R> extends A<R> {\n" + 
3483
				"	public class X1<S> extends A1<S> {\n" + 
3484
				"		public class X2 extends A2 {\n" + 
3485
				"			public class X3 extends A3 {\n" + 
3486
				"				public class X4 extends A4 {\n" + 
3487
				"					/**\n" + 
3488
									// single type reference
3489
				"			 		 * @see A4#foo(Object)\n" + 
3490
				"			 		 * @see A4#foo(S)\n" +
3491
				"					 */\n" + 
3492
				"					public void foo(S s) {}\n" + 
3493
				"				}\n" + 
3494
				"			}\n" + 
3495
				"		}\n" + 
3496
				"	}\n" + 
3497
				"}"
3498
			},
3499
			"----------\n" + 
3500
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3501
			"	* @see A4#foo(Object)\n" + 
3502
			"	       ^^\n" + 
3503
			"Javadoc: Invalid member type qualification\n" + 
3504
			"----------\n" + 
3505
			"2. ERROR in p2\\X.java (at line 10)\n" + 
3506
			"	* @see A4#foo(S)\n" + 
3507
			"	          ^^^\n" + 
3508
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (S)\n" + 
3509
			"----------\n"
3510
		);
3511
	}
3512
	
3513
	public void testBug209936_MemberSingleReference3(){
3514
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3515
		runNegativeTest(
3516
			new String[] {
3517
				"p1/A.java",
3518
				"package p1;\n" + 
3519
				"public class A {\n" + 
3520
				"	public class A1 {\n" + 
3521
				"		public class A2<T> {\n" + 
3522
				"			public class A3 {\n" + 
3523
				"				public class A4 {\n" + 
3524
				"					public void foo(T t) {}\n" + 
3525
				"				}\n" + 
3526
				"			}\n" + 
3527
				"		}\n" + 
3528
				"	}\n" + 
3529
				"}",
3530
				"p2/X.java",
3531
				"package p2;\n" + 
3532
				"import p1.A;\n" + 
3533
				"public class X extends A {\n" + 
3534
				"	public class X1 extends A1 {\n" + 
3535
				"		public class X2<T> extends A2<T> {\n" + 
3536
				"			public class X3 extends A3 {\n" + 
3537
				"				public class X4 extends A4 {\n" + 
3538
				"					/**\n" + 
3539
									// single type reference
3540
				"			 		 * @see A4#foo(Object)\n" + 
3541
				"			 		 * @see A4#foo(T)\n" +
3542
				"					 */\n" + 
3543
				"					public void foo(T t) {}\n" + 
3544
				"				}\n" + 
3545
				"			}\n" + 
3546
				"		}\n" + 
3547
				"	}\n" + 
3548
				"}"
3549
			},
3550
			"----------\n" + 
3551
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3552
			"	* @see A4#foo(Object)\n" + 
3553
			"	       ^^\n" + 
3554
			"Javadoc: Invalid member type qualification\n" + 
3555
			"----------\n" + 
3556
			"2. ERROR in p2\\X.java (at line 10)\n" + 
3557
			"	* @see A4#foo(T)\n" + 
3558
			"	          ^^^\n" + 
3559
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + 
3560
			"----------\n"
3561
		);
3562
	}
3563
3564
	public void testBug209936_MemberSingleReference4(){
3565
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3566
		runNegativeTest(
3567
			new String[] {
3568
				"p1/A.java",
3569
				"package p1;\n" + 
3570
				"public class A {\n" + 
3571
				"	public class A1 {\n" + 
3572
				"		public class A2<T> {\n" + 
3573
				"			public class A3 {\n" + 
3574
				"				public class A4 {\n" + 
3575
				"					public void foo(T t) {}\n" + 
3576
				"				}\n" + 
3577
				"			}\n" + 
3578
				"		}\n" + 
3579
				"	}\n" + 
3580
				"}",
3581
				"p2/X.java",
3582
				"package p2;\n" + 
3583
				"import p1.A;\n" + 
3584
				"public class X extends A {\n" + 
3585
				"	public class X1 extends A1 {\n" + 
3586
				"		public class X2<T> extends A2<T> {\n" + 
3587
				"			public class X3 extends A3 {\n" + 
3588
				"				public class X4 extends A4 {\n" + 
3589
				"					/**\n" + 
3590
				// single type reference
3591
				"			 		 * @see A4#foo(Object)\n" + 
3592
				"			 		 * @see A4#foo(T)\n" +
3593
				"					 */\n" + 
3594
				"					public void foo(T t) {}\n" + 
3595
				"				}\n" + 
3596
				"			}\n" + 
3597
				"		}\n" + 
3598
				"	}\n" + 
3599
				"}"
3600
			},
3601
			"----------\n" + 
3602
			"1. ERROR in p2\\X.java (at line 9)\n" + 
3603
			"	* @see A4#foo(Object)\n" + 
3604
			"	       ^^\n" + 
3605
			"Javadoc: Invalid member type qualification\n" + 
3606
			"----------\n" + 
3607
			"2. ERROR in p2\\X.java (at line 10)\n" + 
3608
			"	* @see A4#foo(T)\n" + 
3609
			"	          ^^^\n" + 
3610
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (T)\n" + 
3611
			"----------\n"
3612
		);
3613
	}
3614
	
3615
	public void testBug209936_MemberQualifiedSingleReference1() {
3616
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3617
		runConformTest(
3618
			new String[] {
3619
				"p1/A.java",
3620
				"package p1;\n" + 
3621
				"\n" + 
3622
				"public class A<R> {\n" + 
3623
				"	public class A1<S> {\n" + 
3624
				"		public class A2 {\n" + 
3625
				"			public class A3 {\n" + 
3626
				"				public class A4 {\n" + 
3627
				"					public void foo(S s) {}\n" + 
3628
				"				}\n" + 
3629
				"			}\n" + 
3630
				"		}\n" + 
3631
				"	}\n" + 
3632
				"}",
3633
				"p2/X.java",
3634
				"package p2;\n" + 
3635
				"import p1.A;\n" + 
3636
				"public class X<R> extends A<R> {\n" + 
3637
				"	public class X1<S> extends A1<S> {\n" + 
3638
				"		public class X2 extends A2 {\n" + 
3639
				"			public class X3 extends A3 {\n" + 
3640
				"				public class X4 extends A4 {\n" + 
3641
				"					/**\n" + 
3642
									// qualified single type reference
3643
				"			 		 * @see A3.A4#foo(Object)\n" + 
3644
				"			 		 * @see A2.A3.A4#foo(Object)\n" + 
3645
				"			 		 * @see A1.A2.A3.A4#foo(Object)\n" + 
3646
				"					 */\n" + 
3647
				"					public void foo(S s) {}\n" + 
3648
				"				}\n" + 
3649
				"			}\n" + 
3650
				"		}\n" + 
3651
				"	}\n" + 
3652
				"}"
3653
			}
3654
		);
3655
	}
3656
3657
	public void testBug209936_MemberQualifiedSingleReference2() {
3658
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3659
		runConformTest(
3660
			new String[] {
3661
				"p1/A.java",
3662
				"package p1;\n" + 
3663
				"\n" + 
3664
				"public class A<R> {\n" + 
3665
				"	public class A1<S> {\n" + 
3666
				"		public class A2 {\n" + 
3667
				"			public class A3 {\n" + 
3668
				"				public class A4 {\n" + 
3669
				"					public class A5 {\n" + 
3670
				"						public class A6 {\n" + 
3671
				"							public void foo(S s) {}\n" + 
3672
				"						}\n" + 
3673
				"					}\n" + 
3674
				"				}\n" + 
3675
				"			}\n" + 
3676
				"		}\n" + 
3677
				"	}\n" + 
3678
				"}",
3679
				"p2/X.java",
3680
				"package p2;\n" + 
3681
				"import p1.A;\n" + 
3682
				"public class X<R> extends A<R> {\n" + 
3683
				"	public class X1<S> extends A1<S> {\n" + 
3684
				"		public class X2 extends A2 {\n" + 
3685
				"			public class X3 extends A3 {\n" + 
3686
				"				public class X4 extends A4 {\n" + 
3687
				"					public class X5 extends A5 {\n" + 
3688
				"						public class X6 extends A6 {\n" + 
3689
				"							/**\n" + 
3690
											// qualified single type reference
3691
				"			 				 * @see A5.A6#foo(Object)\n" + 
3692
				"			 				 * @see A4.A5.A6#foo(Object)\n" +
3693
				"							 */\n" + 
3694
				"							public void foo(S s) {}\n" + 
3695
				"						}\n" +
3696
				"					}\n" +
3697
				"				}\n" + 
3698
				"			}\n" + 
3699
				"		}\n" + 
3700
				"	}\n" + 
3701
				"}"
3702
			}
3703
		);
3704
	}
3705
3706
	public void testBug209936_MemberFullyQualifiedSingleReference() {
3707
		reportMissingJavadocCommentsVisibility = CompilerOptions.WARNING;
3708
		runNegativeTest(
3709
			new String[] {
3710
				"p1/A.java",
3711
				"package p1;\n" + 
3712
				"\n" + 
3713
				"public class A<R> {\n" + 
3714
				"	public class A1 {\n" + 
3715
				"		public class A2 {\n" + 
3716
				"			public class A3 {\n" + 
3717
				"				public class A4 {\n" + 
3718
				"					public void foo(R r) {}\n" + 
3719
				"				}\n" + 
3720
				"			}\n" + 
3721
				"		}\n" + 
3722
				"	}\n" + 
3723
				"}",
3724
				"p2/X.java",
3725
				"package p2;\n" + 
3726
				"import p1.A;\n" + 
3727
				"public class X<R> extends A<R> {\n" + 
3728
				"	public class X1 extends A1 {\n" + 
3729
				"		public class X2 extends A2 {\n" + 
3730
				"			public class X3 extends A3 {\n" + 
3731
				"				public class X4 extends A4 {\n" + 
3732
				"					/**\n" + 
3733
									// fully qualified type reference
3734
				"			 		 * @see A.A1.A2.A3.A4#foo(Object)\n" + 
3735
				"			 		 * @see A.A1.A2.A3.A4#foo(R)\n" +
3736
				"					 */\n" + 
3737
				"					public void foo(R r) {}\n" + 
3738
				"				}\n" + 
3739
				"			}\n" + 
3740
				"		}\n" + 
3741
				"	}\n" + 
3742
				"}"
3743
			},
3744
			"----------\n" + 
3745
			"1. ERROR in p2\\X.java (at line 10)\r\n" + 
3746
			"	* @see A.A1.A2.A3.A4#foo(R)\r\n" + 
3747
			"	                     ^^^\n" + 
3748
			"Javadoc: The method foo(Object) in the type A.A1.A2.A3.A4 is not applicable for the arguments (R)\n" + 
3191
			"----------\n"
3749
			"----------\n"
3192
		);
3750
		);
3193
	}
3751
	}

Return to bug 209936