Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 232790

Summary: [misc] @inheritDoc tag does not inherit doc anymore
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.4Flags: markus.kell.r: review+
benno.baumgartner: review+
Target Milestone: 3.4 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix 2 none

Description Benno Baumgartner CLA 2008-05-19 09:25:59 EDT
I20080516-1333

Given:
package test;
public class E02 {
	/**
	 * My comment
	 */
	public void foo() {}
}

package test;
public class E01 extends E02 {
	/**
	 * {@inheritDoc}
	 */
	public void foo() {
	}
}

1. Hover over foo in E02
Is:
 Javadoc hover shows @inheritDoc as a link
Should:
 Show 'My comment'

This is a regression against 3.3.2 and was probably introduced by fix for bug 232293
Comment 1 Dani Megert CLA 2008-05-19 09:42:22 EDT
>1. Hover over foo in E02
Typo: should be: 1. Hover over foo in E01
Comment 2 Dani Megert CLA 2008-05-20 02:57:30 EDT
Created attachment 101009 [details]
Fix

The fix also improves performance as it doesn't mess around with the AST if not needed.
Comment 3 Dani Megert CLA 2008-05-20 02:58:44 EDT
Markus and Benno, please approve for RC2 and review the fix.
Comment 4 Markus Keller CLA 2008-05-20 09:20:50 EDT
Created attachment 101034 [details]
Fix 2

I don't like the complex state machine. Could we replace it with a simple regular expression? The only non-straightforward part in this patch is the workaround for bug 232944 at the end.
Comment 5 Benno Baumgartner CLA 2008-05-21 05:14:49 EDT
Although Markus patch is much more elegant (sorry Dani;-) I'm in favor of Danis patch: Regex patterns are difficult to comprehend (at least for me this pattern is not trivial) and therefore hard to maintain (i.e. TemplateTranslator). But it's a though call, Markus patch is pretty much a one liner...

In Danis patch I would change line 234 'state= 5;' to 'return true;'
Comment 6 Dani Megert CLA 2008-05-21 06:00:43 EDT
Markus, I agree with Benno regarding the regex. Please review the original patch.
Comment 7 Markus Keller CLA 2008-05-21 06:14:58 EDT
(In reply to comment #2)
- Typo: Javdoc
- The Assert.isLegal(..) is unnecessary (would get an NPE anyway). But if you keep it, please import Assert.

> In Danis patch I would change line 234 'state= 5;' to 'return true;'
+1, but the patch also works without this change.
Comment 8 Dani Megert CLA 2008-05-21 06:27:51 EDT
>- Typo: Javdoc
>- The Assert.isLegal(..) is unnecessary (would get an NPE anyway). But if you
Corrected. Also removed status 5.
Comment 9 Dani Megert CLA 2008-05-21 10:56:03 EDT
Available in builds >= I20080521-2000.
Comment 10 Dani Megert CLA 2008-05-23 11:25:23 EDT
Verified in I20080523-0100.