javadoc uses wrong URL for JDK 11 and 12

Description

Originally asked about in this ask.clojure.org question: https://ask.clojure.org/index.php/8422/clojure-javadoc-javadoc-fails-javadoc-classes-outside-module

The clojure.java.javadoc/javadoc function hard-codes the Java module name "java.base" in the URL it uses for JDK 11 and 12, so uses the wrong URL when creating a URL for any Java class outside of that Java module.

For example, if you evaluate:

(javadoc java.sql.Connection)

It tries to go to this non-existent URL: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/sql/Connection.html

rather than the correct URL obtained by replacing the incorrect module name "java.base" in that URL with the correct one "java.sql".

Approach: Use reflection to obtain the class's module (for jdk classes), and then use that to properly form the javadoc url. Still continues to work for pre-module (jdk 8) classes as well.

Patch: clj-2354-v3.patch

Prescreened by: Alex Miller

Environment

None

Status

Assignee

Unassigned

Reporter

Andy Fingerhut

Labels

None

Approval

Prescreened

Patch

Code and Test

Affects versions

Release 1.10.1
Release 1.10
Release 1.9

Priority

Minor