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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-3 / +3 lines)
Lines 896-902 Link Here
896
		// Store nodes in arrays
896
		// Store nodes in arrays
897
		while (this.astLengthPtr >= 0) {
897
		while (this.astLengthPtr >= 0) {
898
			int ptr = this.astLengthPtr % ORDERED_TAGS_NUMBER;
898
			int ptr = this.astLengthPtr % ORDERED_TAGS_NUMBER;
899
			// Starting with the stack top, so get references (eg. Expression) coming from @see declarations
899
			// Starting with the stack top, so get references (Expression) coming from @see declarations
900
			switch(ptr) {
900
			switch(ptr) {
901
				case SEE_TAG_EXPECTED_ORDER:
901
				case SEE_TAG_EXPECTED_ORDER:
902
					int size = this.astLengthStack[this.astLengthPtr--];
902
					int size = this.astLengthStack[this.astLengthPtr--];
Lines 905-911 Link Here
905
					}
905
					}
906
					break;
906
					break;
907
907
908
				// Then continuing with class names (eg. TypeReference) coming from @throw/@exception declarations
908
				// Then continuing with class names (TypeReference) coming from @throw/@exception declarations
909
				case THROWS_TAG_EXPECTED_ORDER:
909
				case THROWS_TAG_EXPECTED_ORDER:
910
					size = this.astLengthStack[this.astLengthPtr--];
910
					size = this.astLengthStack[this.astLengthPtr--];
911
					for (int i=0; i<size; i++) {
911
					for (int i=0; i<size; i++) {
Lines 913-919 Link Here
913
					}
913
					}
914
					break;
914
					break;
915
915
916
				// Finally, finishing with parameters nales (ie. Argument) coming from @param declaration
916
				// Finally, finishing with parameters names (Argument) coming from @param declaration
917
				case PARAM_TAG_EXPECTED_ORDER:
917
				case PARAM_TAG_EXPECTED_ORDER:
918
					size = this.astLengthStack[this.astLengthPtr--];
918
					size = this.astLengthStack[this.astLengthPtr--];
919
					for (int i=0; i<size; i++) {
919
					for (int i=0; i<size; i++) {
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (-1 / +8 lines)
Lines 1326-1332 Link Here
1326
	protected void pushOnAstStack(Object node, boolean newLength) {
1326
	protected void pushOnAstStack(Object node, boolean newLength) {
1327
1327
1328
		if (node == null) {
1328
		if (node == null) {
1329
			this.astLengthStack[++this.astLengthPtr] = 0;
1329
			int stackLength = this.astLengthStack.length;
1330
			if (++this.astLengthPtr >= stackLength) {
1331
				System.arraycopy(
1332
					this.astLengthStack, 0,
1333
					this.astLengthStack = new int[stackLength + AST_STACK_INCREMENT], 0,
1334
					stackLength);
1335
			}
1336
			this.astLengthStack[this.astLengthPtr] = 0;
1330
			return;
1337
			return;
1331
		}
1338
		}
1332
1339
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (-2700 / +2974 lines)
Lines 4126-7232 Link Here
4126
}
4126
}
4127
4127
4128
/**
4128
/**
4129
 * Bug 87404: [javadoc] Unexpected not defined warning on constructor
4129
 * Bug 86769: [javadoc] Warn/Error for 'Missing javadoc comments' doesn't recognize private inner classes
4130
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=87404"
4130
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=86769"
4131
 */
4132
public void testBug87404() {
4133
	runConformTest(
4134
		new String[] {
4135
			"p/A.java",
4136
			"package p;\n" +
4137
			"class A {\n" +
4138
			"	A(char c) {}\n" +
4139
			"	class B {\n" +
4140
			"		B(Exception ex) {}\n" +
4141
			"	}\n" +
4142
			"	void foo() {}\n" +
4143
			"    /**\n" +
4144
			"     * Link {@link #A(char)} OK \n" +
4145
			"     * Link {@link #A(String)} OK\n" +
4146
			"     * Link {@link #foo()} OK\n" +
4147
			"     * Link {@link #bar()} OK\n" +
4148
			"     */\n" +
4149
			"    public A(String str) {}\n" +
4150
			"	void bar() {}\n" +
4151
			"}"
4152
		}
4153
	);
4154
}
4155
4156
/**
4157
 * Bug 90302: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
4158
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=90302"
4159
 */
4131
 */
4160
public void testBug90302() {
4132
public void testBug86769_Classes1() {
4161
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4133
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4134
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
4162
	runNegativeTest(
4135
	runNegativeTest(
4163
		new String[] {
4136
		new String[] {
4164
			"X.java",
4137
			"A.java",
4165
			"/**\n" +
4138
			"/**\n" +
4166
			" * @see #foo(String)\n" +
4139
			" * Test bug 86769 \n" +
4167
			" */\n" +
4140
			" */\n" +
4168
			"public class X {\n" +
4141
			"public class A {\n" +
4169
			"	/**\n" +
4142
			"	private class Level1Private {\n" +
4170
			"	 * Static method\n" +
4143
			"		private class Level2_PrivPriv {}\n" +
4171
			"	 * @param str\n" +
4144
			"		class Level2_PrivDef {}\n" +
4172
			"	 * @return int\n" +
4145
			"		protected class Level2_PrivPro {}\n" +
4173
			"	 * @throws NumberFormatException\n" +
4146
			"		public class Level2_PrivPub {}\n" +
4174
			"	 */\n" +
4175
			"	static int foo(String str) throws NumberFormatException{\n" +
4176
			"		return Integer.parseInt(str);\n" +
4177
			"	}\n" +
4147
			"	}\n" +
4178
			"}\n",
4148
			"	class Level1Default{\n" +
4179
			"Y.java",
4149
			"		private class Level2_DefPriv {}\n" +
4180
			"/**\n" +
4150
			"		class Level2_DefDef {}\n" +
4181
			" * @see #foo(String)\n" +
4151
			"		protected class Level2_DefPro {}\n" +
4182
			" */\n" +
4152
			"		public class Level2_DefPub {}\n" +
4183
			"public class Y extends X { \n" +
4153
			"	}\n" +
4184
			"	/**\n" +
4154
			"	protected class Level1Protected {\n" +
4185
			"	 * Static method: does not override super\n" +
4155
			"		private class Level2_ProtPriv {}\n" +
4186
			"	 * {@inheritDoc}\n" +
4156
			"		class Level2_ProDef {}\n" +
4187
			"	 */\n" +
4157
			"		protected class Level2_ProPro {}\n" +
4188
			"	static int foo(String str) throws NumberFormatException{\n" +
4158
			"		public class Level2_ProPub {} \n" +
4189
			"		return Integer.parseInt(str);\n" +
4159
			"	}\n" +
4160
			"	public class Level1Public {\n" +
4161
			"		private class Level2_PubPriv {}\n" +
4162
			"		class Level2_PubDef {}\n" +
4163
			"		protected class Level2_PubPro {}\n" +
4164
			"		public class Level2_PubPub {}\n" +
4190
			"	}\n" +
4165
			"	}\n" +
4191
			"}\n"
4166
			"}\n"
4192
		},
4167
		},
4193
		"----------\n" +
4168
		"----------\n" +
4194
		"1. ERROR in Y.java (at line 7)\n" +
4169
		"1. ERROR in A.java (at line 17)\n" +
4195
		"	* {@inheritDoc}\n" +
4170
		"	protected class Level1Protected {\n" +
4196
		"	    ^^^^^^^^^^\n" +
4171
		"	                ^^^^^^^^^^^^^^^\n" +
4197
		"Javadoc: Unexpected tag\n" +
4172
		"Javadoc: Missing comment for protected declaration\n" +
4198
		"----------\n" +
4173
		"----------\n" +
4199
		"2. ERROR in Y.java (at line 9)\n" +
4174
		"2. ERROR in A.java (at line 20)\n" +
4200
		"	static int foo(String str) throws NumberFormatException{\n" +
4175
		"	protected class Level2_ProPro {}\n" +
4201
		"	       ^^^\n" +
4176
		"	                ^^^^^^^^^^^^^\n" +
4202
		"Javadoc: Missing tag for return type\n" +
4177
		"Javadoc: Missing comment for protected declaration\n" +
4203
		"----------\n" +
4178
		"----------\n" +
4204
		"3. ERROR in Y.java (at line 9)\n" +
4179
		"3. ERROR in A.java (at line 21)\n" +
4205
		"	static int foo(String str) throws NumberFormatException{\n" +
4180
		"	public class Level2_ProPub {} \n" +
4206
		"	                      ^^^\n" +
4181
		"	             ^^^^^^^^^^^^^\n" +
4207
		"Javadoc: Missing tag for parameter str\n" +
4182
		"Javadoc: Missing comment for protected declaration\n" +
4208
		"----------\n" +
4183
		"----------\n" +
4209
		"4. ERROR in Y.java (at line 9)\n" +
4184
		"4. ERROR in A.java (at line 23)\n" +
4210
		"	static int foo(String str) throws NumberFormatException{\n" +
4185
		"	public class Level1Public {\n" +
4211
		"	                                  ^^^^^^^^^^^^^^^^^^^^^\n" +
4186
		"	             ^^^^^^^^^^^^\n" +
4212
		"Javadoc: Missing tag for declared exception NumberFormatException\n" +
4187
		"Javadoc: Missing comment for public declaration\n" +
4188
		"----------\n" +
4189
		"5. ERROR in A.java (at line 26)\n" +
4190
		"	protected class Level2_PubPro {}\n" +
4191
		"	                ^^^^^^^^^^^^^\n" +
4192
		"Javadoc: Missing comment for protected declaration\n" +
4193
		"----------\n" +
4194
		"6. ERROR in A.java (at line 27)\n" +
4195
		"	public class Level2_PubPub {}\n" +
4196
		"	             ^^^^^^^^^^^^^\n" +
4197
		"Javadoc: Missing comment for public declaration\n" +
4213
		"----------\n",
4198
		"----------\n",
4214
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4199
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4215
	);
4200
	);
4216
}
4201
}
4217
public void testBug90302b() {
4202
public void testBug86769_Classes2() {
4218
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4203
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4204
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
4219
	runNegativeTest(
4205
	runNegativeTest(
4220
		new String[] {
4206
		new String[] {
4221
			"X.java",
4207
			"B.java",
4222
			"/** */\n" +
4223
			"public class X {\n" +
4224
			"}\n",
4225
			"Y.java",
4226
			"/**\n" +
4208
			"/**\n" +
4227
			" * @see #foo(String)\n" +
4209
			" * Test bug 86769\n" +
4228
			" */\n" +
4210
			" */\n" +
4229
			"public class Y extends X { \n" +
4211
			"public class B {\n" +
4230
			"	/**\n" +
4212
			"	class Level0_Default {\n" +
4231
			"	 * Simple method: does not override super\n" +
4213
			"		private class Level1Private {\n" +
4232
			"	 * {@inheritDoc}\n" +
4214
			"			private class Level2_PrivPriv {}\n" +
4233
			"	 */\n" +
4215
			"			class Level2_PrivDef {}\n" +
4234
			"	static int foo(String str) throws NumberFormatException{\n" +
4216
			"			protected class Level2_PrivPro {}\n" +
4235
			"		return Integer.parseInt(str);\n" +
4217
			"			public class Level2_PrivPub {}\n" +
4218
			"		}\n" +
4219
			"	}\n" +
4220
			"	public class Level0_Public {\n" +
4221
			"		class Level1Default{\n" +
4222
			"			private class Level2_DefPriv {}\n" +
4223
			"			class Level2_DefDef {}\n" +
4224
			"			protected class Level2_DefPro {}\n" +
4225
			"			public class Level2_DefPub {}\n" +
4226
			"		}\n" +
4227
			"	}\n" +
4228
			"	protected class Level0_Protected {\n" +
4229
			"		protected class Level1Protected {\n" +
4230
			"			private class Level2_ProtPriv {}\n" +
4231
			"			class Level2_ProDef {}\n" +
4232
			"			protected class Level2_ProPro {}\n" +
4233
			"			public class Level2_ProPub {} \n" +
4234
			"		}\n" +
4235
			"	}\n" +
4236
			"	private class Level0_Private {\n" +
4237
			"		public class Level1Public {\n" +
4238
			"			private class Level2_PubPriv {}\n" +
4239
			"			class Level2_PubDef {}\n" +
4240
			"			protected class Level2_PubPro {}\n" +
4241
			"			public class Level2_PubPub {}\n" +
4242
			"		}\n" +
4236
			"	}\n" +
4243
			"	}\n" +
4237
			"}\n"
4244
			"}\n"
4238
		},
4245
		},
4239
		"----------\n" +
4246
		"----------\n" +
4240
		"1. ERROR in Y.java (at line 7)\n" +
4247
		"1. ERROR in B.java (at line 5)\n" +
4241
		"	* {@inheritDoc}\n" +
4248
		"	class Level0_Default {\n" +
4242
		"	    ^^^^^^^^^^\n" +
4249
		"	      ^^^^^^^^^^^^^^\n" +
4243
		"Javadoc: Unexpected tag\n" +
4250
		"Javadoc: Missing comment for default declaration\n" +
4244
		"----------\n" +
4251
		"----------\n" +
4245
		"2. ERROR in Y.java (at line 9)\n" +
4252
		"2. ERROR in B.java (at line 13)\n" +
4246
		"	static int foo(String str) throws NumberFormatException{\n" +
4253
		"	public class Level0_Public {\n" +
4247
		"	       ^^^\n" +
4254
		"	             ^^^^^^^^^^^^^\n" +
4248
		"Javadoc: Missing tag for return type\n" +
4255
		"Javadoc: Missing comment for public declaration\n" +
4249
		"----------\n" +
4256
		"----------\n" +
4250
		"3. ERROR in Y.java (at line 9)\n" +
4257
		"3. ERROR in B.java (at line 14)\n" +
4251
		"	static int foo(String str) throws NumberFormatException{\n" +
4258
		"	class Level1Default{\n" +
4252
		"	                      ^^^\n" +
4259
		"	      ^^^^^^^^^^^^^\n" +
4253
		"Javadoc: Missing tag for parameter str\n" +
4260
		"Javadoc: Missing comment for default declaration\n" +
4254
		"----------\n" +
4261
		"----------\n" +
4255
		"4. ERROR in Y.java (at line 9)\n" +
4262
		"4. ERROR in B.java (at line 16)\n" +
4256
		"	static int foo(String str) throws NumberFormatException{\n" +
4263
		"	class Level2_DefDef {}\n" +
4257
		"	                                  ^^^^^^^^^^^^^^^^^^^^^\n" +
4264
		"	      ^^^^^^^^^^^^^\n" +
4258
		"Javadoc: Missing tag for declared exception NumberFormatException\n" +
4265
		"Javadoc: Missing comment for default declaration\n" +
4266
		"----------\n" +
4267
		"5. ERROR in B.java (at line 17)\n" +
4268
		"	protected class Level2_DefPro {}\n" +
4269
		"	                ^^^^^^^^^^^^^\n" +
4270
		"Javadoc: Missing comment for default declaration\n" +
4271
		"----------\n" +
4272
		"6. ERROR in B.java (at line 18)\n" +
4273
		"	public class Level2_DefPub {}\n" +
4274
		"	             ^^^^^^^^^^^^^\n" +
4275
		"Javadoc: Missing comment for default declaration\n" +
4276
		"----------\n" +
4277
		"7. ERROR in B.java (at line 21)\n" +
4278
		"	protected class Level0_Protected {\n" +
4279
		"	                ^^^^^^^^^^^^^^^^\n" +
4280
		"Javadoc: Missing comment for protected declaration\n" +
4281
		"----------\n" +
4282
		"8. ERROR in B.java (at line 22)\n" +
4283
		"	protected class Level1Protected {\n" +
4284
		"	                ^^^^^^^^^^^^^^^\n" +
4285
		"Javadoc: Missing comment for protected declaration\n" +
4286
		"----------\n" +
4287
		"9. ERROR in B.java (at line 24)\n" +
4288
		"	class Level2_ProDef {}\n" +
4289
		"	      ^^^^^^^^^^^^^\n" +
4290
		"Javadoc: Missing comment for default declaration\n" +
4291
		"----------\n" +
4292
		"10. ERROR in B.java (at line 25)\n" +
4293
		"	protected class Level2_ProPro {}\n" +
4294
		"	                ^^^^^^^^^^^^^\n" +
4295
		"Javadoc: Missing comment for protected declaration\n" +
4296
		"----------\n" +
4297
		"11. ERROR in B.java (at line 26)\n" +
4298
		"	public class Level2_ProPub {} \n" +
4299
		"	             ^^^^^^^^^^^^^\n" +
4300
		"Javadoc: Missing comment for protected declaration\n" +
4259
		"----------\n",
4301
		"----------\n",
4260
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4302
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4261
	);
4303
	);
4262
}
4304
}
4263
4305
public void testBug86769_Field1() {
4264
/**
4306
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4265
 * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
4307
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
4266
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
4308
	runNegativeTest(
4267
 */
4309
		new String[] {
4268
public void testBug103304a_public() {
4310
			"A.java",
4269
	String[] units = new String[] {
4270
			"boden/IAFAState.java",
4271
			"package boden;\n" +
4272
			"public interface IAFAState {\n" +
4273
			"    public class ValidationException extends Exception {\n" +
4274
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4275
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4276
			"        }\n" +
4277
			"        public void method() {}\n" +
4278
			"    }\n" +
4279
			"    /**\n" +
4280
			"     * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
4281
			"     * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
4282
			"     * @throws ValidationException Thrown if a variable is unbound. \n" +
4283
			"     * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4284
			"     * @see IAFAState.ValidationException#method()\n" +
4285
			"     * @see ValidationException\n" +
4286
			"     * {@link ValidationException}\n" +
4287
			"     */\n" +
4288
			"    public void validate() throws ValidationException;\n" +
4289
			"}\n",
4290
			"boden/TestValid.java",
4291
			"package boden;\n" +
4292
			"import boden.IAFAState.ValidationException;\n" +
4293
			"/**\n" +
4311
			"/**\n" +
4294
			" * @see ValidationException\n" +
4312
			" * Test bug 86769\n" +
4295
			" * @see IAFAState.ValidationException\n" +
4296
			" */\n" +
4313
			" */\n" +
4297
			"public class TestValid {\n" +
4314
			"public class A {\n" +
4298
			"	/**  \n" +
4315
			"	private class InnerPrivate {\n" +
4299
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4316
			"		private int pri_pri;\n" +
4300
			"	 */\n" +
4317
			"		int pri_def;\n" +
4301
			"	IAFAState.ValidationException valid1;\n" +
4318
			"		protected int pri_pro;\n" +
4302
			"	/**\n" +
4319
			"		public int pri_pub;\n" +
4303
			"	 * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4320
			"	}\n" +
4304
			"	 */\n" +
4321
			"	class InnerDefault{\n" +
4305
			"	IAFAState.ValidationException valid2;\n" +
4322
			"		private int def_pri;\n" +
4323
			"		int def_def;\n" +
4324
			"		protected int def_pro;\n" +
4325
			"		public int def_pub;\n" +
4326
			"	}\n" +
4327
			"	protected class InnerProtected {\n" +
4328
			"		private int pro_pri;\n" +
4329
			"		int pro_def;\n" +
4330
			"		protected int pro_pro;\n" +
4331
			"		public int pro_pub; \n" +
4332
			"	}\n" +
4333
			"	public class InnerPublic {\n" +
4334
			"		private int pub_pri;\n" +
4335
			"		int pub_def;\n" +
4336
			"		protected int pub_pro;\n" +
4337
			"		public int pub_pub;\n" +
4338
			"	}\n" +
4306
			"}\n"
4339
			"}\n"
4307
		};
4340
		},
4308
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4341
		"----------\n" +
4309
		runNegativeTest(units,
4342
		"1. ERROR in A.java (at line 23)\n" +
4310
			//boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
4343
		"	public class InnerPublic {\n" +
4311
			"----------\n" +
4344
		"	             ^^^^^^^^^^^\n" +
4312
			"1. ERROR in boden\\TestValid.java (at line 4)\n" +
4345
		"Javadoc: Missing comment for public declaration\n" +
4313
			"	* @see ValidationException\n" +
4346
		"----------\n" +
4314
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4347
		"2. ERROR in A.java (at line 27)\n" +
4315
			"Javadoc: Invalid member type qualification\n" +
4348
		"	public int pub_pub;\n" +
4316
			"----------\n" +
4349
		"	           ^^^^^^^\n" +
4317
			"2. ERROR in boden\\TestValid.java (at line 9)\n" +
4350
		"Javadoc: Missing comment for public declaration\n" +
4318
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4351
		"----------\n",
4319
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4352
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4320
			"Javadoc: Invalid member type qualification\n" +
4353
	);
4321
			"----------\n",
4322
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4323
		);
4324
	} else {
4325
		runConformTest(units);
4326
	}
4327
}
4354
}
4328
4355
public void testBug86769_Fields2() {
4329
public void testBug103304a_private() {
4356
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4330
	String[] units = new String[] {
4357
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
4331
			"boden/IAFAState.java",
4358
	runNegativeTest(
4332
			"package boden;\n" +
4359
		new String[] {
4333
			"public interface IAFAState {\n" +
4360
			"B.java",
4334
			"    public class ValidationException extends Exception {\n" +
4335
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4336
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4337
			"        }\n" +
4338
			"        public void method() {}\n" +
4339
			"    }\n" +
4340
			"    /**\n" +
4341
			"     * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
4342
			"     * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
4343
			"     * @throws ValidationException Thrown if a variable is unbound. \n" +
4344
			"     * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4345
			"     * @see IAFAState.ValidationException#method()\n" +
4346
			"     * @see ValidationException\n" +
4347
			"     * {@link ValidationException}\n" +
4348
			"     */\n" +
4349
			"    public void validate() throws ValidationException;\n" +
4350
			"}\n",
4351
			"boden/TestValid.java",
4352
			"package boden;\n" +
4353
			"import boden.IAFAState.ValidationException;\n" +
4354
			"/**\n" +
4361
			"/**\n" +
4355
			" * @see ValidationException\n" +
4362
			" * Test bug 86769\n" +
4356
			" * @see IAFAState.ValidationException\n" +
4357
			" */\n" +
4363
			" */\n" +
4358
			"public class TestValid {\n" +
4364
			"public class B {\n" +
4359
			"	/**  \n" +
4365
			"	private class Level1 {\n" +
4360
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4366
			"		private class InnerPrivate {\n" +
4361
			"	 */\n" +
4367
			"			private int pri_pri;\n" +
4362
			"	IAFAState.ValidationException valid1;\n" +
4368
			"			int pri_def;\n" +
4363
			"	/**\n" +
4369
			"			protected int pri_pro;\n" +
4364
			"	 * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4370
			"			public int pri_pub;\n" +
4365
			"	 */\n" +
4371
			"		}\n" +
4366
			"	IAFAState.ValidationException valid2;\n" +
4372
			"		class InnerDefault{\n" +
4367
			"}\n"
4373
			"			private int def_pri;\n" +
4368
		};
4374
			"			int def_def;\n" +
4369
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4375
			"			protected int def_pro;\n" +
4370
		runNegativeTest(units,
4376
			"			public int def_pub;\n" +
4371
			//boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
4377
			"		}\n" +
4372
			//boden\TestValid.java:12: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
4378
			"		protected class InnerProtected {\n" +
4373
			"----------\n" +
4379
			"			private int pro_pri;\n" +
4374
			"1. ERROR in boden\\TestValid.java (at line 4)\n" +
4380
			"			int pro_def;\n" +
4375
			"	* @see ValidationException\n" +
4381
			"			protected int pro_pro;\n" +
4376
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4382
			"			public int pro_pub; \n" +
4377
			"Javadoc: Invalid member type qualification\n" +
4383
			"		}\n" +
4378
			"----------\n" +
4384
			"		public class InnerPublic {\n" +
4379
			"2. ERROR in boden\\TestValid.java (at line 9)\n" +
4385
			"			private int pub_pri;\n" +
4380
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4386
			"			int pub_def;\n" +
4381
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4387
			"			protected int pub_pro;\n" +
4382
			"Javadoc: Invalid member type qualification\n" +
4388
			"			public int pub_pub;\n" +
4383
			"----------\n",
4389
			"		}\n" +
4384
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4390
			"	}\n" +
4385
		);
4386
	} else {
4387
		runConformTest(units);
4388
	}
4389
}
4390
4391
public void testBug103304b() {
4392
	this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
4393
	String[] units = new String[] {
4394
			"boden/IAFAState.java",
4395
			"package boden;\n" +
4396
			"public interface IAFAState {\n" +
4397
			"    public class ValidationException extends Exception {\n" +
4398
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4399
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4400
			"        }\n" +
4401
			"        public void method() {}\n" +
4402
			"    }\n" +
4403
			"}\n",
4404
			"boden/TestInvalid1.java",
4405
			"package boden;\n" +
4406
			"import boden.IAFAState.ValidationException;\n" +
4407
			"public class TestInvalid1 {\n" +
4408
			"	/** \n" +
4409
			"	 * @see ValidationException#ValidationException(String, IAFAState)\n" +
4410
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4411
			"	 */ \n" +
4412
			"	IAFAState.ValidationException invalid;\n" +
4413
			"}\n",
4414
			"boden/TestInvalid2.java",
4415
			"package boden;\n" +
4416
			"public class TestInvalid2 {\n" +
4417
			"	/**\n" +
4418
			"	 * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
4419
			"	 */\n" +
4420
			"	IAFAState.ValidationException invalid;\n" +
4421
			"}\n",
4422
			"boden/TestInvalid3.java",
4423
			"package boden;\n" +
4424
			"import boden.IAFAState.ValidationException;\n" +
4425
			"public class TestInvalid3 {\n" +
4426
			"	/**\n" +
4427
			"	 * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4428
			"	 */\n" +
4429
			"	IAFAState.ValidationException invalid;\n" +
4430
			"}\n",
4431
			"boden/TestInvalid4.java",
4432
			"package boden;\n" +
4433
			"import boden.IAFAState.ValidationException;\n" +
4434
			"public class TestInvalid4 {\n" +
4435
			"	/**\n" +
4436
			"	 * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4437
			"	 */\n" +
4438
			"	IAFAState.ValidationException invalid;\n" +
4439
			"}\n"
4391
			"}\n"
4440
		};
4392
		},
4441
	String errors_14 = new String (
4393
		"----------\n" +
4442
			//boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
4394
		"1. ERROR in B.java (at line 5)\n" +
4443
			//boden\TestInvalid1.java:8: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
4395
		"	private class Level1 {\n" +
4444
			//boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException => bug ID: 4288720
4396
		"	              ^^^^^^\n" +
4445
			//boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
4397
		"Javadoc: Missing comment for private declaration\n" +
4446
			//boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
4398
		"----------\n" +
4447
			"----------\n" +
4399
		"2. ERROR in B.java (at line 6)\n" +
4448
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
4400
		"	private class InnerPrivate {\n" +
4449
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" +
4401
		"	              ^^^^^^^^^^^^\n" +
4450
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4402
		"Javadoc: Missing comment for private declaration\n" +
4451
			"Javadoc: Invalid member type qualification\n" +
4403
		"----------\n" +
4452
			"----------\n" +
4404
		"3. ERROR in B.java (at line 7)\n" +
4453
			"2. ERROR in boden\\TestInvalid1.java (at line 6)\n" +
4405
		"	private int pri_pri;\n" +
4454
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4406
		"	            ^^^^^^^\n" +
4455
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4407
		"Javadoc: Missing comment for private declaration\n" +
4456
			"Javadoc: Invalid member type qualification\n" +
4408
		"----------\n" +
4457
			"----------\n" +
4409
		"4. ERROR in B.java (at line 8)\n" +
4458
			"----------\n" +
4410
		"	int pri_def;\n" +
4459
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
4411
		"	    ^^^^^^^\n" +
4460
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4412
		"Javadoc: Missing comment for private declaration\n" +
4461
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4413
		"----------\n" +
4462
			"Javadoc: Invalid member type qualification\n" +
4414
		"5. ERROR in B.java (at line 9)\n" +
4463
			"----------\n" +
4415
		"	protected int pri_pro;\n" +
4464
			"----------\n" +
4416
		"	              ^^^^^^^\n" +
4465
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
4417
		"Javadoc: Missing comment for private declaration\n" +
4466
			"	* @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4418
		"----------\n" +
4467
			"	                                     ^^^^^^^^^\n" +
4419
		"6. ERROR in B.java (at line 10)\n" +
4468
			"Javadoc: IAFAState cannot be resolved or is not a field\n" +
4420
		"	public int pri_pub;\n" +
4469
			"----------\n"
4421
		"	           ^^^^^^^\n" +
4470
	);
4422
		"Javadoc: Missing comment for private declaration\n" +
4471
	String errors_50 = new String (
4423
		"----------\n" +
4472
			//boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
4424
		"7. ERROR in B.java (at line 12)\n" +
4473
			//boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException => bug ID: 4288720
4425
		"	class InnerDefault{\n" +
4474
			//boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
4426
		"	      ^^^^^^^^^^^^\n" +
4475
			//boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
4427
		"Javadoc: Missing comment for private declaration\n" +
4476
			"----------\n" +
4428
		"----------\n" +
4477
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
4429
		"8. ERROR in B.java (at line 13)\n" +
4478
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4430
		"	private int def_pri;\n" +
4479
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4431
		"	            ^^^^^^^\n" +
4480
			"Javadoc: Invalid member type qualification\n" +
4432
		"Javadoc: Missing comment for private declaration\n" +
4481
			"----------\n" +
4433
		"----------\n" +
4482
			"----------\n" +
4434
		"9. ERROR in B.java (at line 14)\n" +
4483
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
4435
		"	int def_def;\n" +
4484
			"	* @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4436
		"	    ^^^^^^^\n" +
4485
			"	                                     ^^^^^^^^^\n" +
4437
		"Javadoc: Missing comment for private declaration\n" +
4486
			"Javadoc: IAFAState cannot be resolved or is not a field\n" +
4438
		"----------\n" +
4487
			"----------\n"
4439
		"10. ERROR in B.java (at line 15)\n" +
4440
		"	protected int def_pro;\n" +
4441
		"	              ^^^^^^^\n" +
4442
		"Javadoc: Missing comment for private declaration\n" +
4443
		"----------\n" +
4444
		"11. ERROR in B.java (at line 16)\n" +
4445
		"	public int def_pub;\n" +
4446
		"	           ^^^^^^^\n" +
4447
		"Javadoc: Missing comment for private declaration\n" +
4448
		"----------\n" +
4449
		"12. ERROR in B.java (at line 18)\n" +
4450
		"	protected class InnerProtected {\n" +
4451
		"	                ^^^^^^^^^^^^^^\n" +
4452
		"Javadoc: Missing comment for private declaration\n" +
4453
		"----------\n" +
4454
		"13. ERROR in B.java (at line 19)\n" +
4455
		"	private int pro_pri;\n" +
4456
		"	            ^^^^^^^\n" +
4457
		"Javadoc: Missing comment for private declaration\n" +
4458
		"----------\n" +
4459
		"14. ERROR in B.java (at line 20)\n" +
4460
		"	int pro_def;\n" +
4461
		"	    ^^^^^^^\n" +
4462
		"Javadoc: Missing comment for private declaration\n" +
4463
		"----------\n" +
4464
		"15. ERROR in B.java (at line 21)\n" +
4465
		"	protected int pro_pro;\n" +
4466
		"	              ^^^^^^^\n" +
4467
		"Javadoc: Missing comment for private declaration\n" +
4468
		"----------\n" +
4469
		"16. ERROR in B.java (at line 22)\n" +
4470
		"	public int pro_pub; \n" +
4471
		"	           ^^^^^^^\n" +
4472
		"Javadoc: Missing comment for private declaration\n" +
4473
		"----------\n" +
4474
		"17. ERROR in B.java (at line 24)\n" +
4475
		"	public class InnerPublic {\n" +
4476
		"	             ^^^^^^^^^^^\n" +
4477
		"Javadoc: Missing comment for private declaration\n" +
4478
		"----------\n" +
4479
		"18. ERROR in B.java (at line 25)\n" +
4480
		"	private int pub_pri;\n" +
4481
		"	            ^^^^^^^\n" +
4482
		"Javadoc: Missing comment for private declaration\n" +
4483
		"----------\n" +
4484
		"19. ERROR in B.java (at line 26)\n" +
4485
		"	int pub_def;\n" +
4486
		"	    ^^^^^^^\n" +
4487
		"Javadoc: Missing comment for private declaration\n" +
4488
		"----------\n" +
4489
		"20. ERROR in B.java (at line 27)\n" +
4490
		"	protected int pub_pro;\n" +
4491
		"	              ^^^^^^^\n" +
4492
		"Javadoc: Missing comment for private declaration\n" +
4493
		"----------\n" +
4494
		"21. ERROR in B.java (at line 28)\n" +
4495
		"	public int pub_pub;\n" +
4496
		"	           ^^^^^^^\n" +
4497
		"Javadoc: Missing comment for private declaration\n" +
4498
		"----------\n",
4499
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4488
	);
4500
	);
4489
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4490
		runNegativeTest(units, errors_14);
4491
	} else {
4492
		runNegativeTest(units, errors_50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4493
	}
4494
4495
}
4501
}
4496
public void testBug103304c() {
4502
public void testBug86769_Metthods1() {
4497
	runConformTest(
4503
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4504
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
4505
	runNegativeTest(
4498
		new String[] {
4506
		new String[] {
4499
			"test/Test.java",
4507
			"A.java",
4500
			"package test;\n" +
4508
			"/**\n" +
4501
			"public interface Test {\n" +
4509
			" * Test bug 86769\n" +
4502
			"	public class Level0 {\n" +
4510
			" */\n" +
4503
			"		public Level0() {}\n" +
4511
			"public class A {\n" +
4512
			"	private class InnerPrivate {\n" +
4513
			"		private void pri_pri() {}\n" +
4514
			"		void pri_def() {}\n" +
4515
			"		protected void pri_pro() {}\n" +
4516
			"		public void pri_pub() {}\n" +
4504
			"	}\n" +
4517
			"	}\n" +
4505
			"	public interface Member {\n" +
4518
			"	class InnerDefault{\n" +
4506
			"		public class Level1 {\n" +
4519
			"		private void def_pri() {}\n" +
4507
			"			public Level1() {}\n" +
4520
			"		void def_def() {}\n" +
4508
			"		}\n" +
4521
			"		protected void def_pro() {}\n" +
4522
			"		public void def_pub() {}\n" +
4509
			"	}\n" +
4523
			"	}\n" +
4510
			"}\n",
4524
			"	protected class InnerProtected {\n" +
4511
			"test/C.java",
4525
			"		private void pro_pri() {}\n" +
4512
			"package test;\n" +
4526
			"		void pro_def() {}\n" +
4513
			"public class C {\n" +
4527
			"		protected void pro_pro() {}\n" +
4514
			"	/**\n" +
4528
			"		public void pro_pub() {} \n" +
4515
			"	 * @see Test.Level0#Test.Level0()\n" +
4516
			"	 */\n" +
4517
			"	Test.Level0 valid = new Test.Level0();\n" +
4518
			"	/**\n" +
4519
			"	 * @see Test.Level0#Level0()\n" +
4520
			"	 */\n" +
4521
			"	Test.Level0 invalid = new Test.Level0();\n" +
4522
			"}\n"
4523
		}
4524
		//test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0 => bug ID: 4288720
4525
	);
4526
}
4527
public void testBug103304d() {
4528
	runNegativeTest(
4529
		new String[] {
4530
			"test/Test.java",
4531
			"package test;\n" +
4532
			"public interface Test {\n" +
4533
			"	public class Level0 {\n" +
4534
			"		public Level0() {}\n" +
4535
			"	}\n" +
4529
			"	}\n" +
4536
			"	public interface Member {\n" +
4530
			"	public class InnerPublic {\n" +
4537
			"		public class Level1 {\n" +
4531
			"		private void pub_pri() {}\n" +
4538
			"			public Level1() {}\n" +
4532
			"		void pub_def() {}\n" +
4539
			"		}\n" +
4533
			"		protected void pub_pro() {}\n" +
4534
			"		public void pub_pub() {}\n" +
4540
			"	}\n" +
4535
			"	}\n" +
4541
			"}\n",
4542
			"test/C2.java",
4543
			"package test;\n" +
4544
			"public class C2 {\n" +
4545
			"	/**\n" +
4546
			"	 * @see Test.Member.Level1#Test.Member.Level1()\n" +
4547
			"	 */\n" +
4548
			"	Test.Member.Level1 valid = new Test.Member.Level1();\n" +
4549
			"	/**\n" +
4550
			"	 * @see Test.Member.Level1#Level1()\n" +
4551
			"	 */\n" +
4552
			"	Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
4553
			"	/**\n" +
4554
			"	 * @see Test.Member.Level1#Test.Level1()\n" +
4555
			"	 */\n" +
4556
			"	Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
4557
			"}\n"
4536
			"}\n"
4558
		},
4537
		},
4559
		//test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1 => Bug ID: 4288720
4560
		//test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
4561
		"----------\n" +
4538
		"----------\n" +
4562
		"1. ERROR in test\\C2.java (at line 12)\n" +
4539
		"1. ERROR in A.java (at line 23)\n" +
4563
		"	* @see Test.Member.Level1#Test.Level1()\n" +
4540
		"	public class InnerPublic {\n" +
4564
		"	                          ^^^^^^^^^^^^^\n" +
4541
		"	             ^^^^^^^^^^^\n" +
4565
		"Javadoc: Invalid member type qualification\n" +
4542
		"Javadoc: Missing comment for public declaration\n" +
4543
		"----------\n" +
4544
		"2. ERROR in A.java (at line 27)\n" +
4545
		"	public void pub_pub() {}\n" +
4546
		"	            ^^^^^^^^^\n" +
4547
		"Javadoc: Missing comment for public declaration\n" +
4566
		"----------\n",
4548
		"----------\n",
4567
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4549
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4568
	);
4550
	);
4569
}
4551
}
4570
public void testBug103304e() {
4552
public void testBug86769_Methods2() {
4553
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
4554
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
4571
	runConformTest(
4555
	runConformTest(
4572
		new String[] {
4556
		new String[] {
4573
			"implicit/Valid.java",
4557
			"B.java",
4574
			"package implicit;\n" +
4558
			"/**\n" +
4575
			"public interface Valid {\n" +
4559
			" * Test bug 86769\n" +
4576
			"	public class Level0 {\n" +
4560
			" */\n" +
4577
			"		/**\n" +
4561
			"public class B {\n" +
4578
			"		 * @see #Valid.Level0() Valid\n" +
4562
			"	private class Level1 {\n" +
4579
			"		 */\n" +
4563
			"		private class InnerPrivate {\n" +
4580
			"		public Level0() {}\n" +
4564
			"			private void pri_pri() {}\n" +
4581
			"		/**\n" +
4565
			"			void pri_def() {}\n" +
4582
			"		 * @see #Valid.Level0(String) Valid\n" +
4566
			"			protected void pri_pro() {}\n" +
4583
			"		 */\n" +
4567
			"			public void pri_pub() {}\n" +
4584
			"		public Level0(String str) {}\n" +
4585
			"	}\n" +
4586
			"	public interface Member {\n" +
4587
			"		public class Level1 {\n" +
4588
			"			/**\n" +
4589
			"			 * @see #Valid.Member.Level1() Valid\n" +
4590
			"			 */\n" +
4591
			"			public Level1() {}\n" +
4592
			"			/**\n" +
4593
			"			 * @see #Valid.Member.Level1(int) Valid\n" +
4594
			"			 */\n" +
4595
			"			public Level1(int x) {}\n" +
4596
			"		}\n" +
4568
			"		}\n" +
4597
			"	}\n" +
4569
			"		class InnerDefault{\n" +
4598
			"}\n"
4570
			"			private void def_pri() {}\n" +
4599
		}
4571
			"			void def_def() {}\n" +
4600
	);
4572
			"			protected void def_pro() {}\n" +
4601
}
4573
			"			public void def_pub() {}\n" +
4602
public void testBug103304f() {
4574
			"		}\n" +
4603
	runNegativeTest(
4575
			"		protected class InnerProtected {\n" +
4604
		new String[] {
4576
			"			private void pro_pri() {}\n" +
4605
			"implicit/Invalid.java",
4577
			"			void pro_def() {}\n" +
4606
			"package implicit;\n" +
4578
			"			protected void pro_pro() {}\n" +
4607
			"public interface Invalid {\n" +
4579
			"			public void pro_pub() {} \n" +
4608
			"	public class Level0 {\n" +
4580
			"		}\n" +
4609
			"		/**\n" +
4581
			"		public class InnerPublic {\n" +
4610
			"		 * @see #Level0() Invalid\n" +
4582
			"			private void pub_pri() {}\n" +
4611
			"		 */\n" +
4583
			"			void pub_def() {}\n" +
4612
			"		public Level0() {}\n" +
4584
			"			protected void pub_pro() {}\n" +
4613
			"		/**\n" +
4585
			"			public void pub_pub() {}\n" +
4614
			"		 * @see #Level0(String) Invalid\n" +
4615
			"		 */\n" +
4616
			"		public Level0(String str) {}\n" +
4617
			"	}\n" +
4618
			"	public interface Member {\n" +
4619
			"		public class Level1 {\n" +
4620
			"			/**\n" +
4621
			"			 * @see #Level1() Invalid\n" +
4622
			"			 * @see #Member.Level1() Invalid\n" +
4623
			"			 * @see #Invalid.Level1() Invalid\n" +
4624
			"			 */\n" +
4625
			"			public Level1() {}\n" +
4626
			"			/**\n" +
4627
			"			 * @see #Level1(int) Invalid\n" +
4628
			"			 * @see #Invalid.Level1(int) Invalid\n" +
4629
			"			 * @see #Member.Level1(int) Invalid\n" +
4630
			"			 */\n" +
4631
			"			public Level1(int x) {}\n" +
4632
			"		}\n" +
4586
			"		}\n" +
4633
			"	}\n" +
4587
			"	}\n" +
4634
			"}\n"
4588
			"}\n"
4635
		},
4589
		}
4636
		//implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0 => bug ID: 4288720
4637
		//implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0 => bug ID: 4288720
4638
		//implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1 => bug ID: 4288720
4639
		//implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
4640
		//implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
4641
		//implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1 => bug ID: 4288720
4642
		//implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
4643
		//implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
4644
		"----------\n" +
4645
		"1. ERROR in implicit\\Invalid.java (at line 17)\n" +
4646
		"	* @see #Member.Level1() Invalid\n" +
4647
		"	        ^^^^^^^^^^^^^^^\n" +
4648
		"Javadoc: Invalid member type qualification\n" +
4649
		"----------\n" +
4650
		"2. ERROR in implicit\\Invalid.java (at line 18)\n" +
4651
		"	* @see #Invalid.Level1() Invalid\n" +
4652
		"	        ^^^^^^^^^^^^^^^^\n" +
4653
		"Javadoc: Invalid member type qualification\n" +
4654
		"----------\n" +
4655
		"3. ERROR in implicit\\Invalid.java (at line 23)\n" +
4656
		"	* @see #Invalid.Level1(int) Invalid\n" +
4657
		"	        ^^^^^^^^^^^^^^^^^^^\n" +
4658
		"Javadoc: Invalid member type qualification\n" +
4659
		"----------\n" +
4660
		"4. ERROR in implicit\\Invalid.java (at line 24)\n" +
4661
		"	* @see #Member.Level1(int) Invalid\n" +
4662
		"	        ^^^^^^^^^^^^^^^^^^\n" +
4663
		"Javadoc: Invalid member type qualification\n" +
4664
		"----------\n",
4665
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4666
	);
4590
	);
4667
}
4591
}
4668
4592
4669
/**
4593
/**
4670
 * Bug 116464: [javadoc] Unicode tag name are not correctly parsed
4594
 * Bug 87404: [javadoc] Unexpected not defined warning on constructor
4671
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464"
4595
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=87404"
4672
 */
4596
 */
4673
public void testBug116464() {
4597
public void testBug87404() {
4674
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4675
	runConformTest(
4598
	runConformTest(
4676
		new String[] {
4599
		new String[] {
4677
			"X.java",
4600
			"p/A.java",
4678
			"public class X {\n" +
4601
			"package p;\n" +
4679
			"	/**\n" +
4602
			"class A {\n" +
4680
			"	 * @\\u0070\\u0061\\u0072\\u0061\\u006d str xxx\n" +
4603
			"	A(char c) {}\n" +
4681
			"	 */\n" +
4604
			"	class B {\n" +
4682
			"	void foo(String str) {}\n" +
4605
			"		B(Exception ex) {}\n" +
4683
			"}\n"
4606
			"	}\n" +
4607
			"	void foo() {}\n" +
4608
			"    /**\n" +
4609
			"     * Link {@link #A(char)} OK \n" +
4610
			"     * Link {@link #A(String)} OK\n" +
4611
			"     * Link {@link #foo()} OK\n" +
4612
			"     * Link {@link #bar()} OK\n" +
4613
			"     */\n" +
4614
			"    public A(String str) {}\n" +
4615
			"	void bar() {}\n" +
4616
			"}"
4684
		}
4617
		}
4685
	);
4618
	);
4686
}
4619
}
4687
4620
4688
/**
4621
/**
4689
 * Bug 125903: [javadoc] Treat whitespace in javadoc tags as invalid tags
4622
 * Bug 90302: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
4690
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=125903"
4623
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=90302"
4691
 */
4624
 */
4692
public void testBug125903() {
4625
public void testBug90302() {
4693
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4626
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4694
	runNegativeTest(
4627
	runNegativeTest(
4695
		new String[] {
4628
		new String[] {
4696
			"X.java",
4629
			"X.java",
4697
			"/**\n" +
4630
			"/**\n" +
4698
			" * {@ link java.lang.String}\n" +
4631
			" * @see #foo(String)\n" +
4699
			" * @ since 2.1\n" +
4700
			" */\n" +
4632
			" */\n" +
4701
			"public class X {\n" +
4633
			"public class X {\n" +
4634
			"	/**\n" +
4635
			"	 * Static method\n" +
4636
			"	 * @param str\n" +
4637
			"	 * @return int\n" +
4638
			"	 * @throws NumberFormatException\n" +
4639
			"	 */\n" +
4640
			"	static int foo(String str) throws NumberFormatException{\n" +
4641
			"		return Integer.parseInt(str);\n" +
4642
			"	}\n" +
4643
			"}\n",
4644
			"Y.java",
4645
			"/**\n" +
4646
			" * @see #foo(String)\n" +
4647
			" */\n" +
4648
			"public class Y extends X { \n" +
4649
			"	/**\n" +
4650
			"	 * Static method: does not override super\n" +
4651
			"	 * {@inheritDoc}\n" +
4652
			"	 */\n" +
4653
			"	static int foo(String str) throws NumberFormatException{\n" +
4654
			"		return Integer.parseInt(str);\n" +
4655
			"	}\n" +
4702
			"}\n"
4656
			"}\n"
4703
		},
4657
		},
4704
		"----------\n" +
4658
		"----------\n" +
4705
		"1. ERROR in X.java (at line 2)\n" +
4659
		"1. ERROR in Y.java (at line 7)\n" +
4706
		"	* {@ link java.lang.String}\n" +
4660
		"	* {@inheritDoc}\n" +
4707
		"	   ^^\n" +
4661
		"	    ^^^^^^^^^^\n" +
4708
		"Javadoc: Invalid tag\n" +
4662
		"Javadoc: Unexpected tag\n" +
4709
		"----------\n" +
4663
		"----------\n" +
4710
		"2. ERROR in X.java (at line 3)\n" +
4664
		"2. ERROR in Y.java (at line 9)\n" +
4711
		"	* @ since 2.1\n" +
4665
		"	static int foo(String str) throws NumberFormatException{\n" +
4712
		"	  ^^\n" +
4666
		"	       ^^^\n" +
4713
		"Javadoc: Invalid tag\n" +
4667
		"Javadoc: Missing tag for return type\n" +
4668
		"----------\n" +
4669
		"3. ERROR in Y.java (at line 9)\n" +
4670
		"	static int foo(String str) throws NumberFormatException{\n" +
4671
		"	                      ^^^\n" +
4672
		"Javadoc: Missing tag for parameter str\n" +
4673
		"----------\n" +
4674
		"4. ERROR in Y.java (at line 9)\n" +
4675
		"	static int foo(String str) throws NumberFormatException{\n" +
4676
		"	                                  ^^^^^^^^^^^^^^^^^^^^^\n" +
4677
		"Javadoc: Missing tag for declared exception NumberFormatException\n" +
4714
		"----------\n",
4678
		"----------\n",
4715
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4679
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4716
	);
4680
	);
4717
}
4681
}
4718
4682
public void testBug90302b() {
4719
/**
4683
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
4720
 * Bug 128954: Javadoc problems with category CAT_INTERNAL
4721
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
4722
 */
4723
public void testBug128954() {
4724
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
4725
	this.reportDeprecation = CompilerOptions.WARNING;
4726
	runNegativeTest(
4684
	runNegativeTest(
4727
		new String[] {
4685
		new String[] {
4728
			"X.java", //========================
4686
			"X.java",
4687
			"/** */\n" +
4729
			"public class X {\n" +
4688
			"public class X {\n" +
4689
			"}\n",
4690
			"Y.java",
4691
			"/**\n" +
4692
			" * @see #foo(String)\n" +
4693
			" */\n" +
4694
			"public class Y extends X { \n" +
4730
			"	/**\n" +
4695
			"	/**\n" +
4731
			"	 * @see p.A#bar()\n" +
4696
			"	 * Simple method: does not override super\n" +
4697
			"	 * {@inheritDoc}\n" +
4732
			"	 */\n" +
4698
			"	 */\n" +
4733
			"	void foo() {\n" +
4699
			"	static int foo(String str) throws NumberFormatException{\n" +
4734
			"		Zork z;\n" +
4700
			"		return Integer.parseInt(str);\n" +
4735
			"	}\n" +
4736
			"}\n",
4737
			"p/A.java",  //========================
4738
			"package p;\n" +
4739
			"public class A {\n" +
4740
			"	/** @deprecated */\n" +
4741
			"	public void bar() {\n" +
4742
			"	}\n" +
4701
			"	}\n" +
4743
			"}\n"
4702
			"}\n"
4744
		},
4703
		},
4745
		"----------\n" +
4704
		"----------\n" +
4746
		"1. WARNING in X.java (at line 3)\n" +
4705
		"1. ERROR in Y.java (at line 7)\n" +
4747
		"	* @see p.A#bar()\n" +
4706
		"	* {@inheritDoc}\n" +
4748
		"	           ^^^^^\n" +
4707
		"	    ^^^^^^^^^^\n" +
4749
		"[@cat:javadoc] Javadoc: The method bar() from the type A is deprecated\n" +
4708
		"Javadoc: Unexpected tag\n" +
4750
		"----------\n" +
4709
		"----------\n" +
4751
		"2. ERROR in X.java (at line 6)\n" +
4710
		"2. ERROR in Y.java (at line 9)\n" +
4752
		"	Zork z;\n" +
4711
		"	static int foo(String str) throws NumberFormatException{\n" +
4753
		"	^^^^\n" +
4754
		"[@cat:type] Zork cannot be resolved to a type\n" +
4755
		"----------\n",
4756
		null,
4757
		true,
4758
		null,
4759
		false,
4760
		true,
4761
		true);
4762
}
4763
4764
/**
4765
 * Bug 128954: Javadoc problems with category CAT_INTERNAL - variation
4766
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
4767
 */
4768
public void testBug128954a() {
4769
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
4770
	this.reportDeprecation = CompilerOptions.WARNING;
4771
	runNegativeTest(
4772
		new String[] {
4773
			"X.java",
4774
			"public class X {\n" +
4775
			"	\n" +
4776
			"	/**\n" +
4777
			"	 * @see p.A#bar()\n" +
4778
			"	 */\n" +
4779
			"	void foo() {\n" +
4780
			"		Zork z;\n" +
4781
			"	}\n" +
4782
			"}\n",
4783
		},
4784
		"----------\n" +
4785
		"1. WARNING in X.java (at line 4)\n" +
4786
		"	* @see p.A#bar()\n" +
4787
		"	       ^^^\n" +
4712
		"	       ^^^\n" +
4788
		"[@cat:javadoc] Javadoc: p cannot be resolved to a type\n" +
4713
		"Javadoc: Missing tag for return type\n" +
4789
		"----------\n" +
4714
		"----------\n" +
4790
		"2. ERROR in X.java (at line 7)\n" +
4715
		"3. ERROR in Y.java (at line 9)\n" +
4791
		"	Zork z;\n" +
4716
		"	static int foo(String str) throws NumberFormatException{\n" +
4792
		"	^^^^\n" +
4717
		"	                      ^^^\n" +
4793
		"[@cat:type] Zork cannot be resolved to a type\n" +
4718
		"Javadoc: Missing tag for parameter str\n" +
4719
		"----------\n" +
4720
		"4. ERROR in Y.java (at line 9)\n" +
4721
		"	static int foo(String str) throws NumberFormatException{\n" +
4722
		"	                                  ^^^^^^^^^^^^^^^^^^^^^\n" +
4723
		"Javadoc: Missing tag for declared exception NumberFormatException\n" +
4794
		"----------\n",
4724
		"----------\n",
4795
		null,
4725
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4796
		true,
4726
	);
4797
		null,
4798
		false,
4799
		true,
4800
		true);
4801
}
4727
}
4802
4728
4803
/**
4729
/**
4804
 * Bug 129241: [Javadoc] deprecation warning wrongly reported when ignoring Malformed Javadoc comments
4730
 * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
4805
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=129241"
4731
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
4806
 */
4732
 */
4807
public void testBug129241a() {
4733
public void testBug103304a_public() {
4808
	runNegativeTest(
4734
	String[] units = new String[] {
4809
		new String[] {
4735
			"boden/IAFAState.java",
4810
			"X.java",
4736
			"package boden;\n" +
4811
			"public class X {\n" +
4737
			"public interface IAFAState {\n" +
4812
			"	/**\n" +
4738
			"    public class ValidationException extends Exception {\n" +
4813
			"	 * @see p.A#bar\n" +
4739
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4814
			"	 */\n" +
4740
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4815
			"	void foo() {}\n" +
4741
			"        }\n" +
4742
			"        public void method() {}\n" +
4743
			"    }\n" +
4744
			"    /**\n" +
4745
			"     * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
4746
			"     * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
4747
			"     * @throws ValidationException Thrown if a variable is unbound. \n" +
4748
			"     * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4749
			"     * @see IAFAState.ValidationException#method()\n" +
4750
			"     * @see ValidationException\n" +
4751
			"     * {@link ValidationException}\n" +
4752
			"     */\n" +
4753
			"    public void validate() throws ValidationException;\n" +
4816
			"}\n",
4754
			"}\n",
4817
			"p/A.java",
4755
			"boden/TestValid.java",
4818
			"package p;\n" +
4756
			"package boden;\n" +
4819
			"/** @deprecated */\n" +
4757
			"import boden.IAFAState.ValidationException;\n" +
4820
			"public class A {\n" +
4758
			"/**\n" +
4821
			"	void bar() {}\n" +
4759
			" * @see ValidationException\n" +
4822
			"}\n"
4760
			" * @see IAFAState.ValidationException\n" +
4823
		},
4761
			" */\n" +
4824
		"----------\n" +
4762
			"public class TestValid {\n" +
4825
		"1. ERROR in X.java (at line 3)\n" +
4763
			"	/**  \n" +
4826
		"	* @see p.A#bar\n" +
4764
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4827
		"	       ^^^\n" +
4828
		"Javadoc: The type A is deprecated\n" +
4829
		"----------\n",
4830
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4831
	);
4832
}
4833
public void testBug129241b() {
4834
	this.reportDeprecation = CompilerOptions.IGNORE;
4835
	runNegativeTest(
4836
		new String[] {
4837
			"X.java",
4838
			"public class X {\n" +
4839
			"	/**\n" +
4840
			"	 * @see p.A#bar\n" +
4841
			"	 */\n" +
4765
			"	 */\n" +
4842
			"	void foo() {}\n" +
4766
			"	IAFAState.ValidationException valid1;\n" +
4843
			"}\n",
4844
			"p/A.java",
4845
			"package p;\n" +
4846
			"/** @deprecated */\n" +
4847
			"public class A {\n" +
4848
			"	void bar() {}\n" +
4849
			"}\n"
4850
		},
4851
		"----------\n" +
4852
		"1. ERROR in X.java (at line 3)\n" +
4853
		"	* @see p.A#bar\n" +
4854
		"	       ^^^\n" +
4855
		"Javadoc: The type A is deprecated\n" +
4856
		"----------\n",
4857
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4858
	);
4859
}
4860
public void testBug129241c() {
4861
	this.reportJavadocDeprecation = CompilerOptions.DISABLED;
4862
	runConformTest(
4863
		new String[] {
4864
			"X.java",
4865
			"public class X {\n" +
4866
			"	/**\n" +
4767
			"	/**\n" +
4867
			"	 * @see p.A#bar\n" +
4768
			"	 * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4868
			"	 */\n" +
4769
			"	 */\n" +
4869
			"	void foo() {}\n" +
4770
			"	IAFAState.ValidationException valid2;\n" +
4870
			"}\n",
4871
			"p/A.java",
4872
			"package p;\n" +
4873
			"/** @deprecated */\n" +
4874
			"public class A {\n" +
4875
			"	void bar() {}\n" +
4876
			"}\n"
4771
			"}\n"
4877
		}
4772
		};
4878
	);
4773
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4774
		runNegativeTest(units,
4775
			//boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
4776
			"----------\n" +
4777
			"1. ERROR in boden\\TestValid.java (at line 4)\n" +
4778
			"	* @see ValidationException\n" +
4779
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4780
			"Javadoc: Invalid member type qualification\n" +
4781
			"----------\n" +
4782
			"2. ERROR in boden\\TestValid.java (at line 9)\n" +
4783
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4784
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4785
			"Javadoc: Invalid member type qualification\n" +
4786
			"----------\n",
4787
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4788
		);
4789
	} else {
4790
		runConformTest(units);
4791
	}
4879
}
4792
}
4880
public void testBug129241d() {
4793
4881
	this.reportInvalidJavadoc = CompilerOptions.IGNORE;
4794
public void testBug103304a_private() {
4882
	runConformTest(
4795
	String[] units = new String[] {
4883
		new String[] {
4796
			"boden/IAFAState.java",
4884
			"X.java",
4797
			"package boden;\n" +
4885
			"public class X {\n" +
4798
			"public interface IAFAState {\n" +
4799
			"    public class ValidationException extends Exception {\n" +
4800
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4801
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4802
			"        }\n" +
4803
			"        public void method() {}\n" +
4804
			"    }\n" +
4805
			"    /**\n" +
4806
			"     * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
4807
			"     * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
4808
			"     * @throws ValidationException Thrown if a variable is unbound. \n" +
4809
			"     * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4810
			"     * @see IAFAState.ValidationException#method()\n" +
4811
			"     * @see ValidationException\n" +
4812
			"     * {@link ValidationException}\n" +
4813
			"     */\n" +
4814
			"    public void validate() throws ValidationException;\n" +
4815
			"}\n",
4816
			"boden/TestValid.java",
4817
			"package boden;\n" +
4818
			"import boden.IAFAState.ValidationException;\n" +
4819
			"/**\n" +
4820
			" * @see ValidationException\n" +
4821
			" * @see IAFAState.ValidationException\n" +
4822
			" */\n" +
4823
			"public class TestValid {\n" +
4824
			"	/**  \n" +
4825
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4826
			"	 */\n" +
4827
			"	IAFAState.ValidationException valid1;\n" +
4886
			"	/**\n" +
4828
			"	/**\n" +
4887
			"	 * @see p.A#bar\n" +
4829
			"	 * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4888
			"	 */\n" +
4830
			"	 */\n" +
4889
			"	void foo() {}\n" +
4831
			"	IAFAState.ValidationException valid2;\n" +
4890
			"}\n",
4891
			"p/A.java",
4892
			"package p;\n" +
4893
			"/** @deprecated */\n" +
4894
			"public class A {\n" +
4895
			"	void bar() {}\n" +
4896
			"}\n"
4832
			"}\n"
4897
		}
4833
		};
4898
	);
4834
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4835
		runNegativeTest(units,
4836
			//boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
4837
			//boden\TestValid.java:12: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
4838
			"----------\n" +
4839
			"1. ERROR in boden\\TestValid.java (at line 4)\n" +
4840
			"	* @see ValidationException\n" +
4841
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4842
			"Javadoc: Invalid member type qualification\n" +
4843
			"----------\n" +
4844
			"2. ERROR in boden\\TestValid.java (at line 9)\n" +
4845
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4846
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4847
			"Javadoc: Invalid member type qualification\n" +
4848
			"----------\n",
4849
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4850
		);
4851
	} else {
4852
		runConformTest(units);
4853
	}
4899
}
4854
}
4900
4855
4901
/**
4856
public void testBug103304b() {
4902
 * Bug 132813: NPE in Javadoc.resolve(Javadoc.java:196) + log swamped
4857
	this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
4903
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=132813"
4858
	String[] units = new String[] {
4904
 */
4859
			"boden/IAFAState.java",
4905
public void testBug132813() {
4860
			"package boden;\n" +
4906
	runNegativeTest(
4861
			"public interface IAFAState {\n" +
4907
		new String[] {
4862
			"    public class ValidationException extends Exception {\n" +
4908
			"Test.java",
4863
			"        public ValidationException(String variableName, IAFAState subformula) {\n" +
4909
			"public class X { \n" +
4864
			"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
4910
			"	/**	 */ \n" +
4865
			"        }\n" +
4911
			"	public Test() {}\n" +
4866
			"        public void method() {}\n" +
4912
			"	/**	 */\n" +
4867
			"    }\n" +
4913
			"	public test() {}\n" +
4868
			"}\n",
4914
			"}\n"			},
4869
			"boden/TestInvalid1.java",
4915
		"----------\n" +
4870
			"package boden;\n" +
4916
		"1. ERROR in Test.java (at line 1)\n" +
4871
			"import boden.IAFAState.ValidationException;\n" +
4917
		"	public class X { \n" +
4872
			"public class TestInvalid1 {\n" +
4918
		"	             ^\n" +
4873
			"	/** \n" +
4919
		"The public type X must be defined in its own file\n" +
4874
			"	 * @see ValidationException#ValidationException(String, IAFAState)\n" +
4920
		"----------\n" +
4875
			"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4921
		"2. ERROR in Test.java (at line 3)\n" +
4876
			"	 */ \n" +
4922
		"	public Test() {}\n" +
4877
			"	IAFAState.ValidationException invalid;\n" +
4923
		"	       ^^^^^^\n" +
4878
			"}\n",
4924
		"Return type for the method is missing\n" +
4879
			"boden/TestInvalid2.java",
4925
		"----------\n" +
4880
			"package boden;\n" +
4926
		"3. ERROR in Test.java (at line 5)\n" +
4881
			"public class TestInvalid2 {\n" +
4927
		"	public test() {}\n" +
4882
			"	/**\n" +
4928
		"	       ^^^^^^\n" +
4883
			"	 * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
4929
		"Return type for the method is missing\n" +
4884
			"	 */\n" +
4930
		"----------\n"
4885
			"	IAFAState.ValidationException invalid;\n" +
4886
			"}\n",
4887
			"boden/TestInvalid3.java",
4888
			"package boden;\n" +
4889
			"import boden.IAFAState.ValidationException;\n" +
4890
			"public class TestInvalid3 {\n" +
4891
			"	/**\n" +
4892
			"	 * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4893
			"	 */\n" +
4894
			"	IAFAState.ValidationException invalid;\n" +
4895
			"}\n",
4896
			"boden/TestInvalid4.java",
4897
			"package boden;\n" +
4898
			"import boden.IAFAState.ValidationException;\n" +
4899
			"public class TestInvalid4 {\n" +
4900
			"	/**\n" +
4901
			"	 * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4902
			"	 */\n" +
4903
			"	IAFAState.ValidationException invalid;\n" +
4904
			"}\n"
4905
		};
4906
	String errors_14 = new String (
4907
			//boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
4908
			//boden\TestInvalid1.java:8: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
4909
			//boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException => bug ID: 4288720
4910
			//boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
4911
			//boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
4912
			"----------\n" +
4913
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
4914
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" +
4915
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4916
			"Javadoc: Invalid member type qualification\n" +
4917
			"----------\n" +
4918
			"2. ERROR in boden\\TestInvalid1.java (at line 6)\n" +
4919
			"	* @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
4920
			"	       ^^^^^^^^^^^^^^^^^^^\n" +
4921
			"Javadoc: Invalid member type qualification\n" +
4922
			"----------\n" +
4923
			"----------\n" +
4924
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
4925
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4926
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4927
			"Javadoc: Invalid member type qualification\n" +
4928
			"----------\n" +
4929
			"----------\n" +
4930
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
4931
			"	* @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4932
			"	                                     ^^^^^^^^^\n" +
4933
			"Javadoc: IAFAState cannot be resolved or is not a field\n" +
4934
			"----------\n"
4931
	);
4935
	);
