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

Bug 211581

Summary: [implementation] Inherited Java doc not displayed if parent class is binary with attached javadoc and child class is available as source
Product: [Eclipse Project] JDT Reporter: Franco Mossotto <franco.mossotto>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r, martinae, philippe_mulet
Version: 3.3.1Flags: philippe_mulet: pmc_approved+
martinae: review+
Target Milestone: 3.3.2   
Hardware: PC   
OS: All   
Whiteboard:

Description Franco Mossotto CLA 2007-11-30 06:26:41 EST
Build ID: org.eclipse.jdt.ui

Steps To Reproduce:
1. Create a java class that overrides toString() without a new javadoc
2. Select toString() method in your class
3. View Javadoc view

Using a JRE library with attached source, the Object#toString() javadoc is displayed

Using a JRE library with no attached source, and with only the javadoc attached (e.g. "http://java.sun.com/j2se/1.5.0/docs/api/") the javadoc view is empty


More information:
When writing a child class that implements method of an interface or override a superclass method, if the child class method as no javadoc, the javadoc view usually display the javadoc of the parent class / interface.

This behavior doesn't work if the parent interface / class source is not available and the javadoc is just attached.

The problems seams to be in org.eclipse.jdt.internal.ui.text.java.ProposalInfo#getHTMLContentReader
the mothod basically
- first tries to create the javadoc from source navigating the class hierachy, but handling also for parent classes only the case when javadoc is get from the source.
- then, if the selected class has no source code, gets the javadoc from the attached javadoc.

The case when the selected class is source and the parent class containing the javadoc has no source is not handled.
Comment 1 Dani Megert CLA 2007-12-13 09:37:51 EST
Fixed in HEAD.
Available in builds > 3.4 M4.

Philippe, what do you think: should we put this into 3.3.2? It can be a problem when you only have libraries with Javadoc but no source.
Comment 2 Dani Megert CLA 2007-12-13 10:00:47 EST
Will port to 3.3.2 if approved.
Comment 3 Philipe Mulet CLA 2007-12-14 06:25:41 EST
Is this a regression or not ?
How risky is the fix ?
Comment 4 Dani Megert CLA 2007-12-14 07:21:32 EST
Not a regression. Fix is not risky.
Comment 5 Philipe Mulet CLA 2007-12-14 09:14:47 EST
+1 for 3.3.2
Comment 6 Martin Aeschlimann CLA 2007-12-14 09:32:19 EST
reviewed code.
Comment 7 Dani Megert CLA 2007-12-14 10:25:05 EST
Backported to R3_3_maintenance.
Comment 8 Markus Keller CLA 2008-01-24 12:17:43 EST
Verified in M20080123-0800. Filed bug 216477 since this is broken again in HEAD.