Fix runtime reflection of empty package members under Java 9.#6097
Merged
adriaanm merged 1 commit intoscala:2.12.xfrom Sep 27, 2017
Merged
Fix runtime reflection of empty package members under Java 9.#6097adriaanm merged 1 commit intoscala:2.12.xfrom
adriaanm merged 1 commit intoscala:2.12.xfrom
Conversation
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.
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. |
adriaanm
approved these changes
Sep 25, 2017
Member
|
ticket on having sbt move to 2.12.4 to get the fix: sbt/sbt#3587 |
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We used to rely on
cls.getPackage == nullforclsdefined in theempty 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