4932
}
4936
	String errors_50 = new String (
4937
			//boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
4938
			//boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException => bug ID: 4288720
4939
			//boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
4940
			//boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
4941
			"----------\n" +
4942
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
4943
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
4944
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4945
			"Javadoc: Invalid member type qualification\n" +
4946
			"----------\n" +
4947
			"----------\n" +
4948
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
4949
			"	* @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
4950
			"	                                     ^^^^^^^^^\n" +
4951
			"Javadoc: IAFAState cannot be resolved or is not a field\n" +
4952
			"----------\n"
4953
	);
4954
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
4955
		runNegativeTest(units, errors_14);
4956
	} else {
4957
		runNegativeTest(units, errors_50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4958
	}
4933
4959
4934
/**
4960
}
4935
 * Bug 149013: [javadoc] In latest 3.3 build, there is a javadoc error in org.eclipse.core.resources
4961
public void testBug103304c() {
4936
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=149013"
4937
 */
4938
public void testBug149013_Private01() {
4939
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
4940
	runConformTest(
4962
	runConformTest(
4941
		new String[] {
4963
		new String[] {
4942
			"test1/X.java",
4964
			"test/Test.java",
4943
			"package test1;\n" +
4965
			"package test;\n" +
4944
			"public class X {\n" +
4966
			"public interface Test {\n" +
4945
			"	class Inner {\n" +
4967
			"	public class Level0 {\n" +
4946
			"		class Level2 {\n" +
4968
			"		public Level0() {}\n" +
4947
			"			class Level3 {}\n" +
4969
			"	}\n" +
4970
			"	public interface Member {\n" +
4971
			"		public class Level1 {\n" +
4972
			"			public Level1() {}\n" +
4948
			"		}\n" +
4973
			"		}\n" +
4949
			"	}\n" +
4974
			"	}\n" +
4950
			"}\n",
4975
			"}\n",
4951
			"test1/Test.java",
4976
			"test/C.java",
4952
			"package test1;\n" +
4977
			"package test;\n" +
4953
			"/**\n" +
4978
			"public class C {\n" +
4954
			" * @see X.Inner\n" +
4979
			"	/**\n" +
4955
			" * @see X.Inner.Level2\n" +
4980
			"	 * @see Test.Level0#Test.Level0()\n" +
4956
			" * @see X.Inner.Level2.Level3\n" +
4981
			"	 */\n" +
4957
			" */\n" +
4982
			"	Test.Level0 valid = new Test.Level0();\n" +
4958
			"public class Test {}\n",
4983
			"	/**\n" +
4984
			"	 * @see Test.Level0#Level0()\n" +
4985
			"	 */\n" +
4986
			"	Test.Level0 invalid = new Test.Level0();\n" +
4987
			"}\n"
4959
		}
4988
		}
4989
		//test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0 => bug ID: 4288720
4960
	);
4990
	);
4961
}
4991
}
4962
public void testBug149013_Public01() {
4992
public void testBug103304d() {
4963
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
4964
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
4965
	runNegativeTest(
4993
	runNegativeTest(
4966
		new String[] {
4994
		new String[] {
4967
			"test1/X.java",
4995
			"test/Test.java",
4968
			"package test1;\n" +
4996
			"package test;\n" +
4969
			"public class X {\n" +
4997
			"public interface Test {\n" +
4970
			"	class Inner {\n" +
4998
			"	public class Level0 {\n" +
4971
			"		class Level2 {\n" +
4999
			"		public Level0() {}\n" +
4972
			"			class Level3 {}\n" +
5000
			"	}\n" +
5001
			"	public interface Member {\n" +
5002
			"		public class Level1 {\n" +
5003
			"			public Level1() {}\n" +
4973
			"		}\n" +
5004
			"		}\n" +
4974
			"	}\n" +
5005
			"	}\n" +
4975
			"}\n",
5006
			"}\n",
4976
			"test1/Test.java",
5007
			"test/C2.java",
4977
			"package test1;\n" +
5008
			"package test;\n" +
4978
			"/**\n" +
5009
			"public class C2 {\n" +
4979
			" * @see X.Inner\n" +
5010
			"	/**\n" +
4980
			" * @see X.Inner.Level2\n" +
5011
			"	 * @see Test.Member.Level1#Test.Member.Level1()\n" +
4981
			" * @see X.Inner.Level2.Level3\n" +
5012
			"	 */\n" +
4982
			" */\n" +
5013
			"	Test.Member.Level1 valid = new Test.Member.Level1();\n" +
4983
			"public class Test {\n" +
5014
			"	/**\n" +
5015
			"	 * @see Test.Member.Level1#Level1()\n" +
5016
			"	 */\n" +
5017
			"	Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
5018
			"	/**\n" +
5019
			"	 * @see Test.Member.Level1#Test.Level1()\n" +
5020
			"	 */\n" +
5021
			"	Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
4984
			"}\n"
5022
			"}\n"
4985
		},
5023
		},
4986
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner
5024
		//test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1 => Bug ID: 4288720
4987
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2
5025
		//test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
4988
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2.Level3
4989
		"----------\n" +
4990
		"1. ERROR in test1\\Test.java (at line 3)\n" +
4991
		"	* @see X.Inner\n" +
4992
		"	       ^^^^^^^\n" +
4993
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
4994
		"----------\n" +
4995
		"2. ERROR in test1\\Test.java (at line 4)\n" +
4996
		"	* @see X.Inner.Level2\n" +
4997
		"	       ^^^^^^^^^^^^^^\n" +
4998
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
4999
		"----------\n" +
5026
		"----------\n" +
5000
		"3. ERROR in test1\\Test.java (at line 5)\n" +
5027
		"1. ERROR in test\\C2.java (at line 12)\n" +
5001
		"	* @see X.Inner.Level2.Level3\n" +
5028
		"	* @see Test.Member.Level1#Test.Level1()\n" +
5002
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5029
		"	                          ^^^^^^^^^^^^^\n" +
5003
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
5030
		"Javadoc: Invalid member type qualification\n" +
5004
		"----------\n",
5031
		"----------\n",
5005
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5032
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5006
	);
5033
	);
5007
}
5034
}
5008
public void testBug149013_Private02() {
5035
public void testBug103304e() {
5009
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
5036
	runConformTest(
5010
	runNegativeTest(
5011
		new String[] {
5037
		new String[] {
5012
			"test1/X.java",
5038
			"implicit/Valid.java",
5013
			"package test1;\n" +
5039
			"package implicit;\n" +
5014
			"public class X {\n" +
5040
			"public interface Valid {\n" +
5015
			"	class Inner {\n" +
5041
			"	public class Level0 {\n" +
5016
			"		class Level2 {\n" +
5042
			"		/**\n" +
5017
			"			class Level3 {}\n" +
5043
			"		 * @see #Valid.Level0() Valid\n" +
5018
			"		}\n" +
5044
			"		 */\n" +
5045
			"		public Level0() {}\n" +
5046
			"		/**\n" +
5047
			"		 * @see #Valid.Level0(String) Valid\n" +
5048
			"		 */\n" +
5049
			"		public Level0(String str) {}\n" +
5019
			"	}\n" +
5050
			"	}\n" +
5020
			"}\n",
5051
			"	public interface Member {\n" +
5021
			"test2/Test.java",
5052
			"		public class Level1 {\n" +
5022
			"package test2;\n" +
5053
			"			/**\n" +
5023
			"import test1.X;\n" +
5054
			"			 * @see #Valid.Member.Level1() Valid\n" +
5024
			"/**\n" +
5055
			"			 */\n" +
5025
			" * @see X.Inner\n" +
5056
			"			public Level1() {}\n" +
5026
			" * @see X.Inner.Level2\n" +
5057
			"			/**\n" +
5027
			" * @see X.Inner.Level2.Level3\n" +
5058
			"			 * @see #Valid.Member.Level1(int) Valid\n" +
5028
			" */\n" +
5059
			"			 */\n" +
5029
			"public class Test {}\n",
5060
			"			public Level1(int x) {}\n" +
5030
		},
5031
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
5032
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
5033
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
5034
		"----------\n" +
5035
		"1. ERROR in test2\\Test.java (at line 4)\r\n" +
5036
		"	* @see X.Inner\r\n" +
5037
		"	       ^^^^^^^\n" +
5038
		"Javadoc: The type X.Inner is not visible\n" +
5039
		"----------\n" +
5040
		"2. ERROR in test2\\Test.java (at line 5)\r\n" +
5041
		"	* @see X.Inner.Level2\r\n" +
5042
		"	       ^^^^^^^^^^^^^^\n" +
5043
		"Javadoc: The type X.Inner is not visible\n" +
5044
		"----------\n" +
5045
		"3. ERROR in test2\\Test.java (at line 6)\r\n" +
5046
		"	* @see X.Inner.Level2.Level3\r\n" +
5047
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5048
		"Javadoc: The type X.Inner is not visible\n" +
5049
		"----------\n",
5050
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5051
	);
5052
}
5053
public void testBug149013_Public02() {
5054
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
5055
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5056
	runNegativeTest(
5057
		new String[] {
5058
			"test1/X.java",
5059
			"package test1;\n" +
5060
			"public class X {\n" +
5061
			"	class Inner {\n" +
5062
			"		class Level2 {\n" +
5063
			"			class Level3 {}\n" +
5064
			"		}\n" +
5061
			"		}\n" +
5065
			"	}\n" +
5062
			"	}\n" +
5066
			"}\n",
5063
			"}\n"
5067
			"test2/Test.java",
5064
		}
5068
			"package test2;\n" +
5069
			"import test1.X;\n" +
5070
			"/**\n" +
5071
			" * @see X.Inner\n" +
5072
			" * @see X.Inner.Level2\n" +
5073
			" * @see X.Inner.Level2.Level3\n" +
5074
			" */\n" +
5075
			"public class Test {}\n",
5076
		},
5077
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
5078
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
5079
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
5080
		"----------\n" +
5081
		"1. ERROR in test2\\Test.java (at line 4)\r\n" +
5082
		"	* @see X.Inner\r\n" +
5083
		"	       ^^^^^^^\n" +
5084
		"Javadoc: The type X.Inner is not visible\n" +
5085
		"----------\n" +
5086
		"2. ERROR in test2\\Test.java (at line 5)\r\n" +
5087
		"	* @see X.Inner.Level2\r\n" +
5088
		"	       ^^^^^^^^^^^^^^\n" +
5089
		"Javadoc: The type X.Inner is not visible\n" +
5090
		"----------\n" +
5091
		"3. ERROR in test2\\Test.java (at line 6)\r\n" +
5092
		"	* @see X.Inner.Level2.Level3\r\n" +
5093
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5094
		"Javadoc: The type X.Inner is not visible\n" +
5095
		"----------\n",
5096
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5097
	);
5065
	);
5098
}
5066
}
5099
public void testBug149013_Private03() {
5067
public void testBug103304f() {
5100
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
5101
	runNegativeTest(
5068
	runNegativeTest(
5102
		new String[] {
5069
		new String[] {
5103
			"test1/X.java",
5070
			"implicit/Invalid.java",
5104
			"package test1;\n" +
5071
			"package implicit;\n" +
5105
			"public class X {\n" +
5072
			"public interface Invalid {\n" +
5106
			"	class Inner {\n" +
5073
			"	public class Level0 {\n" +
5107
			"		class Level2 {\n" +
5074
			"		/**\n" +
5108
			"			class Level3 {}\n" +
5075
			"		 * @see #Level0() Invalid\n" +
5076
			"		 */\n" +
5077
			"		public Level0() {}\n" +
5078
			"		/**\n" +
5079
			"		 * @see #Level0(String) Invalid\n" +
5080
			"		 */\n" +
5081
			"		public Level0(String str) {}\n" +
5082
			"	}\n" +
5083
			"	public interface Member {\n" +
5084
			"		public class Level1 {\n" +
5085
			"			/**\n" +
5086
			"			 * @see #Level1() Invalid\n" +
5087
			"			 * @see #Member.Level1() Invalid\n" +
5088
			"			 * @see #Invalid.Level1() Invalid\n" +
5089
			"			 */\n" +
5090
			"			public Level1() {}\n" +
5091
			"			/**\n" +
5092
			"			 * @see #Level1(int) Invalid\n" +
5093
			"			 * @see #Invalid.Level1(int) Invalid\n" +
5094
			"			 * @see #Member.Level1(int) Invalid\n" +
5095
			"			 */\n" +
5096
			"			public Level1(int x) {}\n" +
5109
			"		}\n" +
5097
			"		}\n" +
5110
			"	}\n" +
5098
			"	}\n" +
5111
			"}\n",
5099
			"}\n"
5112
			"test3/Test.java",
5113
			"package test3;\n" +
5114
			"/**\n" +
5115
			" * @see test1.X.Inner\n" +
5116
			" * @see test1.X.Inner.Level2\n" +
5117
			" * @see test1.X.Inner.Level2.Level3\n" +
5118
			" */\n" +
5119
			"public class Test {}\n"
5120
		},
5100
		},
5121
		// no warning
5101
		//implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0 => bug ID: 4288720
5102
		//implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0 => bug ID: 4288720
5103
		//implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1 => bug ID: 4288720
5104
		//implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
5105
		//implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
5106
		//implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1 => bug ID: 4288720
5107
		//implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
5108
		//implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
5122
		"----------\n" +
5109
		"----------\n" +
5123
		"1. ERROR in test3\\Test.java (at line 3)\r\n" +
5110
		"1. ERROR in implicit\\Invalid.java (at line 17)\n" +
5124
		"	* @see test1.X.Inner\r\n" +
5111
		"	* @see #Member.Level1() Invalid\n" +
5125
		"	       ^^^^^^^^^^^^^\n" +
5112
		"	        ^^^^^^^^^^^^^^^\n" +
5126
		"Javadoc: The type test1.X.Inner is not visible\n" +
5113
		"Javadoc: Invalid member type qualification\n" +
5127
		"----------\n" +
5114
		"----------\n" +
5128
		"2. ERROR in test3\\Test.java (at line 4)\r\n" +
5115
		"2. ERROR in implicit\\Invalid.java (at line 18)\n" +
5129
		"	* @see test1.X.Inner.Level2\r\n" +
5116
		"	* @see #Invalid.Level1() Invalid\n" +
5130
		"	       ^^^^^^^^^^^^^^^^^^^^\n" +
5117
		"	        ^^^^^^^^^^^^^^^^\n" +
5131
		"Javadoc: The type test1.X.Inner is not visible\n" +
5118
		"Javadoc: Invalid member type qualification\n" +
5132
		"----------\n" +
5119
		"----------\n" +
5133
		"3. ERROR in test3\\Test.java (at line 5)\r\n" +
5120
		"3. ERROR in implicit\\Invalid.java (at line 23)\n" +
5134
		"	* @see test1.X.Inner.Level2.Level3\r\n" +
5121
		"	* @see #Invalid.Level1(int) Invalid\n" +
5135
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5122
		"	        ^^^^^^^^^^^^^^^^^^^\n" +
5136
		"Javadoc: The type test1.X.Inner is not visible\n" +
5123
		"Javadoc: Invalid member type qualification\n" +
5124
		"----------\n" +
5125
		"4. ERROR in implicit\\Invalid.java (at line 24)\n" +
5126
		"	* @see #Member.Level1(int) Invalid\n" +
5127
		"	        ^^^^^^^^^^^^^^^^^^\n" +
5128
		"Javadoc: Invalid member type qualification\n" +
5137
		"----------\n",
5129
		"----------\n",
5138
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5130
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5139
	);
5131
	);
5140
}
5132
}
5141
public void testBug149013_Public03() {
5133
5142
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
5134
/**
5143
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5135
 * Bug 116464: [javadoc] Unicode tag name are not correctly parsed
5144
	runNegativeTest(
5136
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464"
5137
 */
5138
public void testBug116464() {
5139
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
5140
	runConformTest(
5145
		new String[] {
5141
		new String[] {
5146
			"test1/X.java",
5142
			"X.java",
5147
			"package test1;\n" +
5148
			"public class X {\n" +
5143
			"public class X {\n" +
5149
			"	class Inner {\n" +
5144
			"	/**\n" +
5150
			"		class Level2 {\n" +
5145
			"	 * @\\u0070\\u0061\\u0072\\u0061\\u006d str xxx\n" +
5151
			"			class Level3 {}\n" +
5146
			"	 */\n" +
5152
			"		}\n" +
5147
			"	void foo(String str) {}\n" +
5153
			"	}\n" +
5148
			"}\n"
5154
			"}\n",
5149
		}
5155
			"test3/Test.java",
5156
			"package test3;\n" +
5157
			"/**\n" +
5158
			" * @see test1.X.Inner\n" +
5159
			" * @see test1.X.Inner.Level2\n" +
5160
			" * @see test1.X.Inner.Level2.Level3\n" +
5161
			" */\n" +
5162
			"public class Test {}\n"
5163
		},
5164
		// no warning
5165
		"----------\n" +
5166
		"1. ERROR in test3\\Test.java (at line 3)\r\n" +
5167
		"	* @see test1.X.Inner\r\n" +
5168
		"	       ^^^^^^^^^^^^^\n" +
5169
		"Javadoc: The type test1.X.Inner is not visible\n" +
5170
		"----------\n" +
5171
		"2. ERROR in test3\\Test.java (at line 4)\r\n" +
5172
		"	* @see test1.X.Inner.Level2\r\n" +
5173
		"	       ^^^^^^^^^^^^^^^^^^^^\n" +
5174
		"Javadoc: The type test1.X.Inner is not visible\n" +
5175
		"----------\n" +
5176
		"3. ERROR in test3\\Test.java (at line 5)\r\n" +
5177
		"	* @see test1.X.Inner.Level2.Level3\r\n" +
5178
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5179
		"Javadoc: The type test1.X.Inner is not visible\n" +
5180
		"----------\n",
5181
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5182
	);
5150
	);
5183
}
5151
}
5184
5152
5185
/**
5153
/**
5186
 * @bug 153399: [javadoc] JDT Core should warn if the @value tag is not used correctly
5154
 * @bug 125518: [javadoc] Embedding html in a link placed in a @see JavaDoc tag causes a warning
5187
 * @test Ensure that 'value' tag is well warned when not used correctly
5155
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125518"
5188
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=153399"
5189
 */
5156
 */
5190
public void testBug153399a() {
5157
public void testBug125518a() {
5191
	String[] testFiles = new String[] {
5158
	String[] units = new String[] {
5192
		"X.java",
5159
		"pkg/X.java",
5193
		"public class X { \n" +
5160
		"package pkg;\n" +
5194
		"	/**\n" +
5161
		"\n" +
5195
		"	 * {@value #MY_VALUE}\n" +
5162
		"public class X {\n" +
5196
		"	 */\n" +
5197
		"	public final static int MY_VALUE = 0; \n" +
5198
		"	/**\n" +
5199
		"	 * {@value #MY_VALUE}\n" +
5200
		"	 */\n" +
5201
		"	public void foo() {}\n" +
5202
		"	/**\n" +
5163
		"	/**\n" +
5203
		"	 * {@value #MY_VALUE}\n" +
5164
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></\n" +
5204
		"	 */\n" +
5165
		"	 */\n" +
5205
		"	class Sub {} \n" +
5166
		"	public void foo() { \n" +
5167
		"	 \n" +
5168
		"	}\n" +
5206
		"}\n"
5169
		"}\n"
5207
	};
5170
	};
5208
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5171
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5209
		runNegativeTest(testFiles,
5172
	runConformTest(true, units,
5210
			"----------\n" +
5211
			"1. ERROR in X.java (at line 7)\n" +
5212
			"	* {@value #MY_VALUE}\n" +
5213
			"	    ^^^^^\n" +
5214
			"Javadoc: Unexpected tag\n" +
5215
			"----------\n" +
5173
			"----------\n" +
5216
			"2. ERROR in X.java (at line 11)\n" +
5174
			"1. WARNING in pkg\\X.java (at line 5)\n" +
5217
			"	* {@value #MY_VALUE}\n" +
5175
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></\n" +
5218
			"	    ^^^^^\n" +
5176
			"	                                                     ^^\n" +
5219
			"Javadoc: Unexpected tag\n" +
5177
			"Javadoc: Malformed link reference\n" +
5220
			"----------\n"
5178
			"----------\n",
5221
		);
5179
			null, null,
5222
	} else {
5180
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
5223
		runConformTest(testFiles);
5224
	}
5225
}
5181
}
5226
public void testBug153399b() {
5182
5227
	String[] testFiles = new String[] {
5183
public void testBug125518b() {
5228
		"X.java",
5184
	String[] units = new String[] {
5229
		"public class X { \n" +
5185
		"pkg/X.java",
5230
		"	/**\n" +
5186
		"package pkg;\n" +
5231
		"	 * {@value}\n" +
5187
		"\n" +
5232
		"	 */\n" +
5188
		"public class X {\n" +
5233
		"	public final static int MY_VALUE = 0; \n" +
5234
		"	/**\n" +
5235
		"	 * {@value}\n" +
5236
		"	 */\n" +
5237
		"	public void foo() {}\n" +
5238
		"	/**\n" +
5189
		"	/**\n" +
5239
		"	 * {@value}\n" +
5190
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></a\n" +
5240
		"	 */\n" +
5191
		"	 */\n" +
5241
		"	class Sub {} \n" +
5192
		"	public void foo() { \n" +
5193
		"	 \n" +
5194
		"	}\n" +
5242
		"}\n"
5195
		"}\n"
5243
	};
5196
	};
5244
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5197
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5245
		runNegativeTest(testFiles,
5198
	runConformTest(true, units,
5246
			"----------\n" +
5247
			"1. ERROR in X.java (at line 7)\n" +
5248
			"	* {@value}\n" +
5249
			"	    ^^^^^\n" +
5250
			"Javadoc: Unexpected tag\n" +
5251
			"----------\n" +
5199
			"----------\n" +
5252
			"2. ERROR in X.java (at line 11)\n" +
5200
			"1. WARNING in pkg\\X.java (at line 5)\n" +
5253
			"	* {@value}\n" +
5201
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></a\n" +
5254
			"	    ^^^^^\n" +
5202
			"	                                                     ^^^\n" +
5255
			"Javadoc: Unexpected tag\n" +
5203
			"Javadoc: Malformed link reference\n" +
5256
			"----------\n"
5204
			"----------\n",
5257
		);
5205
			null, null,
5258
	} else {
5206
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
5259
		runConformTest(testFiles);
5260
	}
5261
}
5207
}
5262
public void testBug153399c() {
5208
5263
	String[] testFiles = new String[] {
5209
public void testBug125518c() {
5264
		"p1/X.java",
5210
	String[] units = new String[] {
5265
		"package p1;\n" +
5211
		"pkg/X.java",
5212
		"package pkg;\n" +
5213
		"\n" +
5266
		"public class X {\n" +
5214
		"public class X {\n" +
5267
		"	/**\n" +
5215
		"	/**\n" +
5268
		"	 * @return a\n" +
5216
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></>\n" +
5269
		"	 */\n" +
5217
		"	 */\n" +
5270
		"	boolean get() {\n" +
5218
		"	public void foo() { \n" +
5271
		"		return false;\n" +
5219
		"	 \n" +
5272
		"	}\n" +
5220
		"	}\n" +
5273
		"}\n"
5221
		"}\n"
5274
	};
5222
	};
5275
	runConformTest(testFiles);
5223
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5224
	runConformTest(true, units,
5225
			"----------\n" +
5226
			"1. WARNING in pkg\\X.java (at line 5)\n" +
5227
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></>\n" +
5228
			"	                                                     ^^^\n" +
5229
			"Javadoc: Malformed link reference\n" +
5230
			"----------\n",
5231
			null, null,
5232
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
5276
}
5233
}
5277
public void testBug153399d() {
5234
5278
	String[] testFiles = new String[] {
5235
public void testBug125518d() {
5279
		"X.java",
5236
	String[] units = new String[] {
5280
		"public class X { \n" +
5237
		"pkg/X.java",
5238
		"package pkg;\n" +
5239
		"\n" +
5240
		"public class X {\n" +
5281
		"	/**\n" +
5241
		"	/**\n" +
5282
		"	 * {@value #MY_VALUE}\n" +
5242
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></aa>\n" +
5283
		"	 * {@value}\n" +
5284
		"	 * {@value Invalid}\n" +
5285
		"	 */\n" +
5243
		"	 */\n" +
5286
		"	public final static int MY_VALUE = 0; \n" +
5244
		"	public void foo() { \n" +
5245
		"	 \n" +
5246
		"	}\n" +
5287
		"}\n"
5247
		"}\n"
5288
	};
5248
	};
5289
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5249
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5290
		runNegativeTest(testFiles,
5250
	runConformTest(true, units,
5291
			"----------\n" +
5292
			"1. ERROR in X.java (at line 3)\n" +
5293
			"	* {@value #MY_VALUE}\n" +
5294
			"	    ^^^^^\n" +
5295
			"Javadoc: Unexpected tag\n" +
5296
			"----------\n" +
5297
			"2. ERROR in X.java (at line 4)\n" +
5298
			"	* {@value}\n" +
5299
			"	    ^^^^^\n" +
5300
			"Javadoc: Unexpected tag\n" +
5301
			"----------\n"
5302
		);
5303
	} else {
5304
		runNegativeTest(testFiles,
5305
			"----------\n" +
5251
			"----------\n" +
5306
			"1. ERROR in X.java (at line 5)\n" +
5252
			"1. WARNING in pkg\\X.java (at line 5)\n" +
5307
			"	* {@value Invalid}\n" +
5253
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></aa>\n" +
5308
			"	          ^^^^^^^^\n" +
5254
			"	                                                     ^^^^^\n" +
5309
			"Javadoc: Invalid reference\n" +
5255
			"Javadoc: Malformed link reference\n" +
5310
			"----------\n",
5256
			"----------\n",
5311
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5257
			null, null,
5312
		);
5258
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
5313
	}
5314
}
5259
}
5315
public void testBug153399e() {
5260
5316
	String[] testFiles = new String[] {
5261
public void testBug125518e() {
5317
		"X.java",
5262
	String[] units = new String[] {
5318
		"public class X { \n" +
5263
		"pkg/X.java",
5264
		"package pkg;\n" +
5265
		"\n" +
5266
		"public class X {\n" +
5319
		"	/**\n" +
5267
		"	/**\n" +
5320
		"	 * {@value Invalid}\n" +
5268
		"	 * @see <a href=\"http\u003A\u002F\u002Fwww.eclipse.org\"><valid>value</valid></a>\n" +
5321
		"	 * {@value #MY_VALUE}\n" +
5322
		"	 */\n" +
5269
		"	 */\n" +
5323
		"	public final static int MY_VALUE = 0; \n" +
5270
		"	public void foo() { \n" +
5271
		"	 \n" +
5272
		"	}\n" +
5324
		"}\n"
5273
		"}\n"
5325
	};
5274
		};
5326
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5275
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5327
		runNegativeTest(testFiles,
5276
	runConformTest(units);
5328
			"----------\n" +
5329
			"1. ERROR in X.java (at line 3)\n" +
5330
			"	* {@value Invalid}\n" +
5331
			"	    ^^^^^\n" +
5332
			"Javadoc: Unexpected tag\n" +
5333
			"----------\n"
5334
		);
5335
	} else {
5336
		runNegativeTest(testFiles,
5337
			"----------\n" +
5338
			"1. ERROR in X.java (at line 3)\n" +
5339
			"	* {@value Invalid}\n" +
5340
			"	          ^^^^^^^^\n" +
5341
			"Javadoc: Invalid reference\n" +
5342
			"----------\n",
5343
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5344
		);
5345
	}
5346
}
5277
}
5347
5278
5348
/**
5279
/**
5349
 * @bug 160015: [1.5][javadoc] Missing warning on autoboxing compatible methods
5280
 * Bug 125903: [javadoc] Treat whitespace in javadoc tags as invalid tags
5350
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=160015"
5281
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=125903"
5351
 */
