Skip to content

Fix runtime reflection of empty package members under Java 9.#6097

Merged
adriaanm merged 1 commit intoscala:2.12.xfrom
retronym:ticket/sd304
Sep 27, 2017
Merged

Fix runtime reflection of empty package members under Java 9.#6097
adriaanm merged 1 commit intoscala:2.12.xfrom
retronym:ticket/sd304

Conversation

@retronym
Copy link
Member

@retronym retronym commented Sep 25, 2017

We used to rely on cls.getPackage == null for cls defined in the
empty package. Under Java 9, we actually get the empty package back
from that call.

This commit ensures we use the one true empty package symbol on
either Java 8 or 9.

Fixes scala/scala-dev#304

We used to rely on `cls.getPackage == null` for `cls` defined in the
empty package. Under Java 9, we actually get the empty package back
from that call.

This commit ensures we use the one true empty package symbol on
either Java 8 or 9.
@scala-jenkins scala-jenkins added this to the 2.12.5 milestone Sep 25, 2017
@retronym retronym modified the milestones: 2.12.5, 2.12.4 Sep 25, 2017
@retronym
Copy link
Member Author

@adriaanm Optimistically assigning to 2.12.4 as the fix is straight forward and it removes an impediment to Java 9 experimentation.

Unfortunately, without a backport, it won't help with the original bug report, which involves SBT hitting this problem in runtime reflection in Scala 2.10.

@retronym retronym changed the title Fix runtime refletion of empty package members under Java 9. Fix runtime reflection of empty package members under Java 9. Sep 25, 2017
@adriaanm adriaanm self-requested a review September 25, 2017 18:55
@adriaanm adriaanm added the prio:blocker release blocker (used only by core team, only near release time) label Sep 26, 2017
@adriaanm adriaanm merged commit ac4b652 into scala:2.12.x Sep 27, 2017
@SethTisue
Copy link
Member

ticket on having sbt move to 2.12.4 to get the fix: sbt/sbt#3587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prio:blocker release blocker (used only by core team, only near release time) release-notes worth highlighting in next release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants