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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (+63 lines)
Lines 7316-7321 Link Here
7316
		"----------\n"
7316
		"----------\n"
7317
	);
7317
	);
7318
}
7318
}
7319
7319
/**
7320
/**
7320
 * @bug 222902: [Javadoc] Missing description should not be warned in some cases
7321
 * @bug 222902: [Javadoc] Missing description should not be warned in some cases
7321
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222902"
7322
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222902"
Lines 7523-7526 Link Here
7523
		}
7524
		}
7524
	);
7525
	);
7525
}
7526
}
7527
7528
/**
7529
 * @bug 246712: [javadoc] Unexpected warning about missing parameter doc in case of @inheritDoc
7530
 * @test Ensure inline tag are considered as description
7531
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=246712"
7532
 */
7533
public void testBug246712() {
7534
	runConformTest(
7535
		new String[] {
7536
			"src/X.java",
7537
			"public class X {\n" + 
7538
			"\n" + 
7539
			"	/**\n" + 
7540
			"	 * Do something more.\n" + 
7541
			"	 * \n" + 
7542
			"	 * @param monitor The monitor\n" + 
7543
			"	 * @return {@link String X}\n" + 
7544
			"	 */\n" + 
7545
			"	String foo(Object monitor) {\n" + 
7546
			"		return \"X\";\n" + 
7547
			"	}\n" + 
7548
			"}\n",
7549
			"src/Y.java",
7550
			"public class Y extends X {\n" + 
7551
			"\n" + 
7552
			"	/**\n" + 
7553
			"	 * Do something more.\n" + 
7554
			"	 * \n" + 
7555
			"	 * {@inheritDoc}\n" + 
7556
			"	 * \n" + 
7557
			"	 * @param monitor {@inheritDoc}\n" + 
7558
			"	 * @return {@link String Y}\n" + 
7559
			"	 */\n" + 
7560
			"	String foo(Object monitor) {\n" + 
7561
			"		return \"Y\";\n" + 
7562
			"	}\n" + 
7563
			"}\n"
7564
		}
7565
	);
7566
}
7567
// duplicate
7568
public void testBug246715() {
7569
	runConformTest(
7570
		new String[] {
7571
			"src/X.java",
7572
			"public class X {\n" + 
7573
			"\n" + 
7574
			"	final static int WAIT_YES = 0;\n" + 
7575
			"	final static int WAIT_NO = 1;\n" + 
7576
			"	\n" + 
7577
			"	/**\n" + 
7578
			"	 * Do something more.\n" + 
7579
			"	 * \n" + 
7580
			"	 * @param waitFlag {@link #WAIT_YES} or {@link #WAIT_NO}\n" + 
7581
			"	 */\n" + 
7582
			"	String foo(int waitFlag) {\n" + 
7583
			"		return \"X\";\n" + 
7584
			"	}\n" + 
7585
			"}\n"
7586
		}
7587
	);
7588
}
7526
}
7589
}
(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-6 / +10 lines)
Lines 411-419 Link Here
411
		switch (this.tagWaitingForDescription) {
411
		switch (this.tagWaitingForDescription) {
412
			case TAG_PARAM_VALUE:
412
			case TAG_PARAM_VALUE:
413
			case TAG_THROWS_VALUE:
413
			case TAG_THROWS_VALUE:
414
				int start = (int) (this.identifierPositionStack[0] >>> 32);
414
				if (!this.inlineTagStarted) { // if an inline tag is started, then consider it as the expected description...
415
				int end = (int) this.identifierPositionStack[this.identifierPtr];
415
					int start = (int) (this.identifierPositionStack[0] >>> 32);
416
				this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers);
416
					int end = (int) this.identifierPositionStack[this.identifierPtr];
417
					this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers);
418
				}
417
				break;
419
				break;
418
			case NO_TAG_VALUE:
420
			case NO_TAG_VALUE:
419
				break;
421
				break;
Lines 837-845 Link Here
837
		switch (this.tagWaitingForDescription) {
839
		switch (this.tagWaitingForDescription) {
838
			case TAG_PARAM_VALUE:
840
			case TAG_PARAM_VALUE:
839
			case TAG_THROWS_VALUE:
841
			case TAG_THROWS_VALUE:
840
				int start = (int) (this.identifierPositionStack[0] >>> 32);
842
				if (!this.inlineTagStarted) { // if an inline tag is started, then consider it as the expected description...
841
				int end = (int) this.identifierPositionStack[this.identifierPtr];
843
					int start = (int) (this.identifierPositionStack[0] >>> 32);
842
				this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers);
844
					int end = (int) this.identifierPositionStack[this.identifierPtr];
845
					this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers);
846
				}
843
				break;
847
				break;
844
			case NO_TAG_VALUE:
848
			case NO_TAG_VALUE:
845
				break;
849
				break;

Return to bug 246712