5282
 */
5352
public void testBug160015() {
5283
public void testBug125903() {
5353
	runNegativeTest(new String[] {
5284
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
5354
			"Test.java",
5285
	runNegativeTest(
5286
		new String[] {
5287
			"X.java",
5355
			"/**\n" +
5288
			"/**\n" +
5356
			" * @see #method(Long) Warning!\n" +
5289
			" * {@ link java.lang.String}\n" +
5290
			" * @ since 2.1\n" +
5357
			" */\n" +
5291
			" */\n" +
5358
			"public class Test {\n" +
5292
			"public class X {\n" +
5359
			"	public void method(long l) {}\n" +
5360
			"	/**\n" +
5361
			"	 * @see #method(Long) Warning!\n" +
5362
			"	 */\n" +
5363
			"	void bar() {}\n" +
5364
			"}\n"
5293
			"}\n"
5365
		},
5294
		},
5366
		"----------\n" +
5295
		"----------\n" +
5367
		"1. ERROR in Test.java (at line 2)\n" +
5296
		"1. ERROR in X.java (at line 2)\n" +
5368
		"	* @see #method(Long) Warning!\n" +
5297
		"	* {@ link java.lang.String}\n" +
5369
		"	        ^^^^^^\n" +
5298
		"	   ^^\n" +
5370
		"Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
5299
		"Javadoc: Invalid tag\n" +
5371
		"----------\n" +
5300
		"----------\n" +
5372
		"2. ERROR in Test.java (at line 7)\n" +
5301
		"2. ERROR in X.java (at line 3)\n" +
5373
		"	* @see #method(Long) Warning!\n" +
5302
		"	* @ since 2.1\n" +
5374
		"	        ^^^^^^\n" +
5303
		"	  ^^\n" +
5375
		"Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
5304
		"Javadoc: Invalid tag\n" +
5376
		"----------\n",
5305
		"----------\n",
5377
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5306
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5378
	);
5307
	);
5379
}
5308
}
5380
5309
5381
/**
5310
/**
5382
 * @bug 163659: [javadoc] Compiler should warn when method parameters are not identical
5311
 * Bug 128954: Javadoc problems with category CAT_INTERNAL
5383
 * @test Ensure that a warning is raised when method parameter types are not identical
5312
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
5384
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=163659"
5385
 */
5313
 */
5386
public void testBug163659() {
5314
public void testBug128954() {
5315
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5316
	this.reportDeprecation = CompilerOptions.WARNING;
5387
	runNegativeTest(
5317
	runNegativeTest(
5388
		new String[] {
5318
		new String[] {
5389
			"Test.java",
5319
			"X.java", //========================
5390
			"/**\n" +
5320
			"public class X {\n" +
5391
			" * @see #foo(MyInterface)\n" +
5321
			"	/**\n" +
5392
			" * @see #foo(MySubInterface)\n" +
5322
			"	 * @see p.A#bar()\n" +
5393
			" */\n" +
5323
			"	 */\n" +
5394
			"public class Test {\n" +
5324
			"	void foo() {\n" +
5395
			"	public void foo(MyInterface mi) {\n" +
5325
			"		Zork z;\n" +
5396
			"	}\n" +
5326
			"	}\n" +
5397
			"}\n" +
5327
			"}\n",
5398
			"interface MyInterface {}\n" +
5328
			"p/A.java",  //========================
5399
			"interface MySubInterface extends MyInterface {} \n"
5329
			"package p;\n" +
5400
		},
5330
			"public class A {\n" +
5331
			"	/** @deprecated */\n" +
5332
			"	public void bar() {\n" +
5333
			"	}\n" +
5334
			"}\n"
5335
		},
5401
		"----------\n" +
5336
		"----------\n" +
5402
		"1. ERROR in Test.java (at line 3)\n" +
5337
		"1. WARNING in X.java (at line 3)\n" +
5403
		"	* @see #foo(MySubInterface)\n" +
5338
		"	* @see p.A#bar()\n" +
5404
		"	        ^^^\n" +
5339
		"	           ^^^^^\n" +
5405
		"Javadoc: The method foo(MyInterface) in the type Test is not applicable for the arguments (MySubInterface)\n" +
5340
		"[@cat:javadoc] Javadoc: The method bar() from the type A is deprecated\n" +
5341
		"----------\n" +
5342
		"2. ERROR in X.java (at line 6)\n" +
5343
		"	Zork z;\n" +
5344
		"	^^^^\n" +
5345
		"[@cat:type] Zork cannot be resolved to a type\n" +
5406
		"----------\n",
5346
		"----------\n",
5407
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5347
		null,
5408
	);
5348
		true,
5349
		null,
5350
		false,
5351
		true,
5352
		true);
5409
}
5353
}
5410
5354
5411
/**
5355
/**
5412
 * @bug 165794: [javadoc] Should not report ambiguous on method with parameterized types as parameters
5356
 * Bug 128954: Javadoc problems with category CAT_INTERNAL - variation
5413
 * @test Ensure that no warning are raised when ambiguous parameterized methods are present in javadoc comments
5357
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
5414
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165794"
5415
 */
5358
 */
5416
public void testBug165794() {
5359
public void testBug128954a() {
5417
	String[] testFiles = new String[] {
5360
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
5418
		"X.java",
5361
	this.reportDeprecation = CompilerOptions.WARNING;
5419
		"/**\n" +
5362
	runNegativeTest(
5420
		" * No reasonable hint for resolving the {@link #getMax(A)}.\n" +
5363
		new String[] {
5421
		" */\n" +
5364
			"X.java",
5422
		"public class X {\n" +
5365
			"public class X {\n" +
5423
		"    /**\n" +
5366
			"	\n" +
5424
		"     * Extends Number method.\n" +
5367
			"	/**\n" +
5425
		"     * @see #getMax(A ipZ)\n" +
5368
			"	 * @see p.A#bar()\n" +
5426
		"     */\n" +
5369
			"	 */\n" +
5427
		"    public <T extends Y> T getMax(final A<T> ipY) {\n" +
5370
			"	void foo() {\n" +
5428
		"        return ipY.t();\n" +
5371
			"		Zork z;\n" +
5429
		"    }\n" +
5372
			"	}\n" +
5430
		"    \n" +
5373
			"}\n",
5431
		"    /**\n" +
5374
		},
5432
		"     * Extends Exception method.\n" +
5375
		"----------\n" +
5433
		"     * @see #getMax(A ipY)\n" +
5376
		"1. WARNING in X.java (at line 4)\n" +
5434
		"     */\n" +
5377
		"	* @see p.A#bar()\n" +
5435
		"    public <T extends Z> T getMax(final A<T> ipZ) {\n" +
5378
		"	       ^^^\n" +
5436
		"        return ipZ.t();\n" +
5379
		"[@cat:javadoc] Javadoc: p cannot be resolved to a type\n" +
5437
		"    }\n" +
5380
		"----------\n" +
5438
		"}\n" +
5381
		"2. ERROR in X.java (at line 7)\n" +
5439
		"class A<T> {\n" +
5382
		"	Zork z;\n" +
5440
		"	T t() { return null; }\n" +
5383
		"	^^^^\n" +
5441
		"}\n" +
5384
		"[@cat:type] Zork cannot be resolved to a type\n" +
5442
		"class Y {}\n" +
5385
		"----------\n",
5443
		"class Z {}"
5386
		null,
5444
	};
5387
		true,
5445
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5388
		null,
5446
		return;
5389
		false,
5447
	}
5390
		true,
5448
	runConformTest(testFiles);
5391
		true);
5449
}
5392
}
5450
5393
5451
/**
5394
/**
5452
 * @bug 166365: [javadoc] severity level of malformed javadoc comments did not work properly
5395
 * Bug 129241: [Javadoc] deprecation warning wrongly reported when ignoring Malformed Javadoc comments
5453
 * @test Ensure that no warning is raised when visibility is lower than the javadoc option one
5396
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=129241"
5454
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166365"
5455
 */
5397
 */
5456
public void testBug166365() {
5398
public void testBug129241a() {
5457
	String[] testFiles = new String[] {
5399
	runNegativeTest(
5458
		"X.java",
5400
		new String[] {
5459
		"public class X {\n" +
5401
			"X.java",
5460
		"    /**\n" +
5402
			"public class X {\n" +
5461
		"     * @return\n" +
5403
			"	/**\n" +
5462
		"     */\n" +
5404
			"	 * @see p.A#bar\n" +
5463
		"    private String getSomePrivate() {\n" +
5405
			"	 */\n" +
5464
		"        return \"SomePrivate\";\n" +
5406
			"	void foo() {}\n" +
5465
		"    }\n" +
5407
			"}\n",
5466
		"    /**\n" +
5408
			"p/A.java",
5467
		"     * @return\n" +
5409
			"package p;\n" +
5468
		"     */\n" +
5410
			"/** @deprecated */\n" +
5469
		"    protected String getSomeProtected() {\n" +
5411
			"public class A {\n" +
5470
		"        return \"SomeProtected\";\n" +
5412
			"	void bar() {}\n" +
5471
		"    }\n" +
5413
			"}\n"
5472
		"    /**\n" +
5414
		},
5473
		"     * @return\n" +
5474
		"     */\n" +
5475
		"    String getSomeDefault() {\n" +
5476
		"        return \"SomeDefault\";\n" +
5477
		"    }\n" +
5478
		"    /**\n" +
5479
		"     * @return\n" +
5480
		"     */\n" +
5481
		"    public String getSomePublic() {\n" +
5482
		"        return \"SomePublic\";\n" +
5483
		"    }\n" +
5484
		"}\n"
5485
	};
5486
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5487
	runNegativeTest(testFiles,
5488
		"----------\n" +
5415
		"----------\n" +
5489
		"1. ERROR in X.java (at line 21)\n" +
5416
		"1. ERROR in X.java (at line 3)\n" +
5490
		"	* @return\n" +
5417
		"	* @see p.A#bar\n" +
5491
		"	   ^^^^^^\n" +
5418
		"	       ^^^\n" +
5492
		"Javadoc: Description expected after @return\n" +
5419
		"Javadoc: The type A is deprecated\n" +
5420
		"----------\n",
5421
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5422
	);
5423
}
5424
public void testBug129241b() {
5425
	this.reportDeprecation = CompilerOptions.IGNORE;
5426
	runNegativeTest(
5427
		new String[] {
5428
			"X.java",
5429
			"public class X {\n" +
5430
			"	/**\n" +
5431
			"	 * @see p.A#bar\n" +
5432
			"	 */\n" +
5433
			"	void foo() {}\n" +
5434
			"}\n",
5435
			"p/A.java",
5436
			"package p;\n" +
5437
			"/** @deprecated */\n" +
5438
			"public class A {\n" +
5439
			"	void bar() {}\n" +
5440
			"}\n"
5441
		},
5442
		"----------\n" +
5443
		"1. ERROR in X.java (at line 3)\n" +
5444
		"	* @see p.A#bar\n" +
5445
		"	       ^^^\n" +
5446
		"Javadoc: The type A is deprecated\n" +
5493
		"----------\n",
5447
		"----------\n",
5494
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5448
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5495
	);
5449
	);
5496
}
5450
}
5451
public void testBug129241c() {
5452
	this.reportJavadocDeprecation = CompilerOptions.DISABLED;
5453
	runConformTest(
5454
		new String[] {
5455
			"X.java",
5456
			"public class X {\n" +
5457
			"	/**\n" +
5458
			"	 * @see p.A#bar\n" +
5459
			"	 */\n" +
5460
			"	void foo() {}\n" +
5461
			"}\n",
5462
			"p/A.java",
5463
			"package p;\n" +
5464
			"/** @deprecated */\n" +
5465
			"public class A {\n" +
5466
			"	void bar() {}\n" +
5467
			"}\n"
5468
		}
5469
	);
5470
}
5471
public void testBug129241d() {
5472
	this.reportInvalidJavadoc = CompilerOptions.IGNORE;
5473
	runConformTest(
5474
		new String[] {
5475
			"X.java",
5476
			"public class X {\n" +
5477
			"	/**\n" +
5478
			"	 * @see p.A#bar\n" +
5479
			"	 */\n" +
5480
			"	void foo() {}\n" +
5481
			"}\n",
5482
			"p/A.java",
5483
			"package p;\n" +
5484
			"/** @deprecated */\n" +
5485
			"public class A {\n" +
5486
			"	void bar() {}\n" +
5487
			"}\n"
5488
		}
5489
	);
5490
}
5497
5491
5498
/**
5492
/**
5499
 * @bug 166436: [javadoc] Potentially wrong javadoc warning for unexpected duplicate tag value
5493
 * Bug 132813: NPE in Javadoc.resolve(Javadoc.java:196) + log swamped
5500
 * @test Ensure that no duplicate warning is raised for value tag
5494
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=132813"
5501
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166436"
5502
 */
5495
 */
5503
public void testBug166436() {
5496
public void testBug132813() {
5504
	String[] testFiles = new String[] {
5497
	runNegativeTest(
5505
		"X.java",
5498
		new String[] {
5506
		"public class X {\n" +
5499
			"Test.java",
5507
		"	public static final String PUBLIC_CONST = \"public\";\n" +
5500
			"public class X { \n" +
5508
		"	protected static final String PROTECTED_CONST = \"protected\";\n" +
5501
			"	/**	 */ \n" +
5509
		"	static final String DEFAULT_CONST = \"default\"; \n" +
5502
			"	public Test() {}\n" +
5510
		"	private static final String PRIVATE_CONST = \"private\"; \n" +
5503
			"	/**	 */\n" +
5511
		"	/**\n" +
5504
			"	public test() {}\n" +
5512
		"	 * Values:\n" +
5505
			"}\n"			},
5513
		"	 * <ul>\n" +
5506
		"----------\n" +
5514
		"	 * 	<li>{@value #PUBLIC_CONST}</li>\n" +
5507
		"1. ERROR in Test.java (at line 1)\n" +
5515
		"	 * 	<li>{@value #PROTECTED_CONST}</li>\n" +
5508
		"	public class X { \n" +
5516
		"	 * 	<li>{@value #DEFAULT_CONST}</li>\n" +
5509
		"	             ^\n" +
5517
		"	 * 	<li>{@value #PRIVATE_CONST}</li>\n" +
5510
		"The public type X must be defined in its own file\n" +
5518
		"	 * </ul>\n" +
5511
		"----------\n" +
5519
		"	 */\n" +
5512
		"2. ERROR in Test.java (at line 3)\n" +
5520
		"	public X() {\n" +
5513
		"	public Test() {}\n" +
5521
		"	}\n" +
5514
		"	       ^^^^^^\n" +
5522
		"}\n"
5515
		"Return type for the method is missing\n" +
5523
	};
5516
		"----------\n" +
5524
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5517
		"3. ERROR in Test.java (at line 5)\n" +
5525
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5518
		"	public test() {}\n" +
5526
		runNegativeTest(testFiles,
5519
		"	       ^^^^^^\n" +
5527
			"----------\n" +
5520
		"Return type for the method is missing\n" +
5528
			"1. ERROR in X.java (at line 9)\n" +
5521
		"----------\n"
5529
			"	* 	<li>{@value #PUBLIC_CONST}</li>\n" +
5522
	);
5530
			"	  	      ^^^^^\n" +
5531
			"Javadoc: Unexpected tag\n" +
5532
			"----------\n" +
5533
			"2. ERROR in X.java (at line 10)\n" +
5534
			"	* 	<li>{@value #PROTECTED_CONST}</li>\n" +
5535
			"	  	      ^^^^^\n" +
5536
			"Javadoc: Unexpected tag\n" +
5537
			"----------\n" +
5538
			"3. ERROR in X.java (at line 11)\n" +
5539
			"	* 	<li>{@value #DEFAULT_CONST}</li>\n" +
5540
			"	  	      ^^^^^\n" +
5541
			"Javadoc: Unexpected tag\n" +
5542
			"----------\n" +
5543
			"4. ERROR in X.java (at line 12)\n" +
5544
			"	* 	<li>{@value #PRIVATE_CONST}</li>\n" +
5545
			"	  	      ^^^^^\n" +
5546
			"Javadoc: Unexpected tag\n" +
5547
			"----------\n"
5548
		);
5549
	} else {
5550
		runNegativeTest(testFiles,
5551
			"----------\n" +
5552
			"1. ERROR in X.java (at line 10)\n" +
5553
			"	* 	<li>{@value #PROTECTED_CONST}</li>\n" +
5554
			"	  	            ^^^^^^^^^^^^^^^^\n" +
5555
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'protected\' reference\n" +
5556
			"----------\n" +
5557
			"2. ERROR in X.java (at line 11)\n" +
5558
			"	* 	<li>{@value #DEFAULT_CONST}</li>\n" +
5559
			"	  	            ^^^^^^^^^^^^^^\n" +
5560
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
5561
			"----------\n" +
5562
			"3. ERROR in X.java (at line 12)\n" +
5563
			"	* 	<li>{@value #PRIVATE_CONST}</li>\n" +
5564
			"	  	            ^^^^^^^^^^^^^^\n" +
5565
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'private\' reference\n" +
5566
			"----------\n",
5567
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5568
		);
5569
	}
5570
}
5523
}
5571
5524
5572
/**
5525
/**
5573
 * Bug 176027: [javadoc] @link to member type handled incorrectly
5526
 * Bug 149013: [javadoc] In latest 3.3 build, there is a javadoc error in org.eclipse.core.resources
5574
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=176027"
5527
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=149013"
5575
 */
5528
 */
5576
public void testBug176027a() {
5529
public void testBug149013_Private01() {
5577
	// case1 class X static class Inner
5530
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
5578
	String[] units = new String[] {
5531
	runConformTest(
5579
		"otherpkg/C.java",
5532
		new String[] {
5580
		"package otherpkg;\n" +
5533
			"test1/X.java",
5581
		"public class C {\n" +
5534
			"package test1;\n" +
5582
		"        public static class Inner { }\n" +
5535
			"public class X {\n" +
5583
		"}\n"
5536
			"	class Inner {\n" +
5584
		,
5537
			"		class Level2 {\n" +
5585
		"somepkg/MemberTypeDocTest.java",
5538
			"			class Level3 {}\n" +
5586
		"package somepkg;\n" +
5539
			"		}\n" +
5587
		"import otherpkg.C.Inner;\n" +
5540
			"	}\n" +
5588
		"/**\n" +
5541
			"}\n",
5589
		" * {@link Inner} -- error/warning \n" +
5542
			"test1/Test.java",
5590
		" */\n" +
5543
			"package test1;\n" +
5591
		"public class MemberTypeDocTest {\n" +
5544
			"/**\n" +
5592
		"      void m() { }\n" +
5545
			" * @see X.Inner\n" +
5593
		"}\n"
5546
			" * @see X.Inner.Level2\n" +
5594
	};
5547
			" * @see X.Inner.Level2.Level3\n" +
5595
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5548
			" */\n" +
5596
		runNegativeTest(units,
5549
			"public class Test {}\n",
5597
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5550
		}
5598
			"----------\n" +
5551
	);
5599
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5600
			"	* {@link Inner} -- error/warning \n" +
5601
			"	         ^^^^^\n" +
5602
			"Javadoc: Invalid member type qualification\n" +
5603
			"----------\n"
5604
		);
5605
	}
5606
	else {
5607
		runConformTest(units);
5608
	}
5609
}
5610
5611
public void testBug176027b() {
5612
	// case3 class X class Inner
5613
	String[] units = new String[] {
5614
		"otherpkg/C.java",
5615
		"package otherpkg;\n" +
5616
		"public class C {\n" +
5617
		"        public class Inner { }\n" +
5618
		"}\n"
5619
		,
5620
		"somepkg/MemberTypeDocTest.java",
5621
		"package somepkg;\n" +
5622
		"import otherpkg.C.Inner;\n" +
5623
		"/**\n" +
5624
		" * {@link Inner} -- error/warning \n" +
5625
		" */\n" +
5626
		"public class MemberTypeDocTest {\n" +
5627
		"      void m() { }\n" +
5628
		"}\n"
5629
	};
5630
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5631
		runNegativeTest(units,
5632
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5633
			"----------\n" +
5634
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5635
			"	* {@link Inner} -- error/warning \n" +
5636
			"	         ^^^^^\n" +
5637
			"Javadoc: Invalid member type qualification\n" +
5638
			"----------\n"
5639
		);
5640
	}
5641
	else {
5642
		runConformTest(units);
5643
	}
5644
}
5552
}
5645
5553
public void testBug149013_Public01() {
5646
public void testBug176027c() {
5554
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
5647
	// case3 class X interface Inner
5555
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5648
	String[] units = new String[] {
5556
	runNegativeTest(
5649
		"otherpkg/C.java",
5557
		new String[] {
5650
		"package otherpkg;\n" +
5558
			"test1/X.java",
5651
		"public class C {\n" +
5559
			"package test1;\n" +
5652
		"        public interface Inner { }\n" +
5560
			"public class X {\n" +
5653
		"}\n"
5561
			"	class Inner {\n" +
5654
		,
5562
			"		class Level2 {\n" +
5655
		"somepkg/MemberTypeDocTest.java",
5563
			"			class Level3 {}\n" +
5656
		"package somepkg;\n" +
5564
			"		}\n" +
5657
		"import otherpkg.C.Inner;\n" +
5565
			"	}\n" +
5658
		"/**\n" +
5566
			"}\n",
5659
		" * {@link Inner} -- error/warning \n" +
5567
			"test1/Test.java",
5660
		" */\n" +
5568
			"package test1;\n" +
5661
		"public class MemberTypeDocTest {\n" +
5569
			"/**\n" +
5662
		"      void m() { }\n" +
5570
			" * @see X.Inner\n" +
5663
		"}\n"
5571
			" * @see X.Inner.Level2\n" +
5664
	};
5572
			" * @see X.Inner.Level2.Level3\n" +
5665
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5573
			" */\n" +
5666
		runNegativeTest(units,
5574
			"public class Test {\n" +
5667
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5575
			"}\n"
5668
			"----------\n" +
5576
		},
5669
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5577
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner
5670
			"	* {@link Inner} -- error/warning \n" +
5578
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2
5671
			"	         ^^^^^\n" +
5579
		//test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2.Level3
5672
			"Javadoc: Invalid member type qualification\n" +
5580
		"----------\n" +
5673
			"----------\n"
5581
		"1. ERROR in test1\\Test.java (at line 3)\n" +
5674
		);
5582
		"	* @see X.Inner\n" +
5675
	}
5583
		"	       ^^^^^^^\n" +
5676
	else {
5584
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
5677
		runConformTest(units);
5585
		"----------\n" +
5678
	}
5586
		"2. ERROR in test1\\Test.java (at line 4)\n" +
5587
		"	* @see X.Inner.Level2\n" +
5588
		"	       ^^^^^^^^^^^^^^\n" +
5589
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
5590
		"----------\n" +
5591
		"3. ERROR in test1\\Test.java (at line 5)\n" +
5592
		"	* @see X.Inner.Level2.Level3\n" +
5593
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5594
		"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
5595
		"----------\n",
5596
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5597
	);
5679
}
5598
}
5680
5599
public void testBug149013_Private02() {
5681
public void testBug176027d() {
5600
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
5682
	// case4 interface X static class Inner
5601
	runNegativeTest(
5683
	String[] units = new String[] {
5602
		new String[] {
5684
		"otherpkg/C.java",
5603
			"test1/X.java",
5685
		"package otherpkg;\n" +
5604
			"package test1;\n" +
5686
		"public interface C {\n" +
5605
			"public class X {\n" +
5687
		"        public static class Inner { }\n" +
5606
			"	class Inner {\n" +
5688
		"}\n"
5607
			"		class Level2 {\n" +
5689
		,
5608
			"			class Level3 {}\n" +
5690
		"somepkg/MemberTypeDocTest.java",
5609
			"		}\n" +
5691
		"package somepkg;\n" +
5610
			"	}\n" +
5692
		"import otherpkg.C.Inner;\n" +
5611
			"}\n",
5693
		"/**\n" +
5612
			"test2/Test.java",
5694
		" * {@link Inner} -- error/warning \n" +
5613
			"package test2;\n" +
5695
		" */\n" +
5614
			"import test1.X;\n" +
5696
		"public class MemberTypeDocTest {\n" +
5615
			"/**\n" +
5697
		"      void m() { }\n" +
5616
			" * @see X.Inner\n" +
5698
		"}\n"
5617
			" * @see X.Inner.Level2\n" +
5699
	};
5618
			" * @see X.Inner.Level2.Level3\n" +
5700
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5619
			" */\n" +
5701
		runNegativeTest(units,
5620
			"public class Test {}\n",
5702
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5621
		},
5703
			"----------\n" +
5622
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
5704
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5623
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
5705
			"	* {@link Inner} -- error/warning \n" +
5624
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
5706
			"	         ^^^^^\n" +
5625
		"----------\n" +
5707
			"Javadoc: Invalid member type qualification\n" +
5626
		"1. ERROR in test2\\Test.java (at line 4)\r\n" +
5708
			"----------\n"
5627
		"	* @see X.Inner\r\n" +
5709
		);
5628
		"	       ^^^^^^^\n" +
5710
	}
5629
		"Javadoc: The type X.Inner is not visible\n" +
5711
	else {
5630
		"----------\n" +
5712
		runConformTest(units);
5631
		"2. ERROR in test2\\Test.java (at line 5)\r\n" +
5713
	}
5632
		"	* @see X.Inner.Level2\r\n" +
5633
		"	       ^^^^^^^^^^^^^^\n" +
5634
		"Javadoc: The type X.Inner is not visible\n" +
5635
		"----------\n" +
5636
		"3. ERROR in test2\\Test.java (at line 6)\r\n" +
5637
		"	* @see X.Inner.Level2.Level3\r\n" +
5638
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5639
		"Javadoc: The type X.Inner is not visible\n" +
5640
		"----------\n",
5641
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5642
	);
5643
}
5644
public void testBug149013_Public02() {
5645
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
5646
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5647
	runNegativeTest(
5648
		new String[] {
5649
			"test1/X.java",
5650
			"package test1;\n" +
5651
			"public class X {\n" +
5652
			"	class Inner {\n" +
5653
			"		class Level2 {\n" +
5654
			"			class Level3 {}\n" +
5655
			"		}\n" +
5656
			"	}\n" +
5657
			"}\n",
5658
			"test2/Test.java",
5659
			"package test2;\n" +
5660
			"import test1.X;\n" +
5661
			"/**\n" +
5662
			" * @see X.Inner\n" +
5663
			" * @see X.Inner.Level2\n" +
5664
			" * @see X.Inner.Level2.Level3\n" +
5665
			" */\n" +
5666
			"public class Test {}\n",
5667
		},
5668
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
5669
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
5670
		//test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
5671
		"----------\n" +
5672
		"1. ERROR in test2\\Test.java (at line 4)\r\n" +
5673
		"	* @see X.Inner\r\n" +
5674
		"	       ^^^^^^^\n" +
5675
		"Javadoc: The type X.Inner is not visible\n" +
5676
		"----------\n" +
5677
		"2. ERROR in test2\\Test.java (at line 5)\r\n" +
5678
		"	* @see X.Inner.Level2\r\n" +
5679
		"	       ^^^^^^^^^^^^^^\n" +
5680
		"Javadoc: The type X.Inner is not visible\n" +
5681
		"----------\n" +
5682
		"3. ERROR in test2\\Test.java (at line 6)\r\n" +
5683
		"	* @see X.Inner.Level2.Level3\r\n" +
5684
		"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
5685
		"Javadoc: The type X.Inner is not visible\n" +
5686
		"----------\n",
5687
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5688
	);
5689
}
5690
public void testBug149013_Private03() {
5691
	this.reportMissingJavadocTags = CompilerOptions.IGNORE;
5692
	runNegativeTest(
5693
		new String[] {
5694
			"test1/X.java",
5695
			"package test1;\n" +
5696
			"public class X {\n" +
5697
			"	class Inner {\n" +
5698
			"		class Level2 {\n" +
5699
			"			class Level3 {}\n" +
5700
			"		}\n" +
5701
			"	}\n" +
5702
			"}\n",
5703
			"test3/Test.java",
5704
			"package test3;\n" +
5705
			"/**\n" +
5706
			" * @see test1.X.Inner\n" +
5707
			" * @see test1.X.Inner.Level2\n" +
5708
			" * @see test1.X.Inner.Level2.Level3\n" +
5709
			" */\n" +
5710
			"public class Test {}\n"
5711
		},
5712
		// no warning
5713
		"----------\n" +
5714
		"1. ERROR in test3\\Test.java (at line 3)\r\n" +
5715
		"	* @see test1.X.Inner\r\n" +
5716
		"	       ^^^^^^^^^^^^^\n" +
5717
		"Javadoc: The type test1.X.Inner is not visible\n" +
5718
		"----------\n" +
5719
		"2. ERROR in test3\\Test.java (at line 4)\r\n" +
5720
		"	* @see test1.X.Inner.Level2\r\n" +
5721
		"	       ^^^^^^^^^^^^^^^^^^^^\n" +
5722
		"Javadoc: The type test1.X.Inner is not visible\n" +
5723
		"----------\n" +
5724
		"3. ERROR in test3\\Test.java (at line 5)\r\n" +
5725
		"	* @see test1.X.Inner.Level2.Level3\r\n" +
5726
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5727
		"Javadoc: The type test1.X.Inner is not visible\n" +
5728
		"----------\n",
5729
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5730
	);
5731
}
5732
public void testBug149013_Public03() {
5733
	this.reportMissingJavadocTags = CompilerOptions.DISABLED;
5734
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5735
	runNegativeTest(
5736
		new String[] {
5737
			"test1/X.java",
5738
			"package test1;\n" +
5739
			"public class X {\n" +
5740
			"	class Inner {\n" +
5741
			"		class Level2 {\n" +
5742
			"			class Level3 {}\n" +
5743
			"		}\n" +
5744
			"	}\n" +
5745
			"}\n",
5746
			"test3/Test.java",
5747
			"package test3;\n" +
5748
			"/**\n" +
5749
			" * @see test1.X.Inner\n" +
5750
			" * @see test1.X.Inner.Level2\n" +
5751
			" * @see test1.X.Inner.Level2.Level3\n" +
5752
			" */\n" +
5753
			"public class Test {}\n"
5754
		},
5755
		// no warning
5756
		"----------\n" +
5757
		"1. ERROR in test3\\Test.java (at line 3)\r\n" +
5758
		"	* @see test1.X.Inner\r\n" +
5759
		"	       ^^^^^^^^^^^^^\n" +
5760
		"Javadoc: The type test1.X.Inner is not visible\n" +
5761
		"----------\n" +
5762
		"2. ERROR in test3\\Test.java (at line 4)\r\n" +
5763
		"	* @see test1.X.Inner.Level2\r\n" +
5764
		"	       ^^^^^^^^^^^^^^^^^^^^\n" +
5765
		"Javadoc: The type test1.X.Inner is not visible\n" +
5766
		"----------\n" +
5767
		"3. ERROR in test3\\Test.java (at line 5)\r\n" +
5768
		"	* @see test1.X.Inner.Level2.Level3\r\n" +
5769
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5770
		"Javadoc: The type test1.X.Inner is not visible\n" +
5771
		"----------\n",
5772
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5773
	);
5714
}
5774
}
5715
5775
5716
public void testBug176027f() {
5776
/**
5717
	// case5 interface X class Inner
5777
 * @bug 153399: [javadoc] JDT Core should warn if the @value tag is not used correctly
5718
	String[] units = new String[] {
5778
 * @test Ensure that 'value' tag is well warned when not used correctly
5719
		"otherpkg/C.java",
5779
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=153399"
5720
		"package otherpkg;\n" +
5780
 */
5721
		"public interface C {\n" +
5781
public void testBug153399a() {
5722
		"        public class Inner { }\n" +
5782
	String[] testFiles = new String[] {
5723
		"}\n"
5783
		"X.java",
5724
		,
5784
		"public class X { \n" +
5725
		"somepkg/MemberTypeDocTest.java",
5785
		"	/**\n" +
5726
		"package somepkg;\n" +
5786
		"	 * {@value #MY_VALUE}\n" +
5727
		"import otherpkg.C.Inner;\n" +
5787
		"	 */\n" +
5728
		"/**\n" +
5788
		"	public final static int MY_VALUE = 0; \n" +
5729
		" * {@link Inner} -- error/warning \n" +
5789
		"	/**\n" +
5730
		" */\n" +
5790
		"	 * {@value #MY_VALUE}\n" +
5731
		"public class MemberTypeDocTest {\n" +
5791
		"	 */\n" +
5732
		"      void m() { }\n" +
5792
		"	public void foo() {}\n" +
5793
		"	/**\n" +
5794
		"	 * {@value #MY_VALUE}\n" +
5795
		"	 */\n" +
5796
		"	class Sub {} \n" +
5733
		"}\n"
5797
		"}\n"
5734
	};
5798
	};
5735
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5799
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5736
		runNegativeTest(units,
5800
		runNegativeTest(testFiles,
5737
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5738
			"----------\n" +
5801
			"----------\n" +
5739
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5802
			"1. ERROR in X.java (at line 7)\n" +
5740
			"	* {@link Inner} -- error/warning \n" +
5803
			"	* {@value #MY_VALUE}\n" +
5741
			"	         ^^^^^\n" +
5804
			"	    ^^^^^\n" +
5742
			"Javadoc: Invalid member type qualification\n" +
5805
			"Javadoc: Unexpected tag\n" +
5806
			"----------\n" +
5807
			"2. ERROR in X.java (at line 11)\n" +
5808
			"	* {@value #MY_VALUE}\n" +
5809
			"	    ^^^^^\n" +
5810
			"Javadoc: Unexpected tag\n" +
5743
			"----------\n"
5811
			"----------\n"
5744
		);
5812
		);
5813
	} else {
5814
		runConformTest(testFiles);
5745
	}
