Bug 549029 - Attached Javadoc 11 API document is not displayed
Summary: Attached Javadoc 11 API document is not displayed
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.13   Edit
Hardware: PC Mac OS X
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-06 20:46 EDT by Shinji Kashihara CLA
Modified: 2023-08-24 01:08 EDT (History)
5 users (show)

See Also:


Attachments
Javadoc could not be found int the attached Javadoc (17.68 KB, image/png)
2019-07-06 20:46 EDT, Shinji Kashihara CLA
no flags Details
JRE Definition (45.18 KB, image/png)
2019-07-06 20:47 EDT, Shinji Kashihara CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shinji Kashihara CLA 2019-07-06 20:46:42 EDT
Created attachment 279184 [details]
Javadoc could not be found int the attached Javadoc

I want to display Japanese Javadoc API documentation, so I removed the source attachment and specified the external Japanese Javadoc API documentation URL.

jre_definition.png
en: https://docs.oracle.com/en/java/javase/11/docs/api/
ja: http://docs.oracle.com/javase/jp/11/docs/api/


Unexpectedly, the hover on the editor displays "Javadoc could not be found int the attached Javadoc".
javadoc_hover.png
In Java 8 and earlier versions, this setting will display without problems.

Of course, in Java 11, if I specify src.zip for source attachment, it will be displayed without problems. However, I want to specify a Japanese Javadoc URL in order to display Japanese documents.
Comment 1 Shinji Kashihara CLA 2019-07-06 20:47:59 EDT
Created attachment 279185 [details]
JRE Definition
Comment 2 Shinji Kashihara CLA 2019-07-06 20:50:59 EDT
It looks like getAttachedJavadoc of  org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2 class is returning null.
Comment 3 Kris De Volder CLA 2020-03-27 14:31:24 EDT
Someone else reported the same problem to STS here:

https://github.com/spring-projects/sts4/issues/428

I should also mention that, as far as I can remember (many years), Eclipse seems to *only* extract javadoc from sources. 

I am not sure whether this is a bug or by design. Never thought too much about it to be honest as, since I usually want the sources anyways, this rarely affects me personally. 

However, whether by desing or not, users who report this 'bug' are rightfully confused. Given that it is *possible* to point Eclipse explicitly to JavaDoc attachements, it is at least an awkward design. I.e. why can we specify JavaDoc locations at all, if Eclipse doesn't ever use them?
Comment 4 Javier Reg CLA 2020-03-27 16:21:27 EDT
I'm the author of the ticket on STS bugtracker cited in the comment above.
I can confirm that even with standard localization Javadoc, Eclipse doesn't show anything in popup on hover nor in Javadoc view.

I tried pointing to Javadoc both system-wide (Window→Preference...) both per-project.

I tested with online docs URL, local URI and local archive. 
Everyone passes the validation and gets recognized and shown by internal browser, but popup and Javadoc View always return:

java.lang

Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.

Everything works if I attach source to the library.

Eclipse 4.15
OpenJdk 11.0.6.u10
Arch Linux
Comment 5 Javier Reg CLA 2020-03-27 17:20:10 EDT
Possible regression from
bug 41421
Comment 6 Eclipse Genie CLA 2023-02-11 07:22:33 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Artur Gonçalves CLA 2023-08-24 01:01:41 EDT
The bug still exists in version 2023-06 (4.28.0). The UI still presents a field where the Javadoc URL/path can be specified, but then this is not used anywhere, and the Javadoc view uses the comments pulled from sources instead (if they exist). This applies to all jars in a project's build path, not just JDKs.

The UI should at least be changed to make it clear that setting the Javadoc path does not actually do anything other than make the "Open attached Javadoc in a browser" button work. This is not the expected behavior. The ideal expected behavior would be for the HTML Javadoc to be parsed and shown in the Javadoc window (the yellow window in Eclipse).
Comment 8 Artur Gonçalves CLA 2023-08-24 01:08:56 EDT
Sorry for double-commenting, but I realized something.
Eclipse is in fact reading the HTML Javadoc from the given Javadoc JAR, for classes and for class methods, but is not reading constructors and interface methods. For these last two, all that the yellow Javadoc view shows is:

> Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.