netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

JavaDoc URL wrong

Open blakemcbride opened this issue 1 year ago • 4 comments

Apache NetBeans version

Apache NetBeans 15

What happened

I select "Show JavaDoc" for a java.time.ZonedDateTime object when using Java 17, but NetBeans went to the wrong URL. See the two images. The first shows where NetBeans is going. The second shows the correct path.

Thanks!

This is where NetBeans goes when I select "Show JavaDoc":

Pic1

This is where it should be going:

Pic2

How to reproduce

No response

Did this work correctly in an earlier version?

No / Don't know

Operating System

Fedora Linux

JDK

17

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

blakemcbride avatar Oct 07 '22 18:10 blakemcbride

Hmm. It seems to leave out the module in the path on your first screenshot. When I tried to replicate it it did work as intended though.

Are there any exceptions when this happens?

mbien avatar Oct 08 '22 20:10 mbien

reminds me of #4363 moduleNameFor() might not return a module for the class in question and if it returns null it assumes its a non-modular javadoc.

mbien avatar Oct 08 '22 20:10 mbien

I cannot reproduce this issue here with a standard Maven project. What's the nature of the project? It shouldn't usually fail for JDK classes, although as referenced in https://github.com/apache/netbeans/pull/4363#issuecomment-1181491931 it does for NetBeans' own source files.

moduleNameFor() has a known issue in that it relies on the class that has modular Javadoc being on the module path, not the class path, of the project. We could do with a more robust fix that introspects to find module info even if on the class path, and tries multiple URL's.

neilcsmith-net avatar Oct 11 '22 07:10 neilcsmith-net

Incidentally, this is related to / duplicates #4044

neilcsmith-net avatar Oct 11 '22 13:10 neilcsmith-net