Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support certain Java libraries compiled on JDK 21 #10675

Merged
merged 2 commits into from Jan 26, 2024

Conversation

SethTisue
Copy link
Member

@SethTisue SethTisue commented Jan 25, 2024

This makes certain Java libraries compiled using Java 21 usable from Scala — libraries that use switch in a certain way.

The fix is to our classfile reader, to recognize CONSTANT_Dynamic when it appears in the constant pool.

Fixes scala/bug#12936

Implementation notes

Previous PR in this vein, for comparison: #8289

I verified that partest test/files/pos/t12396 was failing locally on JDK 21 but now passes.

PR validation runs on Java 8, so it will not run the test, but it will run at https://github.com/scala/scala/actions after the PR is merged; our GitHub Actions config has java: [8, 11, 17, 21]

@SethTisue SethTisue added the prio:blocker release blocker (used only by core team, only near release time) label Jan 25, 2024
@SethTisue SethTisue added this to the 2.12.19 milestone Jan 25, 2024
@SethTisue SethTisue self-assigned this Jan 25, 2024
@SethTisue SethTisue changed the title Classfile reader: allow CONSTANT_Dynamic in constant pool Classfile reader: allow CONSTANT_Dynamic in constant pool Jan 25, 2024
@SethTisue SethTisue requested a review from lrytz January 25, 2024 23:42
@som-snytt
Copy link
Contributor

I thought the guy who does those forward merges to 2.13 would get around to it eventually.

Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍
Added a test that will notify us on the next asm upgrade that introduces a new constant.

@lrytz lrytz enabled auto-merge January 26, 2024 08:03
@lrytz lrytz merged commit afbad90 into scala:2.12.x Jan 26, 2024
2 of 4 checks passed
@SethTisue SethTisue deleted the issue-12936 branch January 26, 2024 13:00
SethTisue added a commit to SethTisue/dotty that referenced this pull request Jan 26, 2024
SethTisue added a commit to SethTisue/dotty that referenced this pull request Jan 26, 2024
forward-port of scala/scala#10675 and scala/scala#8595
references scala/bug#12396 and scala/bug#11635
fixes scala#19527 ("bad constant pool tag 17")
also fixes unreported potential "bad constant pool tag 19" and
"bad constant pool tag 20" errors
SethTisue added a commit to scala/scala3 that referenced this pull request Jan 30, 2024
forward-port of scala/scala#10675 and scala/scala#8595
references scala/bug#12396 and scala/bug#11635
fixes #19527 ("bad constant pool tag 17")
also fixes unreported potential "bad constant pool tag 19" and "bad constant pool tag 20" errors
@SethTisue SethTisue added release-notes worth highlighting in next release notes and removed prio:blocker release blocker (used only by core team, only near release time) labels Feb 6, 2024
@SethTisue SethTisue changed the title Classfile reader: allow CONSTANT_Dynamic in constant pool Support certain Java libraries compiled on JDK 21 Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
3 participants