5815
	}
5746
	else {
5816
}
5747
		runConformTest(units);
5817
public void testBug153399b() {
5818
	String[] testFiles = new String[] {
5819
		"X.java",
5820
		"public class X { \n" +
5821
		"	/**\n" +
5822
		"	 * {@value}\n" +
5823
		"	 */\n" +
5824
		"	public final static int MY_VALUE = 0; \n" +
5825
		"	/**\n" +
5826
		"	 * {@value}\n" +
5827
		"	 */\n" +
5828
		"	public void foo() {}\n" +
5829
		"	/**\n" +
5830
		"	 * {@value}\n" +
5831
		"	 */\n" +
5832
		"	class Sub {} \n" +
5833
		"}\n"
5834
	};
5835
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5836
		runNegativeTest(testFiles,
5837
			"----------\n" +
5838
			"1. ERROR in X.java (at line 7)\n" +
5839
			"	* {@value}\n" +
5840
			"	    ^^^^^\n" +
5841
			"Javadoc: Unexpected tag\n" +
5842
			"----------\n" +
5843
			"2. ERROR in X.java (at line 11)\n" +
5844
			"	* {@value}\n" +
5845
			"	    ^^^^^\n" +
5846
			"Javadoc: Unexpected tag\n" +
5847
			"----------\n"
5848
		);
5849
	} else {
5850
		runConformTest(testFiles);
5748
	}
5851
	}
5749
}
5852
}
5750
5853
public void testBug153399c() {
5751
public void testBug176027g() {
5854
	String[] testFiles = new String[] {
5752
	// case6 interface X interface Inner
5855
		"p1/X.java",
5753
	String[] units = new String[] {
5856
		"package p1;\n" +
5754
		"otherpkg/C.java",
5857
		"public class X {\n" +
5755
		"package otherpkg;\n" +
5858
		"	/**\n" +
5756
		"public interface C {\n" +
5859
		"	 * @return a\n" +
5757
		"        public interface Inner { }\n" +
5860
		"	 */\n" +
5861
		"	boolean get() {\n" +
5862
		"		return false;\n" +
5863
		"	}\n" +
5758
		"}\n"
5864
		"}\n"
5759
		,
5865
	};
5760
		"somepkg/MemberTypeDocTest.java",
5866
	runConformTest(testFiles);
5761
		"package somepkg;\n" +
5867
}
5762
		"import otherpkg.C.Inner;\n" +
5868
public void testBug153399d() {
5763
		"/**\n" +
5869
	String[] testFiles = new String[] {
5764
		" * {@link Inner} -- error/warning \n" +
5870
		"X.java",
5765
		" */\n" +
5871
		"public class X { \n" +
5766
		"public class MemberTypeDocTest {\n" +
5872
		"	/**\n" +
5767
		"      void m() { }\n" +
5873
		"	 * {@value #MY_VALUE}\n" +
5874
		"	 * {@value}\n" +
5875
		"	 * {@value Invalid}\n" +
5876
		"	 */\n" +
5877
		"	public final static int MY_VALUE = 0; \n" +
5768
		"}\n"
5878
		"}\n"
5769
	};
5879
	};
5770
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5880
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5771
		runNegativeTest(units,
5881
		runNegativeTest(testFiles,
5772
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
5773
			"----------\n" +
5882
			"----------\n" +
5774
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
5883
			"1. ERROR in X.java (at line 3)\n" +
5775
			"	* {@link Inner} -- error/warning \n" +
5884
			"	* {@value #MY_VALUE}\n" +
5776
			"	         ^^^^^\n" +
5885
			"	    ^^^^^\n" +
5777
			"Javadoc: Invalid member type qualification\n" +
5886
			"Javadoc: Unexpected tag\n" +
5887
			"----------\n" +
5888
			"2. ERROR in X.java (at line 4)\n" +
5889
			"	* {@value}\n" +
5890
			"	    ^^^^^\n" +
5891
			"Javadoc: Unexpected tag\n" +
5778
			"----------\n"
5892
			"----------\n"
5779
		);
5893
		);
5780
	}
5894
	} else {
5781
	else {
5895
		runNegativeTest(testFiles,
5782
		runConformTest(units);
5896
			"----------\n" +
5897
			"1. ERROR in X.java (at line 5)\n" +
5898
			"	* {@value Invalid}\n" +
5899
			"	          ^^^^^^^^\n" +
5900
			"Javadoc: Invalid reference\n" +
5901
			"----------\n",
5902
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5903
		);
5783
	}
5904
	}
5784
}
5905
}
5785
5906
public void testBug153399e() {
5786
public void testBug176027h_public() {
5907
	String[] testFiles = new String[] {
5787
	// test embedded inner classes
5908
		"X.java",
5788
	String[] units = new String[] {
5909
		"public class X { \n" +
5789
			"mainpkg/Outer.java",
5910
		"	/**\n" +
5790
			"package mainpkg;\n" +
5911
		"	 * {@value Invalid}\n" +
5791
			"public class Outer {\n" +
5912
		"	 * {@value #MY_VALUE}\n" +
5792
			"        public class Inner {\n" +
5913
		"	 */\n" +
5793
			"        	public class MostInner{\n" +
5914
		"	public final static int MY_VALUE = 0; \n" +
5794
			"    \n" +
5915
		"}\n"
5795
			"        	}\n" +
5796
			"        } \n" +
5797
			"}\n"
5798
			,
5799
			"pkg1/Valid1.java",
5800
			"package pkg1; \n" +
5801
			"import mainpkg.Outer.Inner.MostInner;\n" +
5802
			"// valid import - no error in 5.0\n" +
5803
			"\n" +
5804
			"/** \n" +
5805
			" * {@link MostInner}\n" +
5806
			" * \n" +
5807
			" */ \n" +
5808
			"public class Valid1 { \n" +
5809
			"	/** \n" +
5810
			"	 * {@link MostInner} \n" +
5811
			"	 * \n" +
5812
			"	 */ \n" +
5813
			"      void m() { } \n" +
5814
			"}\n"
5815
			,
5816
			"pkg2/Valid2.java",
5817
			"package pkg2; \n" +
5818
			"import mainpkg.Outer.Inner.*;\n" +
5819
			"//valid import - no error in 5.0\n" +
5820
			"\n" +
5821
			"/** \n" +
5822
			" * {@link MostInner}\n" +
5823
			" * \n" +
5824
			" */ \n" +
5825
			"public class Valid2 { \n" +
5826
			"      void m() { } \n" +
5827
			"}\n"
5828
			,
5829
			"pkg3/Invalid3.java",
5830
			"package pkg3; \n" +
5831
			"import mainpkg.Outer.*;\n" +
5832
			"//invalid import: expecting warning / error\n" +
5833
			"\n" +
5834
			"/** \n" +
5835
			" * {@link MostInner} -- error/warning  \n" +
5836
			" * \n" +
5837
			" */ \n" +
5838
			"public class Invalid3 { \n" +
5839
			"      void m() { } \n" +
5840
			"}\n"
5841
	};
5916
	};
5842
5843
	String error14 = new String (
5844
		//pkg1\Valid1.java:12: warning - Tag @link: reference not found: MostInner
5845
		//pkg2\Valid2.java:12: warning - Tag @link: reference not found: MostInner
5846
		//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
5847
		"----------\n" +
5848
		"1. ERROR in pkg1\\Valid1.java (at line 6)\n" +
5849
		"	* {@link MostInner}\n" +
5850
		"	         ^^^^^^^^^\n" +
5851
		"Javadoc: Invalid member type qualification\n" +
5852
		"----------\n" +
5853
		"----------\n" +
5854
		"1. ERROR in pkg2\\Valid2.java (at line 6)\n" +
5855
		"	* {@link MostInner}\n" +
5856
		"	         ^^^^^^^^^\n" +
5857
		"Javadoc: Invalid member type qualification\n" +
5858
		"----------\n" +
5859
		"----------\n" +
5860
		"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
5861
		"	* {@link MostInner} -- error/warning  \n" +
5862
		"	         ^^^^^^^^^\n" +
5863
		"Javadoc: MostInner cannot be resolved to a type\n" +
5864
		"----------\n");
5865
5866
	String error50 = new String (
5867
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
5868
			"----------\n" +
5869
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
5870
			"	* {@link MostInner} -- error/warning  \n" +
5871
			"	         ^^^^^^^^^\n" +
5872
			"Javadoc: MostInner cannot be resolved to a type\n" +
5873
			"----------\n");
5874
5875
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
5876
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5917
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5877
		runNegativeTest(units,error14);
5918
		runNegativeTest(testFiles,
5878
	}
5919
			"----------\n" +
5879
	else {
5920
			"1. ERROR in X.java (at line 3)\n" +
5880
		runNegativeTest(units,error50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
5921
			"	* {@value Invalid}\n" +
5922
			"	    ^^^^^\n" +
5923
			"Javadoc: Unexpected tag\n" +
5924
			"----------\n"
5925
		);
5926
	} else {
5927
		runNegativeTest(testFiles,
5928
			"----------\n" +
5929
			"1. ERROR in X.java (at line 3)\n" +
5930
			"	* {@value Invalid}\n" +
5931
			"	          ^^^^^^^^\n" +
5932
			"Javadoc: Invalid reference\n" +
5933
			"----------\n",
5934
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5935
		);
5881
	}
5936
	}
5882
}
5937
}
5883
5938
5884
public void testBug176027h_private() {
5939
/**
5885
	// test embedded inner classes
5940
 * @bug 160015: [1.5][javadoc] Missing warning on autoboxing compatible methods
5886
	String[] units = new String[] {
5941
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=160015"
5887
			"mainpkg/Outer.java",
5942
 */
5888
			"package mainpkg;\n" +
5943
public void testBug160015() {
5889
			"public class Outer {\n" +
5944
	runNegativeTest(new String[] {
5890
			"        public class Inner {\n" +
5945
			"Test.java",
5891
			"        	public class MostInner{\n" +
5946
			"/**\n" +
5892
			"    \n" +
5947
			" * @see #method(Long) Warning!\n" +
5893
			"        	}\n" +
5948
			" */\n" +
5894
			"        } \n" +
5949
			"public class Test {\n" +
5950
			"	public void method(long l) {}\n" +
5951
			"	/**\n" +
5952
			"	 * @see #method(Long) Warning!\n" +
5953
			"	 */\n" +
5954
			"	void bar() {}\n" +
5895
			"}\n"
5955
			"}\n"
5896
			,
5956
		},
5897
			"pkg1/Valid1.java",
5957
		"----------\n" +
5898
			"package pkg1; \n" +
5958
		"1. ERROR in Test.java (at line 2)\n" +
5899
			"import mainpkg.Outer.Inner.MostInner;\n" +
5959
		"	* @see #method(Long) Warning!\n" +
5900
			"// valid import - no error in 5.0\n" +
5960
		"	        ^^^^^^\n" +
5901
			"\n" +
5961
		"Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
5902
			"/** \n" +
5962
		"----------\n" +
5903
			" * {@link MostInner}\n" +
5963
		"2. ERROR in Test.java (at line 7)\n" +
5904
			" * \n" +
5964
		"	* @see #method(Long) Warning!\n" +
5905
			" */ \n" +
5965
		"	        ^^^^^^\n" +
5906
			"public class Valid1 { \n" +
5966
		"Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
5907
			"	/** \n" +
5967
		"----------\n",
5908
			"	 * {@link MostInner} \n" +
5968
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5909
			"	 * \n" +
5969
	);
5910
			"	 */ \n" +
5970
}
5911
			"      void m() { } \n" +
5912
			"}\n"
5913
			,
5914
			"pkg2/Valid2.java",
5915
			"package pkg2; \n" +
5916
			"import mainpkg.Outer.Inner.*;\n" +
5917
			"//valid import - no error in 5.0\n" +
5918
			"\n" +
5919
			"/** \n" +
5920
			" * {@link MostInner}\n" +
5921
			" * \n" +
5922
			" */ \n" +
5923
			"public class Valid2 { \n" +
5924
			"      void m() { } \n" +
5925
			"}\n"
5926
			,
5927
			"pkg3/Invalid3.java",
5928
			"package pkg3; \n" +
5929
			"import mainpkg.Outer.*;\n" +
5930
			"//invalid import: expecting warning / error\n" +
5931
			"\n" +
5932
			"/** \n" +
5933
			" * {@link MostInner} -- error/warning  \n" +
5934
			" * \n" +
5935
			" */ \n" +
5936
			"public class Invalid3 { \n" +
5937
			"      void m() { } \n" +
5938
			"}\n"
5939
	};
5940
5941
	String error14 = new String(
5942
			//pkg1\Valid1.java:12: warning - Tag @link: reference not found: MostInner
5943
			//pkg1\Valid1.java:17: warning - Tag @link: reference not found: MostInner
5944
			//pkg2\Valid2.java:12: warning - Tag @link: reference not found: MostInner
5945
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
5946
			"----------\n" +
5947
			"1. ERROR in pkg1\\Valid1.java (at line 6)\n" +
5948
			"	* {@link MostInner}\n" +
5949
			"	         ^^^^^^^^^\n" +
5950
			"Javadoc: Invalid member type qualification\n" +
5951
			"----------\n" +
5952
			"2. ERROR in pkg1\\Valid1.java (at line 11)\n" +
5953
			"	* {@link MostInner} \n" +
5954
			"	         ^^^^^^^^^\n" +
5955
			"Javadoc: Invalid member type qualification\n" +
5956
			"----------\n" +
5957
			"----------\n" +
5958
			"1. ERROR in pkg2\\Valid2.java (at line 6)\n" +
5959
			"	* {@link MostInner}\n" +
5960
			"	         ^^^^^^^^^\n" +
5961
			"Javadoc: Invalid member type qualification\n" +
5962
			"----------\n" +
5963
			"----------\n" +
5964
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
5965
			"	* {@link MostInner} -- error/warning  \n" +
5966
			"	         ^^^^^^^^^\n" +
5967
			"Javadoc: MostInner cannot be resolved to a type\n" +
5968
	"----------\n");
5969
5971
5970
	String error50 = new String(
5972
/**
5971
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
5973
 * @bug 163659: [javadoc] Compiler should warn when method parameters are not identical
5972
			"----------\n" +
5974
 * @test Ensure that a warning is raised when method parameter types are not identical
5973
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
5975
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=163659"
5974
			"	* {@link MostInner} -- error/warning  \n" +
5976
 */
5975
			"	         ^^^^^^^^^\n" +
5977
public void testBug163659() {
5976
			"Javadoc: MostInner cannot be resolved to a type\n" +
5978
	runNegativeTest(
5977
			"----------\n");
5979
		new String[] {
5980
			"Test.java",
5981
			"/**\n" +
5982
			" * @see #foo(MyInterface)\n" +
5983
			" * @see #foo(MySubInterface)\n" +
5984
			" */\n" +
5985
			"public class Test {\n" +
5986
			"	public void foo(MyInterface mi) {\n" +
5987
			"	}\n" +
5988
			"}\n" +
5989
			"interface MyInterface {}\n" +
5990
			"interface MySubInterface extends MyInterface {} \n"
5991
		},
5992
		"----------\n" +
5993
		"1. ERROR in Test.java (at line 3)\n" +
5994
		"	* @see #foo(MySubInterface)\n" +
5995
		"	        ^^^\n" +
5996
		"Javadoc: The method foo(MyInterface) in the type Test is not applicable for the arguments (MySubInterface)\n" +
5997
		"----------\n",
5998
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
5999
	);
6000
}
5978
6001
5979
	this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
6002
/**
6003
 * @bug 165794: [javadoc] Should not report ambiguous on method with parameterized types as parameters
6004
 * @test Ensure that no warning are raised when ambiguous parameterized methods are present in javadoc comments
6005
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165794"
6006
 */
6007
public void testBug165794() {
6008
	String[] testFiles = new String[] {
6009
		"X.java",
6010
		"/**\n" +
6011
		" * No reasonable hint for resolving the {@link #getMax(A)}.\n" +
6012
		" */\n" +
6013
		"public class X {\n" +
6014
		"    /**\n" +
6015
		"     * Extends Number method.\n" +
6016
		"     * @see #getMax(A ipZ)\n" +
6017
		"     */\n" +
6018
		"    public <T extends Y> T getMax(final A<T> ipY) {\n" +
6019
		"        return ipY.t();\n" +
6020
		"    }\n" +
6021
		"    \n" +
6022
		"    /**\n" +
6023
		"     * Extends Exception method.\n" +
6024
		"     * @see #getMax(A ipY)\n" +
6025
		"     */\n" +
6026
		"    public <T extends Z> T getMax(final A<T> ipZ) {\n" +
6027
		"        return ipZ.t();\n" +
6028
		"    }\n" +
6029
		"}\n" +
6030
		"class A<T> {\n" +
6031
		"	T t() { return null; }\n" +
6032
		"}\n" +
6033
		"class Y {}\n" +
6034
		"class Z {}"
6035
	};
5980
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6036
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
5981
		runNegativeTest(units,error14);
6037
		return;
5982
	}
5983
	else {
5984
		runNegativeTest(units,error50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
5985
	}
6038
	}
6039
	runConformTest(testFiles);
5986
}
6040
}
5987
6041
5988
/**
6042
/**
5989
 * @bug 177009: [javadoc] Missing Javadoc tag not reported
6043
 * @bug 166365: [javadoc] severity level of malformed javadoc comments did not work properly
5990
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=177009"
6044
 * @test Ensure that no warning is raised when visibility is lower than the javadoc option one
6045
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166365"
5991
 */
6046
 */
5992
public void testBug177009a() {
6047
public void testBug166365() {
5993
	String[] units = new String[] {
6048
	String[] testFiles = new String[] {
5994
		"pkg/X.java",
6049
		"X.java",
5995
		"package pkg;\n" +
5996
		"\n" +
5997
		"public class X {\n" +
6050
		"public class X {\n" +
5998
		"	public X(String str, int anInt) {\n" +
6051
		"    /**\n" +
5999
		"	}\n" +
6052
		"     * @return\n" +
6000
		"}\n",
6053
		"     */\n" +
6001
		"pkg/Y.java",
6054
		"    private String getSomePrivate() {\n" +
6002
		"package pkg;\n" +
6055
		"        return \"SomePrivate\";\n" +
6003
		"\n" +
6056
		"    }\n" +
6004
		"public class Y extends X {\n" +
6057
		"    /**\n" +
6005
		"	private static int myInt = 0;\n" +
6058
		"     * @return\n" +
6059
		"     */\n" +
6060
		"    protected String getSomeProtected() {\n" +
6061
		"        return \"SomeProtected\";\n" +
6062
		"    }\n" +
6063
		"    /**\n" +
6064
		"     * @return\n" +
6065
		"     */\n" +
6066
		"    String getSomeDefault() {\n" +
6067
		"        return \"SomeDefault\";\n" +
6068
		"    }\n" +
6069
		"    /**\n" +
6070
		"     * @return\n" +
6071
		"     */\n" +
6072
		"    public String getSomePublic() {\n" +
6073
		"        return \"SomePublic\";\n" +
6074
		"    }\n" +
6075
		"}\n"
6076
	};
6077
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
6078
	runNegativeTest(testFiles,
6079
		"----------\n" +
6080
		"1. ERROR in X.java (at line 21)\n" +
6081
		"	* @return\n" +
6082
		"	   ^^^^^^\n" +
6083
		"Javadoc: Description expected after @return\n" +
6084
		"----------\n",
6085
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6086
	);
6087
}
6088
6089
/**
6090
 * @bug 166436: [javadoc] Potentially wrong javadoc warning for unexpected duplicate tag value
6091
 * @test Ensure that no duplicate warning is raised for value tag
6092
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166436"
6093
 */
6094
public void testBug166436() {
6095
	String[] testFiles = new String[] {
6096
		"X.java",
6097
		"public class X {\n" +
6098
		"	public static final String PUBLIC_CONST = \"public\";\n" +
6099
		"	protected static final String PROTECTED_CONST = \"protected\";\n" +
6100
		"	static final String DEFAULT_CONST = \"default\"; \n" +
6101
		"	private static final String PRIVATE_CONST = \"private\"; \n" +
6006
		"	/**\n" +
6102
		"	/**\n" +
6007
		"	 * @see X#X(String, int)\n" + // case1 potential AIOOBE
6103
		"	 * Values:\n" +
6104
		"	 * <ul>\n" +
6105
		"	 * 	<li>{@value #PUBLIC_CONST}</li>\n" +
6106
		"	 * 	<li>{@value #PROTECTED_CONST}</li>\n" +
6107
		"	 * 	<li>{@value #DEFAULT_CONST}</li>\n" +
6108
		"	 * 	<li>{@value #PRIVATE_CONST}</li>\n" +
6109
		"	 * </ul>\n" +
6008
		"	 */\n" +
6110
		"	 */\n" +
6009
		"	public Y(String str) {\n" +
6111
		"	public X() {\n" +
6010
		"		super(str, myInt);\n" +
6011
		"	}\n" +
6112
		"	}\n" +
6012
		"}\n"
6113
		"}\n"
6013
	};
6114
	};
6014
	this.reportMissingJavadocTags = CompilerOptions.WARNING;
6115
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
6015
	runConformTest(
6116
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6016
			true,
6117
		runNegativeTest(testFiles,
6017
			units,
6018
			"----------\n" +
6118
			"----------\n" +
6019
			"1. WARNING in pkg\\Y.java (at line 8)\n" +
6119
			"1. ERROR in X.java (at line 9)\n" +
6020
			"	public Y(String str) {\n" +
6120
			"	* 	<li>{@value #PUBLIC_CONST}</li>\n" +
6021
			"	                ^^^\n" +
6121
			"	  	      ^^^^^\n" +
6022
			"Javadoc: Missing tag for parameter str\n" +
6122
			"Javadoc: Unexpected tag\n" +
6123
			"----------\n" +
6124
			"2. ERROR in X.java (at line 10)\n" +
6125
			"	* 	<li>{@value #PROTECTED_CONST}</li>\n" +
6126
			"	  	      ^^^^^\n" +
6127
			"Javadoc: Unexpected tag\n" +
6128
			"----------\n" +
6129
			"3. ERROR in X.java (at line 11)\n" +
6130
			"	* 	<li>{@value #DEFAULT_CONST}</li>\n" +
6131
			"	  	      ^^^^^\n" +
6132
			"Javadoc: Unexpected tag\n" +
6133
			"----------\n" +
6134
			"4. ERROR in X.java (at line 12)\n" +
6135
			"	* 	<li>{@value #PRIVATE_CONST}</li>\n" +
6136
			"	  	      ^^^^^\n" +
6137
			"Javadoc: Unexpected tag\n" +
6138
			"----------\n"
6139
		);
6140
	} else {
6141
		runNegativeTest(testFiles,
6142
			"----------\n" +
6143
			"1. ERROR in X.java (at line 10)\n" +
6144
			"	* 	<li>{@value #PROTECTED_CONST}</li>\n" +
6145
			"	  	            ^^^^^^^^^^^^^^^^\n" +
6146
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'protected\' reference\n" +
6147
			"----------\n" +
6148
			"2. ERROR in X.java (at line 11)\n" +
6149
			"	* 	<li>{@value #DEFAULT_CONST}</li>\n" +
6150
			"	  	            ^^^^^^^^^^^^^^\n" +
6151
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
6152
			"----------\n" +
6153
			"3. ERROR in X.java (at line 12)\n" +
6154
			"	* 	<li>{@value #PRIVATE_CONST}</li>\n" +
6155
			"	  	            ^^^^^^^^^^^^^^\n" +
6156
			"Javadoc: \'public\' visibility for malformed doc comments hides this \'private\' reference\n" +
6023
			"----------\n",
6157
			"----------\n",
6024
			null, null,
6158
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6025
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6159
		);
6160
	}
6026
}
6161
}
6027
6162
6028
public void testBug177009b() {
6163
/**
6164
 * @bug 168849: [javadoc] Javadoc warning on @see reference in class level docs.
6165
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=168849"
6166
 */
6167
public void testBug168849a() {
6029
	String[] units = new String[] {
6168
	String[] units = new String[] {
6030
		"pkg/X.java",
6169
		"pkg/X.java",
6031
		"package pkg;\n" +
6170
		"package pkg;\n" +
6032
		"\n" +
6171
		"\n" +
6033
		"public class X {\n" +
6172
		"public class X {\n" +
6034
		"	public X(String str, int anInt) {\n" +
6173
		"	/**\n" +
6174
		"	 * @see http://www.eclipse.org/\n" +
6175
		"	 */\n" +
6176
		"	public void foo() { \n" +
6177
		"	 \n" +
6035
		"	}\n" +
6178
		"	}\n" +
6036
		"}\n",
6179
		"}\n"
6037
		"pkg/Y.java",
6180
	};
6181
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6182
	runConformTest(true, units,
6183
			"----------\n" +
6184
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6185
			"	* @see http://www.eclipse.org/\n" +
6186
			"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
6187
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
6188
			"----------\n",
6189
			null, null,
6190
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6191
}
6192
6193
public void testBug168849b() {
6194
	String[] units = new String[] {
6195
		"pkg/X.java",
6038
		"package pkg;\n" +
6196
		"package pkg;\n" +
6039
		"\n" +
6197
		"\n" +
6040
		"public class Y extends X {\n" +
6198
		"public class X {\n" +
6041
		"	/**\n" +
6199
		"	/**\n" +
6042
		"	 * @param str\n" +
6200
		"	 * @see http://ftp.eclipse.org/\n" +
6043
		"	 * @param anInt\n" +
6044
		"	 * @see X#X(String, int)\n" + // case2 find super ref
6045
		"	 */\n" +
6201
		"	 */\n" +
6046
		"	public Y(String str, int anInt, int anotherInt) {\n" +
6202
		"	public void foo() { \n" +
6047
		"		super(str, anInt);\n" +
6203
		"	 \n" +
6048
		"	}\n" +
6204
		"	}\n" +
6049
		"}\n"
6205
		"}\n"
6050
	};
6206
	};
6051
	this.reportMissingJavadocTags = CompilerOptions.WARNING;
6207
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6052
	runConformTest(true, units,
6208
	runConformTest(true, units,
6053
			"----------\n" +
6209
			"----------\n" +
6054
			"1. WARNING in pkg\\Y.java (at line 9)\n" +
6210
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6055
			"	public Y(String str, int anInt, int anotherInt) {\n" +
6211
			"	* @see http://ftp.eclipse.org/\n" +
6056
			"	                                    ^^^^^^^^^^\n" +
6212
			"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
6057
			"Javadoc: Missing tag for parameter anotherInt\n" +
6213
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
6058
			"----------\n",
6214
			"----------\n",
6059
			null, null,
6215
			null, null,
6060
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6216
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6061
}
6217
}
6062
6218
6063
/**
6219
public void testBug168849c() {
6064
 * @bug 190970: [javadoc] "field never read locally" analysis should not consider javadoc
6220
	String[] units = new String[] {
6065
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=190970"
6221
		"pkg/X.java",
6066
 */
6222
		"package pkg;\n" +
6067
public void testBug190970a() {
6223
		"\n" +
6068
	Map customOptions = getCompilerOptions();
6224
		"public class X {\n" +
6069
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
6225
		"	/**\n" +
6070
	this.runConformTest(
6226
		"	 * @see ://\n" +
6071
		true,
6227
		"	 */\n" +
6072
		new String[] {
6228
		"	public void foo() { \n" +
6073
			"pkg/X.java",
6229
		"	 \n" +
6074
			"public class X {\n" +
6230
		"	}\n" +
6075
			"private int unused1;\n" +
6231
		"}\n"
6076
			"\n" +
6232
	};
6077
	        "/**\n" +
6233
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6078
	        " * Same value as {@link #unused1}\n" +
6079
	        " */\n" +
6080
	        "private int unused2;\n" +
6081
			"}\n",
6082
		},
6083
		null,
6084
		customOptions,
6085
		"----------\n" +
6086
		"1. WARNING in pkg\\X.java (at line 2)\n" +
6087
		"	private int unused1;\n" +
6088
		"	            ^^^^^^^\n" +
6089
		"The field X.unused1 is never read locally\n" +
6090
		"----------\n" +
6091
		"2. WARNING in pkg\\X.java (at line 7)\n" +
6092
		"	private int unused2;\n" +
6093
		"	            ^^^^^^^\n" +
6094
		"The field X.unused2 is never read locally\n" +
6095
		"----------\n",
6096
		null, null,
6097
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
6098
	);
6099
}
6100
// test unused methods
6101
public void testBug190970b() {
6102
	Map customOptions = getCompilerOptions();
6103
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
6104
	this.runConformTest(
6105
		true,
6106
		new String[] {
6107
			"pkg/X.java",
6108
			"package pkg;\n" +
6109
			"\n" +
6110
			"public class X {\n" +
6111
			"private void unused1() {}\n" +
6112
			"/**\n" +
6113
			" * Same value as {@link #unused1()}\n" +
6114
			" */\n" +
6115
			"private void unused2() {}\n" +
6116
			"}\n",
6117
		},
6118
		null,
6119
		customOptions,
6120
		"----------\n" +
6121
		"1. WARNING in pkg\\X.java (at line 4)\n" +
6122
		"	private void unused1() {}\n" +
6123
		"	             ^^^^^^^^^\n" +
6124
		"The method unused1() from the type X is never used locally\n" +
6125
		"----------\n" +
6126
		"2. WARNING in pkg\\X.java (at line 8)\n" +
6127
		"	private void unused2() {}\n" +
6128
		"	             ^^^^^^^^^\n" +
6129
		"The method unused2() from the type X is never used locally\n" +
6130
		"----------\n",
6131
		null, null,
6132
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
6133
	);
6134
}
6135
// test unused types
6136
public void testBug190970c() {
6137
	Map customOptions = getCompilerOptions();
6138
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
6139
	runConformTest(
6234
	runConformTest(
6140
		true,
6235
			true, units,
6141
	new String[] {
6236
			"----------\n" +
6237
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6238
			"	* @see ://\n" +
6239
			"	   ^^^\n" +
6240
			"Javadoc: Missing reference\n" +
6241
			"----------\n",
6242
			null, null,
6243
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6244
}
6245
6246
public void testBug168849d() {
6247
	String[] units = new String[] {
6142
		"pkg/X.java",
6248
		"pkg/X.java",
6143
		"package pkg;\n" +
6249
		"package pkg;\n" +
6144
		"\n" +
6250
		"\n" +
6145
		"public class X {\n" +
6251
		"public class X {\n" +
6146
		"private class unused1 {}\n" +
6252
		"	/**\n" +
6147
		"/**\n" +
6253
		"	 * @see http\u003A\u002F\u002Fwww.eclipse.org\n" +
6148
		" * {@link X.unused1}\n" +
6254
		"	 */\n" +
6149
		" */\n" +
6255
		"	public void foo() { \n" +
6150
		"private class unused2 {}\n" +
6256
		"	 \n" +
6151
		"}\n",
6257
		"	}\n" +
6152
	},
6258
		"}\n"
6153
	null,
6259
	};
6154
	customOptions,
6260
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6155
	"----------\n" +
6261
	runConformTest(true, units,
6156
	"1. WARNING in pkg\\X.java (at line 4)\n" +
6262
			"----------\n" +
6157
	"	private class unused1 {}\n" +
6263
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6158
	"	              ^^^^^^^\n" +
6264
			"	* @see http://www.eclipse.org\n" +
6159
	"The type X.unused1 is never used locally\n" +
6265
			"	       ^^^^^^^^^^^^^^^^^^^^^^\n" +
6160
	"----------\n" +
6266
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
6161
	"2. WARNING in pkg\\X.java (at line 8)\n" +
6267
			"----------\n",
6162
	"	private class unused2 {}\n" +
6268
			null, null,
6163
	"	              ^^^^^^^\n" +
6269
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6164
	"The type X.unused2 is never used locally\n" +
6165
	"----------\n",
6166
	null, null,
6167
	JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
6168
	);
6169
}
6270
}
6170
6271
6171
//	static { TESTS_PREFIX = "testBug191322"; }
6272
public void testBug168849e() {
6172
/**
6273
	String[] units = new String[] {
6173
 * @bug 191322: [javadoc] @see or @link reference to method without signature fails to resolve to base class method
6274
		"pkg/X.java",
6174
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=191322"
6275
		"package pkg;\n" +
6175
 */
6276
		"\n" +
6176
public void testBug191322() {
6277
		"public class X {\n" +
6177
	runConformTest(
6278
		"	/**\n" +
6178
		new String[] {
6279
		"	 * @see \"http\u003A\u002F\u002Fwww.eclipse.org\"\n" +
6179
			"X.java",
6280
		"	 */\n" +
6180
			"public class X {\n" +
6281
		"	public void foo() { \n" +
6181
			"	void foo() {}\n" +
6282
		"	 \n" +
6182
			"	/**\n" +
6283
		"	}\n" +
6183
			"	 * {@link #foo}.\n" +
6284
		"}\n"
6184
			"	 * @see #foo\n" +
6285
	};
6185
			"	 */\n" +
6286
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6186
			"	void goo() {}\n" +
6287
	runConformTest(units);
6187
			"}\n",
6188
			"Y.java",
6189
			"class Y extends X {\n" +
6190
			"	/**\n" +
6191
			"	 * {@link #foo}\n" +
6192
			"	 * @see #foo\n" +
6193
			"	 */\n" +
6194
			"	void hoo() {}\n" +
6195
			"}"
6196
		}
6197
	);
6198
}
6288
}
6199
public void testBug191322b() {
6289
6200
	runConformTest(
6290
public void testBug168849f() {
6201
		new String[] {
6291
	String[] units = new String[] {
6202
			"b/X.java",
6292
		"pkg/X.java",
6203
			"package b;\n" +
6293
		"package pkg;\n" +
6204
			"public class X {\n" +
6294
		"\n" +
6205
			"	void foo() {}\n" +
6295
		"public class X {\n" +
6206
			"}\n" +
6296
		"	/**\n" +
6207
			"class Y extends X {}\n" +
6297
		"	 * @see \"http://www.eclipse.org/\"\n" +
6208
			"class W extends Y {}\n" +
6298
		"	 */\n" +
6209
			"class Z extends W {\n" +
6299
		"	public void foo() { \n" +
6210
			"	/**\n" +
6300
		"	 \n" +
6211
			"	 * {@link #foo}\n" +
6301
		"	}\n" +
6212
			"	 * @see #foo\n" +
6302
		"}\n"
6213
			"	 */\n" +
6303
	};
6214
			"	void hoo() {}\n" +
6304
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6215
			"}\n"
6305
	runConformTest(units);
6216
		}
6217
	);
6218
}
6306
}
6219
public void testBug191322c() {
6307
6220
	runConformTest(
6308
public void testBug168849g() {
6221
		new String[] {
6309
	String[] units = new String[] {
6222
			"c/X.java",
6310
		"pkg/X.java",
6223
			"package c;\n" +
6311
		"package pkg;\n" +
6224
			"public interface X {\n" +
6312
		"\n" +
6225
			"	void foo();\n" +
6313
		"public class X {\n" +
6226
			"}\n" +
6314
		"	/**\n" +
6227
			"interface Y extends X {\n" +
6315
		"	 * @see http:/ invalid reference\n" +
6228
			"	/**\n" +
6316
		"	 */\n" +
6229
			"	 * {@link #foo}\n" +
6317
		"	public void foo() { \n" +
6230
			"	 * @see #foo\n" +
6318
		"	 \n" +
6231
			"	 */\n" +
6319
		"	}\n" +
6232
			"	void hoo();\n" +
6320
		"}\n"
6233
			"}\n"
6321
	};
6234
		}
6322
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6235
	);
6323
	runConformTest(true, units,
6324
			"----------\n" +
6325
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6326
			"	* @see http:/ invalid reference\n" +
6327
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6328
			"Javadoc: Malformed reference (missing end space separator)\n" +
6329
			"----------\n",
6330
			null, null,
6331
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6236
}
6332
}
6237
public void testBug191322d() {
6333
6238
	runConformTest(
6334
public void testBug168849h() {
6239
		new String[] {
6335
	String[] units = new String[] {
6240
			"d/X.java",
6336
		"pkg/X.java",
6241
			"package d;\n" +
6337
		"package pkg;\n" +
6242
			"public interface X {\n" +
6338
		"\n" +
6243
			"	void foo();\n" +
6339
		"public class X {\n" +
6244
			"}\n" +
6340
		"	/**\n" +
6245
			"interface Y extends X {}\n" +
6341
		"	 * @see Object:/ invalid reference\n" +
6246
			"abstract class W implements Y {}\n" +
6342
		"	 */\n" +
6247
			"abstract class Z extends W {\n" +
6343
		"	public void foo() { \n" +
6248
			"	/**\n" +
6344
		"	 \n" +
6249
			"	 * {@link #foo}\n" +
6345
		"	}\n" +
6250
			"	 * @see #foo\n" +
6346
		"}\n"
6251
			"	 */\n" +
6347
	};
6252
			"	void hoo() {}\n" +
6348
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6253
			"}\n"
6349
	runConformTest(true, units,
6254
		}
6350
			"----------\n" +
6255
	);
6351
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6352
			"	* @see Object:/ invalid reference\n" +
6353
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6354
			"Javadoc: Malformed reference (missing end space separator)\n" +
6355
			"----------\n",
6356
			null, null,
6357
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6256
}
6358
}
6257
public void testBug191322e() {
6359
6258
	runConformTest(
6360
public void testBug168849i() {
6259
		new String[] {
6361
	String[] units = new String[] {
6260
			"e/X.java",
6362
		"pkg/X.java",
6261
			"package e;\n" +
6363
		"package pkg;\n" +
6262
			"public class X {\n" +
6364
		"\n" +
6263
			"	void foo() {}\n" +
6365
		"public class X {\n" +
6264
			"	class Y {\n" +
6366
		"	/**\n" +
6265
			"		/**\n" +
6367
		"	 * @see http\u003A\u002F invalid reference\n" +
6266
			"		 * {@link #foo}\n" +
6368
		"	 */\n" +
6267
			"		 * @see #foo\n" +
6369
		"	public void foo() { \n" +
6268
			"		 */\n" +
6370
		"	 \n" +
6269
			"		void hoo() {}\n" +
6371
		"	}\n" +
6270
			"	}\n" +
6372
		"}\n"
6271
			"}\n"
6373
	};
6272
		}
6374
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6273
	);
6375
	runConformTest(true, units,
6376
			"----------\n" +
6377
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6378
			"	* @see http:/ invalid reference\n" +
6379
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6380
			"Javadoc: Malformed reference (missing end space separator)\n" +
6381
			"----------\n",
6382
			null, null,
6383
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6274
}
6384
}
6275
public void testBug191322f() {
6385
6386
public void testBug168849j() {
6387
	String[] units = new String[] {
6388
		"pkg/X.java",
6389
		"package pkg;\n" +
6390
		"\n" +
6391
		"public class X {\n" +
6392
		"	/**\n" +
6393
		"	 * @see Object\u003A\u002F invalid reference\n" +
6394
		"	 */\n" +
6395
		"	public void foo() { \n" +
6396
		"	 \n" +
6397
		"	}\n" +
6398
		"}\n"
6399
	};
6400
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6401
	runConformTest(true, units,
6402
			"----------\n" +
6403
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6404
			"	* @see Object:/ invalid reference\n" +
6405
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6406
			"Javadoc: Malformed reference (missing end space separator)\n" +
6407
			"----------\n",
6408
			null, null,
6409
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6410
}
6411
6412
/**
6413
 * @bug 170637: [javadoc] incorrect warning about missing parameter javadoc when using many links
6414
 * @test Verify that javadoc parser is not blown-up when there's a lot of inline tags
6415
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=170637"
6416
 */
6417
public void testBug170637() {
6418
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
6276
	runConformTest(
6419
	runConformTest(
6277
		new String[] {
6420
		new String[] {
6278
			"f/X.java",
6421
			"src/JavaDocTest.java",
6279
			"package f;\n" +
6422
			"public interface JavaDocTest\n" + 
6280
			"public class X {\n" +
6423
			"{\n" + 
6281
			"	void foo() {}\n" +
6424
			"  /**\n" + 
6282
			"	void foo(String str) {}\n" +
6425
			"   * This is some stupid test...\n" + 
6283
			"}\n" +
6426
			"   * \n" + 
6284
			"class Y extends X {\n" +
6427
			"   * {@link JavaDocTest}\n" + 
6285
			"	/**\n" +
6428
			"   * \n" + 
6286
			"	 * {@link #foo}\n" +
6429
			"   * @param bar1 {@link JavaDocTest}\n" + 
6287
			"	 * @see #foo\n" +
6430
			"   * @param bar2 {@link JavaDocTest}\n" + 
6288
			"	 */\n" +
6431
			"   * @param bar3 {@link JavaDocTest}\n" + 
6289
			"	void hoo() {}\n" +
6432
			"   * @param bar4 {@link JavaDocTest}\n" + 
6433
			"   * @param bar5 {@link JavaDocTest}\n" + 
6434
			"   * @param bar6 {@link JavaDocTest}\n" + 
6435
			"   * @param bar7 {@link JavaDocTest}\n" + 
6436
			"   * @param bar8 {@link JavaDocTest}\n" + 
6437
			"   * @param bar9 {@link JavaDocTest}\n" + 
6438
			"   * @param bar10 {@link JavaDocTest}\n" + 
6439
			"   * @param bar11 {@link JavaDocTest}\n" + 
6440
			"   * @param bar12 {@link JavaDocTest}\n" + 
6441
			"   * @param bar13 {@link JavaDocTest}\n" + 
6442
			"   * \n" + 
6443
			"   * @return A string!\n" + 
6444
			"   */\n" + 
6445
			"  public String foo(String bar1,\n" + 
6446
			"      String bar2,\n" + 
6447
			"      String bar3,\n" + 
6448
			"      String bar4,\n" + 
6449
			"      String bar5,\n" + 
6450
			"      String bar6,\n" + 
6451
			"      String bar7,\n" + 
6452
			"      String bar8,\n" + 
6453
			"      String bar9,\n" + 
6454
			"      String bar10,\n" + 
6455
			"      String bar11,\n" + 
6456
			"      String bar12,\n" + 
6457
			"      String bar13\n" + 
6458
			"      );\n" + 
6459
			"\n" + 
6460
			"  /**\n" + 
6461
			"   * This is some more stupid test...\n" + 
6462
			"   * \n" + 
6463
			"   * {@link JavaDocTest}\n" + 
6464
			"   * {@link JavaDocTest}\n" + 
6465
			"   * {@link JavaDocTest}\n" + 
6466
			"   * {@link JavaDocTest}\n" + 
6467
			"   * {@link JavaDocTest}\n" + 
6468
			"   * {@link JavaDocTest}\n" + 
6469
			"   * {@link JavaDocTest}\n" + 
6470
			"   * {@link JavaDocTest}\n" + 
6471
			"   * {@link JavaDocTest}\n" + 
6472
			"   * {@link JavaDocTest}\n" + 
6473
			"   * {@link JavaDocTest}\n" + 
6474
			"   * {@link JavaDocTest}\n" + 
6475
			"   * {@link JavaDocTest}\n" + 
6476
			"   * {@link JavaDocTest}\n" + 
6477
			"   * {@link JavaDocTest}\n" + 
6478
			"   * {@link JavaDocTest}\n" + 
6479
			"   * {@link JavaDocTest}\n" + 
6480
			"   * {@link JavaDocTest}\n" + 
6481
			"   * {@link JavaDocTest}\n" + 
6482
			"   * {@link JavaDocTest}\n" + 
6483
			"   * {@link JavaDocTest}\n" + 
6484
			"   * \n" + 
6485
			"   * @param bar1 \n" + 
6486
			"   * @param bar2 \n" + 
6487
			"   * @param bar3 \n" + 
6488
			"   * @param bar4 \n" + 
6489
			"   * @param bar5 \n" + 
6490
			"   * @param bar6 \n" + 
6491
			"   * @param bar7 \n" + 
6492
			"   * @param bar8 \n" + 
6493
			"   * @param bar9 \n" + 
6494
			"   * @param bar10 \n" + 
6495
			"   * @param bar11 \n" + 
6496
			"   * @param bar12 \n" + 
6497
			"   * @param bar13 \n" + 
6498
			"   * \n" + 
6499
			"   * @return A string!\n" + 
6500
			"   */\n" + 
6501
			"  public String foo2(String bar1,\n" + 
6502
			"      String bar2,\n" + 
6503
			"      String bar3,\n" + 
6504
			"      String bar4,\n" + 
6505
			"      String bar5,\n" + 
6506
			"      String bar6,\n" + 
6507
			"      String bar7,\n" + 
6508
			"      String bar8,\n" + 
6509
			"      String bar9,\n" + 
6510
			"      String bar10,\n" + 
6511
			"      String bar11,\n" + 
6512
			"      String bar12,\n" + 
6513
			"      String bar13\n" + 
6514
			"      );\n" + 
6290
			"}\n"
6515
			"}\n"
6291
		}
6516
		}
6292
	);
6517
	);
6293
}
6518
}
6294
public void testBug191322g() {
6519
public void testBug170637a() {
6295
	runConformTest(
6520
	// conform test: verify we can handle a large number of tags
6296
		new String[] {
6521
	String[] units = new String[] {
6297
			"g/X.java",
6522
		"pkg/X.java",
6298
			"package g;\n" +
6523
		"package pkg;\n" +
6299
			"public class X {\n" +
6524
		"public interface X\n" +
6300
			"	void foo(String str) {}\n" +
6525
		"{\n" +
6301
			"	void foo(int x) {}\n" +
6526
		"  /**\n" +
6302
			"}\n" +
6527
		"   * Test for bug {@link \"https://bugs.eclipse.org/bugs/show_bug.cgi?id=170637\"}\n" +
6303
			"class Y extends X {\n" +
6528
		"   * \n" +
6304
			"	/**\n" +
6529
		"   * \n" +
6305
			"	 * {@link #foo}\n" +
6530
		"   * @param bar1 {@link X}\n" +
6306
			"	 * @see #foo\n" +
6531
		"   * @param bar2 {@link X}\n" +
6307
			"	 */\n" +
6532
		"   * @param bar3 {@link X}\n" +
6308
			"	void hoo() {}\n" +
6533
		"   * @param bar4 {@link X}\n" +
6309
			"}\n"
6534
		"   * @param bar5 {@link X}\n" +
6310
		}
6535
		"   * @param bar6 {@link X}\n" +
6311
	);
6536
		"   * @param bar7 {@link X}\n" +
6312
}
6537
		"   * @param bar8 {@link X}\n" +
6313
public void testBug191322h() {
6538
		"   * @param bar9 {@link X}\n" +
6314
	runConformTest(
6539
		"   * @param bar10 {@link X}\n" +
6315
		new String[] {
6540
		"   * @param bar11 {@link X}\n" +
6316
			"h/X.java",
6541
		"   * @param bar12 {@link X}\n" +
6317
			"package h;\n" +
6542
		"   * @param bar13 {@link X}\n" +
6318
			"public class X {\n" +
6543
		"   * @param bar14 {@link X}\n" +
6319
			"	void foo(String str) {}\n" +
6544
		"   * @param bar15 {@link X}\n" +
6320
			"}\n" +
6545
		"   * @param bar16 {@link X}\n" +
6321
			"class Y extends X {\n" +
6546
		"   * @param bar17 {@link X}\n" +
6322
			"	/**\n" +
6547
		"   * @param bar18 {@link X}\n" +
6323
			"	 * {@link #foo}\n" +
6548
		"   * @param bar19 {@link X}\n" +
6324
			"	 * @see #foo\n" +
6549
		"   * @param bar20 {@link X}\n" +
6325
			"	 */\n" +
6550
		"   * @param bar21 {@link X}\n" +
6326
			"	void hoo() {}\n" +
6551
		"   * @param bar22 {@link X}\n" +
6327
			"}\n"
6552
		"   * @param bar23 {@link X}\n" +
6328
		}
6553
		"   * @param bar24 {@link X}\n" +
6329
	);
6554
		"   * @param bar25 {@link X}\n" +
6555
		"   * @param bar26 {@link X}\n" +
6556
		"   * @param bar27 {@link X}\n" +
6557
		"   * @param bar28 {@link X}\n" +
6558
		"   * @param bar29 {@link X}\n" +
6559
		"   * @param bar30 {@link X}\n" +
6560
		"   * \n" +
6561
		"   * @return A string\n" +
6562
		"   */\n" +
6563
		"  public String foo(String bar1,\n" +
6564
		"      String bar2,\n" +
6565
		"      String bar3,\n" +
6566
		"      String bar4,\n" +
6567
		"      String bar5,\n" +
6568
		"      String bar6,\n" +
6569
		"      String bar7,\n" +
6570
		"      String bar8,\n" +
6571
		"      String bar9,\n" +
6572
		"      String bar10,\n" +
6573
		"      String bar11,\n" +
6574
		"      String bar12,\n" +
6575
		"      String bar13,\n" +
6576
		"      String bar14,\n" +
6577
		"      String bar15,\n" +
6578
		"      String bar16,\n" +
6579
		"      String bar17,\n" +
6580
		"      String bar18,\n" +
6581
		"      String bar19,\n" +
6582
		"      String bar20,\n" +
6583
		"      String bar21,\n" +
6584
		"      String bar22,\n" +
6585
		"      String bar23,\n" +
6586
		"      String bar24,\n" +
6587
		"      String bar25,\n" +
6588
		"      String bar26,\n" +
6589
		"      String bar27,\n" +
6590
		"      String bar28,\n" +
6591
		"      String bar29,\n" +
6592
		"      String bar30\n" +
6593
		"      );\n" +
6594
		"}\n"
6595
	};
6596
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
6597
	runConformTest(units);
6330
}
6598
}
6331
public void testBug191322i() {
6599
public void testBug170637b() {
6332
	runConformTest(
6600
	// conform test: verify we are able to raise warnings when dealing with a large number of tags
6333
		new String[] {
6601
	String[] units = new String[] {
6334
			"i/X.java",
6602
		"X.java",
6335
			"package i;\n" +
6603
		"public interface X\n" +
6336
			"interface X {\n" +
6604
		"{\n" +
6337
			"	void foo();\n" +
6605
		"  /**\n" +
6338
			"}\n" +
6606
		"   * Test for bug {@link \"https://bugs.eclipse.org/bugs/show_bug.cgi?id=170637\"}\n" +
6339
			"interface Y {\n" +
6607
		"   * \n" +
6340
			"	void foo(int i);\n" +
6608
		"   * \n" +
6341
			"}\n" +
6609
		"   * @param bar1 {@link X}\n" +
6342
			"abstract class Z implements X, Y {\n" +
6610
		"   * @param bar2 {@link X}\n" +
6343
			"	/**\n" +
6611
		"   * @param bar3 {@link X}\n" +
6344
			"	 * @see #foo\n" +
6612
		"   * @param bar4 {@link X}\n" +
6345
			"	 */\n" +
6613
		"   * @param bar5 {@link X}\n" +
6346
			"	void bar() {\n" +
6614
		"   * @param bar6 {@link X}\n" +
6347
			"	}\n" +
6615
		"   * @param bar7 {@link X}\n" +
6348
			"}"
6616
		"   * @param bar8 {@link X}\n" +
6349
		}
6617
		"   * @param bar9 {@link X}\n" +
6350
	);
6618
		"   * @param bar10 {@link X}\n" +
6619
		"   * @param bar11 {@link X}\n" +
6620
		"   * @param bar12 {@link X}\n" +
6621
		"   * @param bar13 {@link X}\n" +
6622
		"   * @param bar14 {@link X}\n" +
6623
		"   * @param bar15 {@link X}\n" +
6624
		"   * @param bar16 {@link X}\n" +
6625
		"   * @param bar17 {@link X}\n" +
6626
		"   * @param bar18 {@link X}\n" +
6627
		"   * @param bar19 {@link X}\n" +
6628
		"   * @param bar20 {@link X}\n" +
6629
		"   * @param bar21 {@link X}\n" +
6630
		"   * @param bar22 {@link X}\n" +
6631
		"   * @param bar23 {@link X}\n" +
6632
		"   * @param bar24 {@link X}\n" +
6633
		"   * @param bar25 {@link X}\n" +
6634
		"   * @param bar26 {@link X}\n" +
6635
		"   * @param bar27 {@link X}\n" +
6636
		"   * @param bar28 {@link X}\n" +
6637
		"   * @param bar29 {@link X}\n" +
6638
		"   * @param bar30 {@link X}\n" +
6639
		"   * \n" +
6640
		"   * @return A string\n" +
6641
		"   */\n" +
6642
		"  public String foo(String bar1,\n" +
6643
		"      String bar2,\n" +
6644
		"      String bar3,\n" +
6645
		"      String bar4,\n" +
6646
		"      String bar5,\n" +
6647
		"      String bar6,\n" +
6648
		"      String bar7,\n" +
6649
		"      String bar8,\n" +
6650
		"      String bar9,\n" +
6651
		"      String bar10,\n" +
6652
		"      String bar11,\n" +
6653
		"      String bar12,\n" +
6654
		"      String bar13,\n" +
6655
		"      String bar14,\n" +
6656
		"      String bar15,\n" +
6657
		"      String bar16,\n" +
6658
		"      String bar17,\n" +
6659
		"      String bar18,\n" +
6660
		"      String bar19,\n" +
6661
		"      String bar20,\n" +
6662
		"      String bar21,\n" +
6663
		"      String bar22,\n" +
6664
		"      String bar23,\n" +
6665
		"      String bar24,\n" +
6666
		"      String bar25,\n" +
6667
		"      String bar26,\n" +
6668
		"      String bar27,\n" +
6669
		"      String bar28,\n" +
6670
		"      String bar29,\n" +
6671
		"      String bar30,\n" +
6672
		"      String bar31\n" +
6673
		"      );\n" +
6674
		"}\n"
6675
	};
6676
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
6677
	runNegativeTest(units,
6678
		"----------\n" + 
6679
		"1. ERROR in X.java (at line 70)\n" + 
6680
		"	String bar31\n" + 
6681
		"	       ^^^^^\n" + 
6682
		"Javadoc: Missing tag for parameter bar31\n" + 
6683
		"----------\n");
6351
}
6684
}
6352
6685
6353
/**
6686
/**
6354
 * @bug 195374: [javadoc] Missing Javadoc warning for required qualification for inner types at 1.4 level
6687
 * Bug 176027: [javadoc] @link to member type handled incorrectly
6355
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=195374"
6688
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=176027"
6356
 */
6689
 */
6357
public void testBug195374() {
6690
public void testBug176027a() {
6691
	// case1 class X static class Inner
6358
	String[] units = new String[] {
6692
	String[] units = new String[] {
6359
		"X.java",
6693
		"otherpkg/C.java",
6360
		"public class X {\n" +
6694
		"package otherpkg;\n" +
6361
		"	public static class Param {\n" +
6695
		"public class C {\n" +
6362
	    "       /**\n" +
6696
		"        public static class Inner { }\n" +
6363
	    "         * warning expected when compliance < 1.5 {@link X#setParams(Param[])}\n" +
6697
		"}\n"
6364
	    "         * no warning expected {@link X#setParams(X.Param[])}\n" +
6698
		,
6365
	    "         */\n" +
6699
		"somepkg/MemberTypeDocTest.java",
6366
	    "        public int getIndex() {\n" +
6700
		"package somepkg;\n" +
6367
	    "                    return 0;\n" +
6701
		"import otherpkg.C.Inner;\n" +
6368
	    "        }\n" +
6702
		"/**\n" +
6369
	    "    }\n" +
6703
		" * {@link Inner} -- error/warning \n" +
6370
	    "    public void setParams(Param[] params) {\n" +
6704
		" */\n" +
6371
	    "	}\n" +
6705
		"public class MemberTypeDocTest {\n" +
6706
		"      void m() { }\n" +
6372
		"}\n"
6707
		"}\n"
6373
	};
6708
	};
6374
6375
	String error14 = new String(
6376
		// warning - Tag @link: can't find setParams(Param[]) in X
6377
		"----------\n" +
6378
		"1. ERROR in X.java (at line 4)\n" +
6379
		"	* warning expected when compliance < 1.5 {@link X#setParams(Param[])}\n" +
6380
		"	                                                            ^^^^^^^\n" +
6381
		"Javadoc: Invalid member type qualification\n" +
6382
		"----------\n");
6383
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
6384
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6709
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6385
		runNegativeTest(units,error14);
6710
		runNegativeTest(units,
6711
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6712
			"----------\n" +
6713
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6714
			"	* {@link Inner} -- error/warning \n" +
6715
			"	         ^^^^^\n" +
6716
			"Javadoc: Invalid member type qualification\n" +
6717
			"----------\n"
6718
		);
6386
	}
6719
	}
6387
	else {
6720
	else {
6388
		runConformTest(units);
6721
		runConformTest(units);
6389
	}
6722
	}
6390
}
6723
}
6391
6724
6392
/**
6725
public void testBug176027b() {
6393
 * Bug 86769: [javadoc] Warn/Error for 'Missing javadoc comments' doesn't recognize private inner classes
6726
	// case3 class X class Inner
6394
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=86769"
6727
	String[] units = new String[] {
6395
 */
6728
		"otherpkg/C.java",
6396
public void testBug86769_Classes1() {
6729
		"package otherpkg;\n" +
6397
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6730
		"public class C {\n" +
6398
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
6731
		"        public class Inner { }\n" +
6399
	runNegativeTest(
6732
		"}\n"
6400
		new String[] {
6733
		,
6401
			"A.java",
6734
		"somepkg/MemberTypeDocTest.java",
6402
			"/**\n" +
6735
		"package somepkg;\n" +
6403
			" * Test bug 86769 \n" +
6736
		"import otherpkg.C.Inner;\n" +
6404
			" */\n" +
6737
		"/**\n" +
6405
			"public class A {\n" +
6738
		" * {@link Inner} -- error/warning \n" +
6406
			"	private class Level1Private {\n" +
6739
		" */\n" +
6407
			"		private class Level2_PrivPriv {}\n" +
6740
		"public class MemberTypeDocTest {\n" +
6408
			"		class Level2_PrivDef {}\n" +
6741
		"      void m() { }\n" +
6409
			"		protected class Level2_PrivPro {}\n" +
6742
		"}\n"
6410
			"		public class Level2_PrivPub {}\n" +
6743
	};
6411
			"	}\n" +
6744
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6412
			"	class Level1Default{\n" +
6745
		runNegativeTest(units,
6413
			"		private class Level2_DefPriv {}\n" +
6746
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6414
			"		class Level2_DefDef {}\n" +
6747
			"----------\n" +
6415
			"		protected class Level2_DefPro {}\n" +
6748
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6416
			"		public class Level2_DefPub {}\n" +
6749
			"	* {@link Inner} -- error/warning \n" +
6417
			"	}\n" +
6750
			"	         ^^^^^\n" +
6418
			"	protected class Level1Protected {\n" +
6751
			"Javadoc: Invalid member type qualification\n" +
6419
			"		private class Level2_ProtPriv {}\n" +
6752
			"----------\n"
6420
			"		class Level2_ProDef {}\n" +
6753
		);
6421
			"		protected class Level2_ProPro {}\n" +
6754
	}
6422
			"		public class Level2_ProPub {} \n" +
6755
	else {
6423
			"	}\n" +
6756
		runConformTest(units);
6424
			"	public class Level1Public {\n" +
6757
	}
6425
			"		private class Level2_PubPriv {}\n" +
6426
			"		class Level2_PubDef {}\n" +
6427
			"		protected class Level2_PubPro {}\n" +
6428
			"		public class Level2_PubPub {}\n" +
6429
			"	}\n" +
6430
			"}\n"
6431
		},
6432
		"----------\n" +
6433
		"1. ERROR in A.java (at line 17)\n" +
6434
		"	protected class Level1Protected {\n" +
6435
		"	                ^^^^^^^^^^^^^^^\n" +
6436
		"Javadoc: Missing comment for protected declaration\n" +
6437
		"----------\n" +
6438
		"2. ERROR in A.java (at line 20)\n" +
6439
		"	protected class Level2_ProPro {}\n" +
6440
		"	                ^^^^^^^^^^^^^\n" +
6441
		"Javadoc: Missing comment for protected declaration\n" +
6442
		"----------\n" +
6443
		"3. ERROR in A.java (at line 21)\n" +
6444
		"	public class Level2_ProPub {} \n" +
6445
		"	             ^^^^^^^^^^^^^\n" +
6446
		"Javadoc: Missing comment for protected declaration\n" +
6447
		"----------\n" +
6448
		"4. ERROR in A.java (at line 23)\n" +
6449
		"	public class Level1Public {\n" +
6450
		"	             ^^^^^^^^^^^^\n" +
6451
		"Javadoc: Missing comment for public declaration\n" +
6452
		"----------\n" +
6453
		"5. ERROR in A.java (at line 26)\n" +
6454
		"	protected class Level2_PubPro {}\n" +
6455
		"	                ^^^^^^^^^^^^^\n" +
6456
		"Javadoc: Missing comment for protected declaration\n" +
6457
		"----------\n" +
6458
		"6. ERROR in A.java (at line 27)\n" +
6459
		"	public class Level2_PubPub {}\n" +
6460
		"	             ^^^^^^^^^^^^^\n" +
6461
		"Javadoc: Missing comment for public declaration\n" +
6462
		"----------\n",
6463
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6464
	);
6465
}
6758
}
6466
public void testBug86769_Classes2() {
6759
6467
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6760
public void testBug176027c() {
6468
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
6761
	// case3 class X interface Inner
6469
	runNegativeTest(
6762
	String[] units = new String[] {
6470
		new String[] {
6763
		"otherpkg/C.java",
6471
			"B.java",
6764
		"package otherpkg;\n" +
6472
			"/**\n" +
6765
		"public class C {\n" +
6473
			" * Test bug 86769\n" +
6766
		"        public interface Inner { }\n" +
6474
			" */\n" +
6767
		"}\n"
6475
			"public class B {\n" +
6768
		,
6476
			"	class Level0_Default {\n" +
6769
		"somepkg/MemberTypeDocTest.java",
6477
			"		private class Level1Private {\n" +
6770
		"package somepkg;\n" +
6478
			"			private class Level2_PrivPriv {}\n" +
6771
		"import otherpkg.C.Inner;\n" +
6479
			"			class Level2_PrivDef {}\n" +
6772
		"/**\n" +
6480
			"			protected class Level2_PrivPro {}\n" +
6773
		" * {@link Inner} -- error/warning \n" +
6481
			"			public class Level2_PrivPub {}\n" +
6774
		" */\n" +
6482
			"		}\n" +
6775
		"public class MemberTypeDocTest {\n" +
6483
			"	}\n" +
6776
		"      void m() { }\n" +
6484
			"	public class Level0_Public {\n" +
6777
		"}\n"
6485
			"		class Level1Default{\n" +
6778
	};
6486
			"			private class Level2_DefPriv {}\n" +
6779
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6487
			"			class Level2_DefDef {}\n" +
6780
		runNegativeTest(units,
6488
			"			protected class Level2_DefPro {}\n" +
6781
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6489
			"			public class Level2_DefPub {}\n" +
6782
			"----------\n" +
6490
			"		}\n" +
6783
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6491
			"	}\n" +
6784
			"	* {@link Inner} -- error/warning \n" +
6492
			"	protected class Level0_Protected {\n" +
6785
			"	         ^^^^^\n" +
6493
			"		protected class Level1Protected {\n" +
6786
			"Javadoc: Invalid member type qualification\n" +
6494
			"			private class Level2_ProtPriv {}\n" +
6787
			"----------\n"
6495
			"			class Level2_ProDef {}\n" +
6788
		);
6496
			"			protected class Level2_ProPro {}\n" +
6789
	}
6497
			"			public class Level2_ProPub {} \n" +
6790
	else {
6498
			"		}\n" +
6791
		runConformTest(units);
6499
			"	}\n" +
6792
	}
6500
			"	private class Level0_Private {\n" +
6501
			"		public class Level1Public {\n" +
6502
			"			private class Level2_PubPriv {}\n" +
6503
			"			class Level2_PubDef {}\n" +
6504
			"			protected class Level2_PubPro {}\n" +
6505
			"			public class Level2_PubPub {}\n" +
6506
			"		}\n" +
6507
			"	}\n" +
6508
			"}\n"
6509
		},
6510
		"----------\n" +
6511
		"1. ERROR in B.java (at line 5)\n" +
6512
		"	class Level0_Default {\n" +
6513
		"	      ^^^^^^^^^^^^^^\n" +
6514
		"Javadoc: Missing comment for default declaration\n" +
6515
		"----------\n" +
6516
		"2. ERROR in B.java (at line 13)\n" +
6517
		"	public class Level0_Public {\n" +
6518
		"	             ^^^^^^^^^^^^^\n" +
6519
		"Javadoc: Missing comment for public declaration\n" +
6520
		"----------\n" +
6521
		"3. ERROR in B.java (at line 14)\n" +
6522
		"	class Level1Default{\n" +
6523
		"	      ^^^^^^^^^^^^^\n" +
6524
		"Javadoc: Missing comment for default declaration\n" +
6525
		"----------\n" +
6526
		"4. ERROR in B.java (at line 16)\n" +
6527
		"	class Level2_DefDef {}\n" +
6528
		"	      ^^^^^^^^^^^^^\n" +
6529
		"Javadoc: Missing comment for default declaration\n" +
6530
		"----------\n" +
6531
		"5. ERROR in B.java (at line 17)\n" +
6532
		"	protected class Level2_DefPro {}\n" +
6533
		"	                ^^^^^^^^^^^^^\n" +
6534
		"Javadoc: Missing comment for default declaration\n" +
6535
		"----------\n" +
6536
		"6. ERROR in B.java (at line 18)\n" +
6537
		"	public class Level2_DefPub {}\n" +
6538
		"	             ^^^^^^^^^^^^^\n" +
6539
		"Javadoc: Missing comment for default declaration\n" +
6540
		"----------\n" +
6541
		"7. ERROR in B.java (at line 21)\n" +
6542
		"	protected class Level0_Protected {\n" +
6543
		"	                ^^^^^^^^^^^^^^^^\n" +
6544
		"Javadoc: Missing comment for protected declaration\n" +
6545
		"----------\n" +
6546
		"8. ERROR in B.java (at line 22)\n" +
6547
		"	protected class Level1Protected {\n" +
6548
		"	                ^^^^^^^^^^^^^^^\n" +
6549
		"Javadoc: Missing comment for protected declaration\n" +
6550
		"----------\n" +
6551
		"9. ERROR in B.java (at line 24)\n" +
6552
		"	class Level2_ProDef {}\n" +
6553
		"	      ^^^^^^^^^^^^^\n" +
6554
		"Javadoc: Missing comment for default declaration\n" +
6555
		"----------\n" +
6556
		"10. ERROR in B.java (at line 25)\n" +
6557
		"	protected class Level2_ProPro {}\n" +
6558
		"	                ^^^^^^^^^^^^^\n" +
6559
		"Javadoc: Missing comment for protected declaration\n" +
6560
		"----------\n" +
6561
		"11. ERROR in B.java (at line 26)\n" +
6562
		"	public class Level2_ProPub {} \n" +
6563
		"	             ^^^^^^^^^^^^^\n" +
6564
		"Javadoc: Missing comment for protected declaration\n" +
6565
		"----------\n",
6566
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6567
	);
6568
}
6569
public void testBug86769_Field1() {
6570
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6571
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
6572
	runNegativeTest(
6573
		new String[] {
6574
			"A.java",
6575
			"/**\n" +
6576
			" * Test bug 86769\n" +
6577
			" */\n" +
6578
			"public class A {\n" +
6579
			"	private class InnerPrivate {\n" +
6580
			"		private int pri_pri;\n" +
6581
			"		int pri_def;\n" +
6582
			"		protected int pri_pro;\n" +
6583
			"		public int pri_pub;\n" +
6584
			"	}\n" +
6585
			"	class InnerDefault{\n" +
6586
			"		private int def_pri;\n" +
6587
			"		int def_def;\n" +
6588
			"		protected int def_pro;\n" +
6589
			"		public int def_pub;\n" +
6590
			"	}\n" +
6591
			"	protected class InnerProtected {\n" +
6592
			"		private int pro_pri;\n" +
6593
			"		int pro_def;\n" +
6594
			"		protected int pro_pro;\n" +
6595
			"		public int pro_pub; \n" +
6596
			"	}\n" +
6597
			"	public class InnerPublic {\n" +
6598
			"		private int pub_pri;\n" +
6599
			"		int pub_def;\n" +
6600
			"		protected int pub_pro;\n" +
6601
			"		public int pub_pub;\n" +
6602
			"	}\n" +
6603
			"}\n"
6604
		},
6605
		"----------\n" +
6606
		"1. ERROR in A.java (at line 23)\n" +
6607
		"	public class InnerPublic {\n" +
6608
		"	             ^^^^^^^^^^^\n" +
6609
		"Javadoc: Missing comment for public declaration\n" +
6610
		"----------\n" +
6611
		"2. ERROR in A.java (at line 27)\n" +
6612
		"	public int pub_pub;\n" +
6613
		"	           ^^^^^^^\n" +
6614
		"Javadoc: Missing comment for public declaration\n" +
6615
		"----------\n",
6616
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6617
	);
6618
}
6619
public void testBug86769_Fields2() {
6620
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6621
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
6622
	runNegativeTest(
6623
		new String[] {
6624
			"B.java",
6625
			"/**\n" +
6626
			" * Test bug 86769\n" +
6627
			" */\n" +
6628
			"public class B {\n" +
6629
			"	private class Level1 {\n" +
6630
			"		private class InnerPrivate {\n" +
6631
			"			private int pri_pri;\n" +
6632
			"			int pri_def;\n" +
6633
			"			protected int pri_pro;\n" +
6634
			"			public int pri_pub;\n" +
6635
			"		}\n" +
6636
			"		class InnerDefault{\n" +
6637
			"			private int def_pri;\n" +
6638
			"			int def_def;\n" +
6639
			"			protected int def_pro;\n" +
6640
			"			public int def_pub;\n" +
6641
			"		}\n" +
6642
			"		protected class InnerProtected {\n" +
6643
			"			private int pro_pri;\n" +
6644
			"			int pro_def;\n" +
6645
			"			protected int pro_pro;\n" +
6646
			"			public int pro_pub; \n" +
6647
			"		}\n" +
6648
			"		public class InnerPublic {\n" +
6649
			"			private int pub_pri;\n" +
6650
			"			int pub_def;\n" +
6651
			"			protected int pub_pro;\n" +
6652
			"			public int pub_pub;\n" +
6653
			"		}\n" +
6654
			"	}\n" +
6655
			"}\n"
6656
		},
6657
		"----------\n" +
6658
		"1. ERROR in B.java (at line 5)\n" +
6659
		"	private class Level1 {\n" +
6660
		"	              ^^^^^^\n" +
6661
		"Javadoc: Missing comment for private declaration\n" +
6662
		"----------\n" +
6663
		"2. ERROR in B.java (at line 6)\n" +
6664
		"	private class InnerPrivate {\n" +
6665
		"	              ^^^^^^^^^^^^\n" +
6666
		"Javadoc: Missing comment for private declaration\n" +
6667
		"----------\n" +
6668
		"3. ERROR in B.java (at line 7)\n" +
6669
		"	private int pri_pri;\n" +
6670
		"	            ^^^^^^^\n" +
6671
		"Javadoc: Missing comment for private declaration\n" +
6672
		"----------\n" +
6673
		"4. ERROR in B.java (at line 8)\n" +
6674
		"	int pri_def;\n" +
6675
		"	    ^^^^^^^\n" +
6676
		"Javadoc: Missing comment for private declaration\n" +
6677
		"----------\n" +
6678
		"5. ERROR in B.java (at line 9)\n" +
6679
		"	protected int pri_pro;\n" +
6680
		"	              ^^^^^^^\n" +
6681
		"Javadoc: Missing comment for private declaration\n" +
6682
		"----------\n" +
6683
		"6. ERROR in B.java (at line 10)\n" +
6684
		"	public int pri_pub;\n" +
6685
		"	           ^^^^^^^\n" +
6686
		"Javadoc: Missing comment for private declaration\n" +
6687
		"----------\n" +
6688
		"7. ERROR in B.java (at line 12)\n" +
6689
		"	class InnerDefault{\n" +
6690
		"	      ^^^^^^^^^^^^\n" +
6691
		"Javadoc: Missing comment for private declaration\n" +
6692
		"----------\n" +
6693
		"8. ERROR in B.java (at line 13)\n" +
6694
		"	private int def_pri;\n" +
6695
		"	            ^^^^^^^\n" +
6696
		"Javadoc: Missing comment for private declaration\n" +
6697
		"----------\n" +
6698
		"9. ERROR in B.java (at line 14)\n" +
6699
		"	int def_def;\n" +
6700
		"	    ^^^^^^^\n" +
6701
		"Javadoc: Missing comment for private declaration\n" +
6702
		"----------\n" +
6703
		"10. ERROR in B.java (at line 15)\n" +
6704
		"	protected int def_pro;\n" +
6705
		"	              ^^^^^^^\n" +
6706
		"Javadoc: Missing comment for private declaration\n" +
6707
		"----------\n" +
6708
		"11. ERROR in B.java (at line 16)\n" +
6709
		"	public int def_pub;\n" +
6710
		"	           ^^^^^^^\n" +
6711
		"Javadoc: Missing comment for private declaration\n" +
6712
		"----------\n" +
6713
		"12. ERROR in B.java (at line 18)\n" +
6714
		"	protected class InnerProtected {\n" +
6715
		"	                ^^^^^^^^^^^^^^\n" +
6716
		"Javadoc: Missing comment for private declaration\n" +
6717
		"----------\n" +
6718
		"13. ERROR in B.java (at line 19)\n" +
6719
		"	private int pro_pri;\n" +
6720
		"	            ^^^^^^^\n" +
6721
		"Javadoc: Missing comment for private declaration\n" +
6722
		"----------\n" +
6723
		"14. ERROR in B.java (at line 20)\n" +
6724
		"	int pro_def;\n" +
6725
		"	    ^^^^^^^\n" +
6726
		"Javadoc: Missing comment for private declaration\n" +
6727
		"----------\n" +
6728
		"15. ERROR in B.java (at line 21)\n" +
6729
		"	protected int pro_pro;\n" +
6730
		"	              ^^^^^^^\n" +
6731
		"Javadoc: Missing comment for private declaration\n" +
6732
		"----------\n" +
6733
		"16. ERROR in B.java (at line 22)\n" +
6734
		"	public int pro_pub; \n" +
6735
		"	           ^^^^^^^\n" +
6736
		"Javadoc: Missing comment for private declaration\n" +
6737
		"----------\n" +
6738
		"17. ERROR in B.java (at line 24)\n" +
6739
		"	public class InnerPublic {\n" +
6740
		"	             ^^^^^^^^^^^\n" +
6741
		"Javadoc: Missing comment for private declaration\n" +
6742
		"----------\n" +
6743
		"18. ERROR in B.java (at line 25)\n" +
6744
		"	private int pub_pri;\n" +
6745
		"	            ^^^^^^^\n" +
6746
		"Javadoc: Missing comment for private declaration\n" +
6747
		"----------\n" +
6748
		"19. ERROR in B.java (at line 26)\n" +
6749
		"	int pub_def;\n" +
6750
		"	    ^^^^^^^\n" +
6751
		"Javadoc: Missing comment for private declaration\n" +
6752
		"----------\n" +
6753
		"20. ERROR in B.java (at line 27)\n" +
6754
		"	protected int pub_pro;\n" +
6755
		"	              ^^^^^^^\n" +
6756
		"Javadoc: Missing comment for private declaration\n" +
6757
		"----------\n" +
6758
		"21. ERROR in B.java (at line 28)\n" +
6759
		"	public int pub_pub;\n" +
6760
		"	           ^^^^^^^\n" +
6761
		"Javadoc: Missing comment for private declaration\n" +
6762
		"----------\n",
6763
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6764
	);
6765
}
6766
public void testBug86769_Metthods1() {
6767
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6768
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
6769
	runNegativeTest(
6770
		new String[] {
6771
			"A.java",
6772
			"/**\n" +
6773
			" * Test bug 86769\n" +
6774
			" */\n" +
6775
			"public class A {\n" +
6776
			"	private class InnerPrivate {\n" +
6777
			"		private void pri_pri() {}\n" +
6778
			"		void pri_def() {}\n" +
6779
			"		protected void pri_pro() {}\n" +
6780
			"		public void pri_pub() {}\n" +
6781
			"	}\n" +
6782
			"	class InnerDefault{\n" +
6783
			"		private void def_pri() {}\n" +
6784
			"		void def_def() {}\n" +
6785
			"		protected void def_pro() {}\n" +
6786
			"		public void def_pub() {}\n" +
6787
			"	}\n" +
6788
			"	protected class InnerProtected {\n" +
6789
			"		private void pro_pri() {}\n" +
6790
			"		void pro_def() {}\n" +
6791
			"		protected void pro_pro() {}\n" +
6792
			"		public void pro_pub() {} \n" +
6793
			"	}\n" +
6794
			"	public class InnerPublic {\n" +
6795
			"		private void pub_pri() {}\n" +
6796
			"		void pub_def() {}\n" +
6797
			"		protected void pub_pro() {}\n" +
6798
			"		public void pub_pub() {}\n" +
6799
			"	}\n" +
6800
			"}\n"
6801
		},
6802
		"----------\n" +
6803
		"1. ERROR in A.java (at line 23)\n" +
6804
		"	public class InnerPublic {\n" +
6805
		"	             ^^^^^^^^^^^\n" +
6806
		"Javadoc: Missing comment for public declaration\n" +
6807
		"----------\n" +
6808
		"2. ERROR in A.java (at line 27)\n" +
6809
		"	public void pub_pub() {}\n" +
6810
		"	            ^^^^^^^^^\n" +
6811
		"Javadoc: Missing comment for public declaration\n" +
6812
		"----------\n",
6813
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
6814
	);
6815
}
6793
}
6816
public void testBug86769_Methods2() {
6794
6817
	this.reportMissingJavadocComments = CompilerOptions.ERROR;
6795
public void testBug176027d() {
6818
	this.reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
6796
	// case4 interface X static class Inner
6819
	runConformTest(
6797
	String[] units = new String[] {
6820
		new String[] {
6798
		"otherpkg/C.java",
6821
			"B.java",
6799
		"package otherpkg;\n" +
6822
			"/**\n" +
6800
		"public interface C {\n" +
6823
			" * Test bug 86769\n" +
6801
		"        public static class Inner { }\n" +
6824
			" */\n" +
6802
		"}\n"
6825
			"public class B {\n" +
6803
		,
6826
			"	private class Level1 {\n" +
6804
		"somepkg/MemberTypeDocTest.java",
6827
			"		private class InnerPrivate {\n" +
6805
		"package somepkg;\n" +
6828
			"			private void pri_pri() {}\n" +
6806
		"import otherpkg.C.Inner;\n" +
6829
			"			void pri_def() {}\n" +
6807
		"/**\n" +
6830
			"			protected void pri_pro() {}\n" +
6808
		" * {@link Inner} -- error/warning \n" +
6831
			"			public void pri_pub() {}\n" +
6809
		" */\n" +
6832
			"		}\n" +
6810
		"public class MemberTypeDocTest {\n" +
6833
			"		class InnerDefault{\n" +
6811
		"      void m() { }\n" +
6834
			"			private void def_pri() {}\n" +
6812
		"}\n"
6835
			"			void def_def() {}\n" +
6813
	};
6836
			"			protected void def_pro() {}\n" +
6814
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6837
			"			public void def_pub() {}\n" +
6815
		runNegativeTest(units,
6838
			"		}\n" +
6816
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6839
			"		protected class InnerProtected {\n" +
6817
			"----------\n" +
6840
			"			private void pro_pri() {}\n" +
6818
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6841
			"			void pro_def() {}\n" +
6819
			"	* {@link Inner} -- error/warning \n" +
6842
			"			protected void pro_pro() {}\n" +
6820
			"	         ^^^^^\n" +
6843
			"			public void pro_pub() {} \n" +
6821
			"Javadoc: Invalid member type qualification\n" +
6844
			"		}\n" +
6822
			"----------\n"
6845
			"		public class InnerPublic {\n" +
6823
		);
6846
			"			private void pub_pri() {}\n" +
6824
	}
6847
			"			void pub_def() {}\n" +
6825
	else {
6848
			"			protected void pub_pro() {}\n" +
6826
		runConformTest(units);
6849
			"			public void pub_pub() {}\n" +
6827
	}
6850
			"		}\n" +
6851
			"	}\n" +
6852
			"}\n"
6853
		}
6854
	);
6855
}
6828
}
6856
6829
6857
/**
6830
public void testBug176027f() {
6858
 * @bug 125518: [javadoc] Embedding html in a link placed in a @see JavaDoc tag causes a warning
6831
	// case5 interface X class Inner
6859
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125518"
6860
 */
