Skip to content

JDK 11 - Class sun.reflect.CallerSensitive not found - continuing with a stub. #11679

Closed
sbt/zinc
#701
@Sciss

Description

@Sciss

I am building a project with "-release", "8", compiling with sbt under OpenJDK 11. For both cross Scala versions 2.12.9 and 2.13.0, this fails at several places with errors like

[error] /home/hhrutz/Documents/devel/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/SynthGraphObj.scala:166:27: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error]           val companion = Class.forName(s"$className").getField("MODULE$").get(null)
[error]                           ^

or

[error] /home/hhrutz/Documents/devel/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/impl/MemoryClassLoader.scala:20:39: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error] final class MemoryClassLoader extends ClassLoader {
[error]                                       ^

Unfortunately it's not easy to isolate the code that breaks (I tried simple reductions but they don't crash the compiler). It's on a project that runs on multiple snapshot dependencies, so the heavy way to reproduce is

java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Debian-1deb10u1, mixed mode, sharing)

(i.e. use JDK 11)

git clone https://github.com/Sciss/Lucre.git
cd Lucre
git checkout -b debug 53c779f0edfbf6bf0fc8f276d946290c145d85e3
sbt update
sbt publishLocal
cd ..
git clone https://github.com/Sciss/LucreSwing.git
cd LucreSwing
git checkout -b debug e6b50892553e765a3e840ea68c4bf5e5e0879fd9
sbt update
sbt publishLocal
cd ..
git clone https://github.com/Sciss/SoundProcesses.git
cd SoundProcesses
git checkout -b debug f25d534f5f74b80c3cc52abbec5fcbbed3958e9d
sbt update
sbt compile

This should be reproducible and yield

[error] /data/temp/bla/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/SynthGraphObj.scala:166:27: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error]           val companion = Class.forName(className).getField("MODULE$").get(null)
[error]                           ^

Perhaps related to #10817 . The only place that CallerSensitive appears in seems to be https://github.com/scala/scala/blob/3027652cab884c88f5cc20f710e351a0730c5ba2/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala#L132

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions