scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

Scaladoc generates incorrect link to JDK API docs with `-release` option #12820

Open durban opened 11 months ago

durban commented 11 months ago

Reproduction steps

Scala version: 2.13.11 JDK version: 17.0.7 (OpenJDK) sbt version: 1.9.1

/** Example: [[java.util.concurrent.atomic.AtomicReference]]. */
class Example

build.sbt:

scalaVersion := "2.13.11"

scalacOptions ++= Seq("-release", "11")

Problem

The generated API documentation (with sbt doc) contains an incorrect (dead) link to the AtomicReference apidoc. The incorrect link is https://docs.oracle.com/en/java/javase/17/docs/api/java/util/concurrent/atomic/AtomicReference.html (there is a java.base missing). Also note that the version is 17, regardless of the -release 11 setting.

Without the -release setting, the generated link is correct: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/atomic/AtomicReference.html.

Originally I've opened an issue here, but it seems the problem is not sbt-plugin specific (probably not even sbt specific).