6861
public void testBug125518a() {
6862
	String[] units = new String[] {
6832
	String[] units = new String[] {
6863
		"pkg/X.java",
6833
		"otherpkg/C.java",
6864
		"package pkg;\n" +
6834
		"package otherpkg;\n" +
6865
		"\n" +
6835
		"public interface C {\n" +
6866
		"public class X {\n" +
6836
		"        public class Inner { }\n" +
6867
		"	/**\n" +
6837
		"}\n"
6868
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></\n" +
6838
		,
6869
		"	 */\n" +
6839
		"somepkg/MemberTypeDocTest.java",
6870
		"	public void foo() { \n" +
6840
		"package somepkg;\n" +
6871
		"	 \n" +
6841
		"import otherpkg.C.Inner;\n" +
6872
		"	}\n" +
6842
		"/**\n" +
6843
		" * {@link Inner} -- error/warning \n" +
6844
		" */\n" +
6845
		"public class MemberTypeDocTest {\n" +
6846
		"      void m() { }\n" +
6873
		"}\n"
6847
		"}\n"
6874
	};
6848
	};
6875
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6849
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6876
	runConformTest(true, units,
6850
		runNegativeTest(units,
6851
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6877
			"----------\n" +
6852
			"----------\n" +
6878
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6853
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6879
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></\n" +
6854
			"	* {@link Inner} -- error/warning \n" +
6880
			"	                                                     ^^\n" +
6855
			"	         ^^^^^\n" +
6881
			"Javadoc: Malformed link reference\n" +
6856
			"Javadoc: Invalid member type qualification\n" +
6882
			"----------\n",
6857
			"----------\n"
6883
			null, null,
6858
		);
6884
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6859
	}
6860
	else {
6861
		runConformTest(units);
6862
	}
6885
}
6863
}
6886
6864
6887
public void testBug125518b() {
6865
public void testBug176027g() {
6866
	// case6 interface X interface Inner
6888
	String[] units = new String[] {
6867
	String[] units = new String[] {
6889
		"pkg/X.java",
6868
		"otherpkg/C.java",
6890
		"package pkg;\n" +
6869
		"package otherpkg;\n" +
6891
		"\n" +
6870
		"public interface C {\n" +
6892
		"public class X {\n" +
6871
		"        public interface Inner { }\n" +
6893
		"	/**\n" +
6872
		"}\n"
6894
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></a\n" +
6873
		,
6895
		"	 */\n" +
6874
		"somepkg/MemberTypeDocTest.java",
6896
		"	public void foo() { \n" +
6875
		"package somepkg;\n" +
6897
		"	 \n" +
6876
		"import otherpkg.C.Inner;\n" +
6898
		"	}\n" +
6877
		"/**\n" +
6878
		" * {@link Inner} -- error/warning \n" +
6879
		" */\n" +
6880
		"public class MemberTypeDocTest {\n" +
6881
		"      void m() { }\n" +
6899
		"}\n"
6882
		"}\n"
6900
	};
6883
	};
6901
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6884
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6902
	runConformTest(true, units,
6885
		runNegativeTest(units,
6903
			"----------\n" +
6886
			//somepkg/MemberTypeDocTest.java:6: warning - Tag @link: reference not found: Inner
6904
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6887
			"----------\n" +
6905
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></a\n" +
6888
			"1. ERROR in somepkg\\MemberTypeDocTest.java (at line 4)\n" +
6906
			"	                                                     ^^^\n" +
6889
			"	* {@link Inner} -- error/warning \n" +
6907
			"Javadoc: Malformed link reference\n" +
6890
			"	         ^^^^^\n" +
6908
			"----------\n",
6891
			"Javadoc: Invalid member type qualification\n" +
6909
			null, null,
6892
			"----------\n"
6910
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6893
		);
6911
}
6894
	}
6895
	else {
6896
		runConformTest(units);
6897
	}
6898
}
6899
6900
public void testBug176027h_public() {
6901
	// test embedded inner classes
6902
	String[] units = new String[] {
6903
			"mainpkg/Outer.java",
6904
			"package mainpkg;\n" +
6905
			"public class Outer {\n" +
6906
			"        public class Inner {\n" +
6907
			"        	public class MostInner{\n" +
6908
			"    \n" +
6909
			"        	}\n" +
6910
			"        } \n" +
6911
			"}\n"
6912
			,
6913
			"pkg1/Valid1.java",
6914
			"package pkg1; \n" +
6915
			"import mainpkg.Outer.Inner.MostInner;\n" +
6916
			"// valid import - no error in 5.0\n" +
6917
			"\n" +
6918
			"/** \n" +
6919
			" * {@link MostInner}\n" +
6920
			" * \n" +
6921
			" */ \n" +
6922
			"public class Valid1 { \n" +
6923
			"	/** \n" +
6924
			"	 * {@link MostInner} \n" +
6925
			"	 * \n" +
6926
			"	 */ \n" +
6927
			"      void m() { } \n" +
6928
			"}\n"
6929
			,
6930
			"pkg2/Valid2.java",
6931
			"package pkg2; \n" +
6932
			"import mainpkg.Outer.Inner.*;\n" +
6933
			"//valid import - no error in 5.0\n" +
6934
			"\n" +
6935
			"/** \n" +
6936
			" * {@link MostInner}\n" +
6937
			" * \n" +
6938
			" */ \n" +
6939
			"public class Valid2 { \n" +
6940
			"      void m() { } \n" +
6941
			"}\n"
6942
			,
6943
			"pkg3/Invalid3.java",
6944
			"package pkg3; \n" +
6945
			"import mainpkg.Outer.*;\n" +
6946
			"//invalid import: expecting warning / error\n" +
6947
			"\n" +
6948
			"/** \n" +
6949
			" * {@link MostInner} -- error/warning  \n" +
6950
			" * \n" +
6951
			" */ \n" +
6952
			"public class Invalid3 { \n" +
6953
			"      void m() { } \n" +
6954
			"}\n"
6955
	};
6912
6956
6913
public void testBug125518c() {
6957
	String error14 = new String (
6914
	String[] units = new String[] {
6958
		//pkg1\Valid1.java:12: warning - Tag @link: reference not found: MostInner
6915
		"pkg/X.java",
6959
		//pkg2\Valid2.java:12: warning - Tag @link: reference not found: MostInner
6916
		"package pkg;\n" +
6960
		//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
6917
		"\n" +
6961
		"----------\n" +
6918
		"public class X {\n" +
6962
		"1. ERROR in pkg1\\Valid1.java (at line 6)\n" +
6919
		"	/**\n" +
6963
		"	* {@link MostInner}\n" +
6920
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></>\n" +
6964
		"	         ^^^^^^^^^\n" +
6921
		"	 */\n" +
6965
		"Javadoc: Invalid member type qualification\n" +
6922
		"	public void foo() { \n" +
6966
		"----------\n" +
6923
		"	 \n" +
6967
		"----------\n" +
6924
		"	}\n" +
6968
		"1. ERROR in pkg2\\Valid2.java (at line 6)\n" +
6925
		"}\n"
6969
		"	* {@link MostInner}\n" +
6926
	};
6970
		"	         ^^^^^^^^^\n" +
6927
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6971
		"Javadoc: Invalid member type qualification\n" +
6928
	runConformTest(true, units,
6972
		"----------\n" +
6929
			"----------\n" +
6973
		"----------\n" +
6930
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6974
		"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
6931
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></>\n" +
6975
		"	* {@link MostInner} -- error/warning  \n" +
6932
			"	                                                     ^^^\n" +
6976
		"	         ^^^^^^^^^\n" +
6933
			"Javadoc: Malformed link reference\n" +
6977
		"Javadoc: MostInner cannot be resolved to a type\n" +
6934
			"----------\n",
6978
		"----------\n");
6935
			null, null,
6936
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6937
}
6938
6979
6939
public void testBug125518d() {
6980
	String error50 = new String (
6940
	String[] units = new String[] {
6981
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
6941
		"pkg/X.java",
6942
		"package pkg;\n" +
6943
		"\n" +
6944
		"public class X {\n" +
6945
		"	/**\n" +
6946
		"	 * @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></aa>\n" +
6947
		"	 */\n" +
6948
		"	public void foo() { \n" +
6949
		"	 \n" +
6950
		"	}\n" +
6951
		"}\n"
6952
	};
6953
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6954
	runConformTest(true, units,
6955
			"----------\n" +
6982
			"----------\n" +
6956
			"1. WARNING in pkg\\X.java (at line 5)\n" +
6983
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
6957
			"	* @see <a href=\"ccwww.xyzzy.com/rfc123.html\">invalid></aa>\n" +
6984
			"	* {@link MostInner} -- error/warning  \n" +
6958
			"	                                                     ^^^^^\n" +
6985
			"	         ^^^^^^^^^\n" +
6959
			"Javadoc: Malformed link reference\n" +
6986
			"Javadoc: MostInner cannot be resolved to a type\n" +
6960
			"----------\n",
6987
			"----------\n");
6961
			null, null,
6962
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6963
}
6964
6988
6965
public void testBug125518e() {
6989
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
6966
	String[] units = new String[] {
6990
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
6967
		"pkg/X.java",
6991
		runNegativeTest(units,error14);
6968
		"package pkg;\n" +
6992
	}
6969
		"\n" +
6993
	else {
6970
		"public class X {\n" +
6994
		runNegativeTest(units,error50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
6971
		"	/**\n" +
6995
	}
6972
		"	 * @see <a href=\"http\u003A\u002F\u002Fwww.eclipse.org\"><valid>value</valid></a>\n" +
6973
		"	 */\n" +
6974
		"	public void foo() { \n" +
6975
		"	 \n" +
6976
		"	}\n" +
6977
		"}\n"
6978
		};
6979
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
6980
	runConformTest(units);
6981
}
6996
}
6982
6997
6983
/**
6998
public void testBug176027h_private() {
6984
 * @bug 168849: [javadoc] Javadoc warning on @see reference in class level docs.
6999
	// test embedded inner classes
6985
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=168849"
6986
 */
6987
public void testBug168849a() {
6988
	String[] units = new String[] {
7000
	String[] units = new String[] {
6989
		"pkg/X.java",
7001
			"mainpkg/Outer.java",
6990
		"package pkg;\n" +
7002
			"package mainpkg;\n" +
6991
		"\n" +
7003
			"public class Outer {\n" +
6992
		"public class X {\n" +
7004
			"        public class Inner {\n" +
6993
		"	/**\n" +
7005
			"        	public class MostInner{\n" +
6994
		"	 * @see http://www.eclipse.org/\n" +
7006
			"    \n" +
6995
		"	 */\n" +
7007
			"        	}\n" +
6996
		"	public void foo() { \n" +
7008
			"        } \n" +
6997
		"	 \n" +
7009
			"}\n"
6998
		"	}\n" +
7010
			,
6999
		"}\n"
7011
			"pkg1/Valid1.java",
7012
			"package pkg1; \n" +
7013
			"import mainpkg.Outer.Inner.MostInner;\n" +
7014
			"// valid import - no error in 5.0\n" +
7015
			"\n" +
7016
			"/** \n" +
7017
			" * {@link MostInner}\n" +
7018
			" * \n" +
7019
			" */ \n" +
7020
			"public class Valid1 { \n" +
7021
			"	/** \n" +
7022
			"	 * {@link MostInner} \n" +
7023
			"	 * \n" +
7024
			"	 */ \n" +
7025
			"      void m() { } \n" +
7026
			"}\n"
7027
			,
7028
			"pkg2/Valid2.java",
7029
			"package pkg2; \n" +
7030
			"import mainpkg.Outer.Inner.*;\n" +
7031
			"//valid import - no error in 5.0\n" +
7032
			"\n" +
7033
			"/** \n" +
7034
			" * {@link MostInner}\n" +
7035
			" * \n" +
7036
			" */ \n" +
7037
			"public class Valid2 { \n" +
7038
			"      void m() { } \n" +
7039
			"}\n"
7040
			,
7041
			"pkg3/Invalid3.java",
7042
			"package pkg3; \n" +
7043
			"import mainpkg.Outer.*;\n" +
7044
			"//invalid import: expecting warning / error\n" +
7045
			"\n" +
7046
			"/** \n" +
7047
			" * {@link MostInner} -- error/warning  \n" +
7048
			" * \n" +
7049
			" */ \n" +
7050
			"public class Invalid3 { \n" +
7051
			"      void m() { } \n" +
7052
			"}\n"
7000
	};
7053
	};
7001
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7054
7002
	runConformTest(true, units,
7055
	String error14 = new String(
7056
			//pkg1\Valid1.java:12: warning - Tag @link: reference not found: MostInner
7057
			//pkg1\Valid1.java:17: warning - Tag @link: reference not found: MostInner
7058
			//pkg2\Valid2.java:12: warning - Tag @link: reference not found: MostInner
7059
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
7003
			"----------\n" +
7060
			"----------\n" +
7004
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7061
			"1. ERROR in pkg1\\Valid1.java (at line 6)\n" +
7005
			"	* @see http://www.eclipse.org/\n" +
7062
			"	* {@link MostInner}\n" +
7006
			"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
7063
			"	         ^^^^^^^^^\n" +
7007
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
7064
			"Javadoc: Invalid member type qualification\n" +
7008
			"----------\n",
7065
			"----------\n" +
7009
			null, null,
7066
			"2. ERROR in pkg1\\Valid1.java (at line 11)\n" +
7010
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7067
			"	* {@link MostInner} \n" +
7011
}
7068
			"	         ^^^^^^^^^\n" +
7069
			"Javadoc: Invalid member type qualification\n" +
7070
			"----------\n" +
7071
			"----------\n" +
7072
			"1. ERROR in pkg2\\Valid2.java (at line 6)\n" +
7073
			"	* {@link MostInner}\n" +
7074
			"	         ^^^^^^^^^\n" +
7075
			"Javadoc: Invalid member type qualification\n" +
7076
			"----------\n" +
7077
			"----------\n" +
7078
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
7079
			"	* {@link MostInner} -- error/warning  \n" +
7080
			"	         ^^^^^^^^^\n" +
7081
			"Javadoc: MostInner cannot be resolved to a type\n" +
7082
	"----------\n");
7012
7083
7013
public void testBug168849b() {
7084
	String error50 = new String(
7014
	String[] units = new String[] {
7085
			//pkg3\Invalid3.java:12: warning - Tag @link: reference not found: MostInner
7015
		"pkg/X.java",
7016
		"package pkg;\n" +
7017
		"\n" +
7018
		"public class X {\n" +
7019
		"	/**\n" +
7020
		"	 * @see http://ftp.eclipse.org/\n" +
7021
		"	 */\n" +
7022
		"	public void foo() { \n" +
7023
		"	 \n" +
7024
		"	}\n" +
7025
		"}\n"
7026
	};
7027
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7028
	runConformTest(true, units,
7029
			"----------\n" +
7086
			"----------\n" +
7030
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7087
			"1. ERROR in pkg3\\Invalid3.java (at line 6)\n" +
7031
			"	* @see http://ftp.eclipse.org/\n" +
7088
			"	* {@link MostInner} -- error/warning  \n" +
7032
			"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
7089
			"	         ^^^^^^^^^\n" +
7033
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
7090
			"Javadoc: MostInner cannot be resolved to a type\n" +
7034
			"----------\n",
7091
			"----------\n");
7035
			null, null,
7092
7036
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7093
	this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
7094
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
7095
		runNegativeTest(units,error14);
7096
	}
7097
	else {
7098
		runNegativeTest(units,error50, JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
7099
	}
7037
}
7100
}
7038
7101
7039
public void testBug168849c() {
7102
/**
7103
 * @bug 177009: [javadoc] Missing Javadoc tag not reported
7104
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=177009"
7105
 */
7106
public void testBug177009a() {
7040
	String[] units = new String[] {
7107
	String[] units = new String[] {
7041
		"pkg/X.java",
7108
		"pkg/X.java",
7042
		"package pkg;\n" +
7109
		"package pkg;\n" +
7043
		"\n" +
7110
		"\n" +
7044
		"public class X {\n" +
7111
		"public class X {\n" +
7112
		"	public X(String str, int anInt) {\n" +
7113
		"	}\n" +
7114
		"}\n",
7115
		"pkg/Y.java",
7116
		"package pkg;\n" +
7117
		"\n" +
7118
		"public class Y extends X {\n" +
7119
		"	private static int myInt = 0;\n" +
7045
		"	/**\n" +
7120
		"	/**\n" +
7046
		"	 * @see ://\n" +
7121
		"	 * @see X#X(String, int)\n" + // case1 potential AIOOBE
7047
		"	 */\n" +
7122
		"	 */\n" +
7048
		"	public void foo() { \n" +
7123
		"	public Y(String str) {\n" +
7049
		"	 \n" +
7124
		"		super(str, myInt);\n" +
7050
		"	}\n" +
7125
		"	}\n" +
7051
		"}\n"
7126
		"}\n"
7052
	};
7127
	};
7053
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7128
	this.reportMissingJavadocTags = CompilerOptions.WARNING;
7054
	runConformTest(
7129
	runConformTest(
7055
			true, units,
7130
			true,
7131
			units,
7056
			"----------\n" +
7132
			"----------\n" +
7057
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7133
			"1. WARNING in pkg\\Y.java (at line 8)\n" +
7058
			"	* @see ://\n" +
7134
			"	public Y(String str) {\n" +
7059
			"	   ^^^\n" +
7135
			"	                ^^^\n" +
7060
			"Javadoc: Missing reference\n" +
7136
			"Javadoc: Missing tag for parameter str\n" +
7061
			"----------\n",
7137
			"----------\n",
7062
			null, null,
7138
			null, null,
7063
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7139
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7064
}
7140
}
7065
7141
7066
public void testBug168849d() {
7142
public void testBug177009b() {
7067
	String[] units = new String[] {
7143
	String[] units = new String[] {
7068
		"pkg/X.java",
7144
		"pkg/X.java",
7069
		"package pkg;\n" +
7145
		"package pkg;\n" +
7070
		"\n" +
7146
		"\n" +
7071
		"public class X {\n" +
7147
		"public class X {\n" +
7148
		"	public X(String str, int anInt) {\n" +
7149
		"	}\n" +
7150
		"}\n",
7151
		"pkg/Y.java",
7152
		"package pkg;\n" +
7153
		"\n" +
7154
		"public class Y extends X {\n" +
7072
		"	/**\n" +
7155
		"	/**\n" +
7073
		"	 * @see http\u003A\u002F\u002Fwww.eclipse.org\n" +
7156
		"	 * @param str\n" +
7157
		"	 * @param anInt\n" +
7158
		"	 * @see X#X(String, int)\n" + // case2 find super ref
7074
		"	 */\n" +
7159
		"	 */\n" +
7075
		"	public void foo() { \n" +
7160
		"	public Y(String str, int anInt, int anotherInt) {\n" +
7076
		"	 \n" +
7161
		"		super(str, anInt);\n" +
7077
		"	}\n" +
7162
		"	}\n" +
7078
		"}\n"
7163
		"}\n"
7079
	};
7164
	};
7080
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7165
	this.reportMissingJavadocTags = CompilerOptions.WARNING;
7081
	runConformTest(true, units,
7166
	runConformTest(true, units,
7082
			"----------\n" +
7167
			"----------\n" +
7083
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7168
			"1. WARNING in pkg\\Y.java (at line 9)\n" +
7084
			"	* @see http://www.eclipse.org\n" +
7169
			"	public Y(String str, int anInt, int anotherInt) {\n" +
7085
			"	       ^^^^^^^^^^^^^^^^^^^^^^\n" +
7170
			"	                                    ^^^^^^^^^^\n" +
7086
			"Javadoc: Invalid URL reference. Double quote the reference or use the href syntax\n" +
7171
			"Javadoc: Missing tag for parameter anotherInt\n" +
7087
			"----------\n",
7172
			"----------\n",
7088
			null, null,
7173
			null, null,
7089
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7174
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7090
}
7175
}
7091
7176
7092
public void testBug168849e() {
7177
/**
7093
	String[] units = new String[] {
7178
 * @bug 190970: [javadoc] "field never read locally" analysis should not consider javadoc
7094
		"pkg/X.java",
7179
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=190970"
7095
		"package pkg;\n" +
7180
 */
7096
		"\n" +
7181
public void testBug190970a() {
7097
		"public class X {\n" +
7182
	Map customOptions = getCompilerOptions();
7098
		"	/**\n" +
7183
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
7099
		"	 * @see \"http\u003A\u002F\u002Fwww.eclipse.org\"\n" +
7184
	this.runConformTest(
7100
		"	 */\n" +
7185
		true,
7101
		"	public void foo() { \n" +
7186
		new String[] {
7102
		"	 \n" +
7187
			"pkg/X.java",
7103
		"	}\n" +
7188
			"public class X {\n" +
7104
		"}\n"
7189
			"private int unused1;\n" +
7105
	};
7190
			"\n" +
7106
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7191
	        "/**\n" +
7107
	runConformTest(units);
7192
	        " * Same value as {@link #unused1}\n" +
7193
	        " */\n" +
7194
	        "private int unused2;\n" +
7195
			"}\n",
7196
		},
7197
		null,
7198
		customOptions,
7199
		"----------\n" +
7200
		"1. WARNING in pkg\\X.java (at line 2)\n" +
7201
		"	private int unused1;\n" +
7202
		"	            ^^^^^^^\n" +
7203
		"The field X.unused1 is never read locally\n" +
7204
		"----------\n" +
7205
		"2. WARNING in pkg\\X.java (at line 7)\n" +
7206
		"	private int unused2;\n" +
7207
		"	            ^^^^^^^\n" +
7208
		"The field X.unused2 is never read locally\n" +
7209
		"----------\n",
7210
		null, null,
7211
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
7212
	);
7213
}
7214
// test unused methods
7215
public void testBug190970b() {
7216
	Map customOptions = getCompilerOptions();
7217
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
7218
	this.runConformTest(
7219
		true,
7220
		new String[] {
7221
			"pkg/X.java",
7222
			"package pkg;\n" +
7223
			"\n" +
7224
			"public class X {\n" +
7225
			"private void unused1() {}\n" +
7226
			"/**\n" +
7227
			" * Same value as {@link #unused1()}\n" +
7228
			" */\n" +
7229
			"private void unused2() {}\n" +
7230
			"}\n",
7231
		},
7232
		null,
7233
		customOptions,
7234
		"----------\n" +
7235
		"1. WARNING in pkg\\X.java (at line 4)\n" +
7236
		"	private void unused1() {}\n" +
7237
		"	             ^^^^^^^^^\n" +
7238
		"The method unused1() from the type X is never used locally\n" +
7239
		"----------\n" +
7240
		"2. WARNING in pkg\\X.java (at line 8)\n" +
7241
		"	private void unused2() {}\n" +
7242
		"	             ^^^^^^^^^\n" +
7243
		"The method unused2() from the type X is never used locally\n" +
7244
		"----------\n",
7245
		null, null,
7246
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
7247
	);
7248
}
7249
// test unused types
7250
public void testBug190970c() {
7251
	Map customOptions = getCompilerOptions();
7252
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
7253
	runConformTest(
7254
		true,
7255
	new String[] {
7256
		"pkg/X.java",
7257
		"package pkg;\n" +
7258
		"\n" +
7259
		"public class X {\n" +
7260
		"private class unused1 {}\n" +
7261
		"/**\n" +
7262
		" * {@link X.unused1}\n" +
7263
		" */\n" +
7264
		"private class unused2 {}\n" +
7265
		"}\n",
7266
	},
7267
	null,
7268
	customOptions,
7269
	"----------\n" +
7270
	"1. WARNING in pkg\\X.java (at line 4)\n" +
7271
	"	private class unused1 {}\n" +
7272
	"	              ^^^^^^^\n" +
7273
	"The type X.unused1 is never used locally\n" +
7274
	"----------\n" +
7275
	"2. WARNING in pkg\\X.java (at line 8)\n" +
7276
	"	private class unused2 {}\n" +
7277
	"	              ^^^^^^^\n" +
7278
	"The type X.unused2 is never used locally\n" +
7279
	"----------\n",
7280
	null, null,
7281
	JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings
7282
	);
7283
}
7284
7285
//	static { TESTS_PREFIX = "testBug191322"; }
7286
/**
7287
 * @bug 191322: [javadoc] @see or @link reference to method without signature fails to resolve to base class method
7288
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=191322"
7289
 */
7290
public void testBug191322() {
7291
	runConformTest(
7292
		new String[] {
7293
			"X.java",
7294
			"public class X {\n" +
7295
			"	void foo() {}\n" +
7296
			"	/**\n" +
7297
			"	 * {@link #foo}.\n" +
7298
			"	 * @see #foo\n" +
7299
			"	 */\n" +
7300
			"	void goo() {}\n" +
7301
			"}\n",
7302
			"Y.java",
7303
			"class Y extends X {\n" +
7304
			"	/**\n" +
7305
			"	 * {@link #foo}\n" +
7306
			"	 * @see #foo\n" +
7307
			"	 */\n" +
7308
			"	void hoo() {}\n" +
7309
			"}"
7310
		}
7311
	);
7312
}
7313
public void testBug191322b() {
7314
	runConformTest(
7315
		new String[] {
7316
			"b/X.java",
7317
			"package b;\n" +
7318
			"public class X {\n" +
7319
			"	void foo() {}\n" +
7320
			"}\n" +
7321
			"class Y extends X {}\n" +
7322
			"class W extends Y {}\n" +
7323
			"class Z extends W {\n" +
7324
			"	/**\n" +
7325
			"	 * {@link #foo}\n" +
7326
			"	 * @see #foo\n" +
7327
			"	 */\n" +
7328
			"	void hoo() {}\n" +
7329
			"}\n"
7330
		}
7331
	);
7332
}
7333
public void testBug191322c() {
7334
	runConformTest(
7335
		new String[] {
7336
			"c/X.java",
7337
			"package c;\n" +
7338
			"public interface X {\n" +
7339
			"	void foo();\n" +
7340
			"}\n" +
7341
			"interface Y extends X {\n" +
7342
			"	/**\n" +
7343
			"	 * {@link #foo}\n" +
7344
			"	 * @see #foo\n" +
7345
			"	 */\n" +
7346
			"	void hoo();\n" +
7347
			"}\n"
7348
		}
7349
	);
7350
}
7351
public void testBug191322d() {
7352
	runConformTest(
7353
		new String[] {
7354
			"d/X.java",
7355
			"package d;\n" +
7356
			"public interface X {\n" +
7357
			"	void foo();\n" +
7358
			"}\n" +
7359
			"interface Y extends X {}\n" +
7360
			"abstract class W implements Y {}\n" +
7361
			"abstract class Z extends W {\n" +
7362
			"	/**\n" +
7363
			"	 * {@link #foo}\n" +
7364
			"	 * @see #foo\n" +
7365
			"	 */\n" +
7366
			"	void hoo() {}\n" +
7367
			"}\n"
7368
		}
7369
	);
7370
}
7371
public void testBug191322e() {
7372
	runConformTest(
7373
		new String[] {
7374
			"e/X.java",
7375
			"package e;\n" +
7376
			"public class X {\n" +
7377
			"	void foo() {}\n" +
7378
			"	class Y {\n" +
7379
			"		/**\n" +
7380
			"		 * {@link #foo}\n" +
7381
			"		 * @see #foo\n" +
7382
			"		 */\n" +
7383
			"		void hoo() {}\n" +
7384
			"	}\n" +
7385
			"}\n"
7386
		}
7387
	);
7108
}
7388
}
7109
7389
public void testBug191322f() {
7110
public void testBug168849f() {
7390
	runConformTest(
7111
	String[] units = new String[] {
7391
		new String[] {
7112
		"pkg/X.java",
7392
			"f/X.java",
7113
		"package pkg;\n" +
7393
			"package f;\n" +
7114
		"\n" +
7394
			"public class X {\n" +
7115
		"public class X {\n" +
7395
			"	void foo() {}\n" +
7116
		"	/**\n" +
7396
			"	void foo(String str) {}\n" +
7117
		"	 * @see \"http://www.eclipse.org/\"\n" +
7397
			"}\n" +
7118
		"	 */\n" +
7398
			"class Y extends X {\n" +
7119
		"	public void foo() { \n" +
7399
			"	/**\n" +
7120
		"	 \n" +
7400
			"	 * {@link #foo}\n" +
7121
		"	}\n" +
7401
			"	 * @see #foo\n" +
7122
		"}\n"
7402
			"	 */\n" +
7123
	};
7403
			"	void hoo() {}\n" +
7124
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7404
			"}\n"
7125
	runConformTest(units);
7405
		}
7406
	);
7126
}
7407
}
7127
7408
public void testBug191322g() {
7128
public void testBug168849g() {
7409
	runConformTest(
7129
	String[] units = new String[] {
7410
		new String[] {
7130
		"pkg/X.java",
7411
			"g/X.java",
7131
		"package pkg;\n" +
7412
			"package g;\n" +
7132
		"\n" +
7413
			"public class X {\n" +
7133
		"public class X {\n" +
7414
			"	void foo(String str) {}\n" +
7134
		"	/**\n" +
7415
			"	void foo(int x) {}\n" +
7135
		"	 * @see http:/ invalid reference\n" +
7416
			"}\n" +
7136
		"	 */\n" +
7417
			"class Y extends X {\n" +
7137
		"	public void foo() { \n" +
7418
			"	/**\n" +
7138
		"	 \n" +
7419
			"	 * {@link #foo}\n" +
7139
		"	}\n" +
7420
			"	 * @see #foo\n" +
7140
		"}\n"
7421
			"	 */\n" +
7141
	};
7422
			"	void hoo() {}\n" +
7142
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7423
			"}\n"
7143
	runConformTest(true, units,
7424
		}
7144
			"----------\n" +
7425
	);
7145
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7146
			"	* @see http:/ invalid reference\n" +
7147
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7148
			"Javadoc: Malformed reference (missing end space separator)\n" +
7149
			"----------\n",
7150
			null, null,
7151
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7152
}
7426
}
7153
7427
public void testBug191322h() {
7154
public void testBug168849h() {
7428
	runConformTest(
7155
	String[] units = new String[] {
7429
		new String[] {
7156
		"pkg/X.java",
7430
			"h/X.java",
7157
		"package pkg;\n" +
7431
			"package h;\n" +
7158
		"\n" +
7432
			"public class X {\n" +
7159
		"public class X {\n" +
7433
			"	void foo(String str) {}\n" +
7160
		"	/**\n" +
7434
			"}\n" +
7161
		"	 * @see Object:/ invalid reference\n" +
7435
			"class Y extends X {\n" +
7162
		"	 */\n" +
7436
			"	/**\n" +
7163
		"	public void foo() { \n" +
7437
			"	 * {@link #foo}\n" +
7164
		"	 \n" +
7438
			"	 * @see #foo\n" +
7165
		"	}\n" +
7439
			"	 */\n" +
7166
		"}\n"
7440
			"	void hoo() {}\n" +
7167
	};
7441
			"}\n"
7168
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7442
		}
7169
	runConformTest(true, units,
7443
	);
7170
			"----------\n" +
7171
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7172
			"	* @see Object:/ invalid reference\n" +
7173
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7174
			"Javadoc: Malformed reference (missing end space separator)\n" +
7175
			"----------\n",
7176
			null, null,
7177
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7178
}
7444
}
7179
7445
public void testBug191322i() {
7180
public void testBug168849i() {
7446
	runConformTest(
7181
	String[] units = new String[] {
7447
		new String[] {
7182
		"pkg/X.java",
7448
			"i/X.java",
7183
		"package pkg;\n" +
7449
			"package i;\n" +
7184
		"\n" +
7450
			"interface X {\n" +
7185
		"public class X {\n" +
7451
			"	void foo();\n" +
7186
		"	/**\n" +
7452
			"}\n" +
7187
		"	 * @see http\u003A\u002F invalid reference\n" +
7453
			"interface Y {\n" +
7188
		"	 */\n" +
7454
			"	void foo(int i);\n" +
7189
		"	public void foo() { \n" +
7455
			"}\n" +
7190
		"	 \n" +
7456
			"abstract class Z implements X, Y {\n" +
7191
		"	}\n" +
7457
			"	/**\n" +
7192
		"}\n"
7458
			"	 * @see #foo\n" +
7193
	};
7459
			"	 */\n" +
7194
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7460
			"	void bar() {\n" +
7195
	runConformTest(true, units,
7461
			"	}\n" +
7196
			"----------\n" +
7462
			"}"
7197
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7463
		}
7198
			"	* @see http:/ invalid reference\n" +
7464
	);
7199
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7200
			"Javadoc: Malformed reference (missing end space separator)\n" +
7201
			"----------\n",
7202
			null, null,
7203
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7204
}
7465
}
7205
7466
7206
public void testBug168849j() {
7467
/**
7468
 * @bug 195374: [javadoc] Missing Javadoc warning for required qualification for inner types at 1.4 level
7469
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=195374"
7470
 */
7471
public void testBug195374() {
7207
	String[] units = new String[] {
7472
	String[] units = new String[] {
7208
		"pkg/X.java",
7473
		"X.java",
7209
		"package pkg;\n" +
7210
		"\n" +
7211
		"public class X {\n" +
7474
		"public class X {\n" +
7212
		"	/**\n" +
7475
		"	public static class Param {\n" +
7213
		"	 * @see Object\u003A\u002F invalid reference\n" +
7476
	    "       /**\n" +
7214
		"	 */\n" +
7477
	    "         * warning expected when compliance < 1.5 {@link X#setParams(Param[])}\n" +
7215
		"	public void foo() { \n" +
7478
	    "         * no warning expected {@link X#setParams(X.Param[])}\n" +
7216
		"	 \n" +
7479
	    "         */\n" +
7217
		"	}\n" +
7480
	    "        public int getIndex() {\n" +
7481
	    "                    return 0;\n" +
7482
	    "        }\n" +
7483
	    "    }\n" +
7484
	    "    public void setParams(Param[] params) {\n" +
7485
	    "	}\n" +
7218
		"}\n"
7486
		"}\n"
7219
	};
7487
	};
7220
	this.reportInvalidJavadoc = CompilerOptions.WARNING;
7488
7221
	runConformTest(true, units,
7489
	String error14 = new String(
7222
			"----------\n" +
7490
		// warning - Tag @link: can't find setParams(Param[]) in X
7223
			"1. WARNING in pkg\\X.java (at line 5)\n" +
7491
		"----------\n" +
7224
			"	* @see Object:/ invalid reference\n" +
7492
		"1. ERROR in X.java (at line 4)\n" +
7225
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7493
		"	* warning expected when compliance < 1.5 {@link X#setParams(Param[])}\n" +
7226
			"Javadoc: Malformed reference (missing end space separator)\n" +
7494
		"	                                                            ^^^^^^^\n" +
7227
			"----------\n",
7495
		"Javadoc: Invalid member type qualification\n" +
7228
			null, null,
7496
		"----------\n");
7229
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
7497
	this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
7498
	if (this.complianceLevel <= ClassFileConstants.JDK1_4) {
7499
		runNegativeTest(units,error14);
7500
	}
7501
	else {
7502
		runConformTest(units);
7503
	}
7230
}
7504
}
7231
7505
7232
/**
7506
/**

Return to bug 170637