Skip to content

deprecate SAM macro#828

Merged
halotukozak merged 2 commits intomasterfrom
deprecate-sam-conversions
Apr 17, 2026
Merged

deprecate SAM macro#828
halotukozak merged 2 commits intomasterfrom
deprecate-sam-conversions

Conversation

@halotukozak
Copy link
Copy Markdown
Member

@halotukozak halotukozak commented Apr 13, 2026

Scala has native SAM conversion support since 2.11.x. One less macro to migrate

@halotukozak halotukozak requested a review from ddworak April 13, 2026 10:24
@halotukozak halotukozak self-assigned this Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 10:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR deprecates the Sam macro helper and migrates several Java/Guava interop helpers to rely on Scala’s native SAM conversions instead.

Changes:

  • Deprecated com.avsystem.commons.misc.Sam.
  • Replaced Sam[...] usages in Java/Guava interop helpers with native SAM-based lambdas.
  • Updated some imports while removing Sam references.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
core/src/main/scala/com/avsystem/commons/misc/Sam.scala Deprecates Sam to steer users toward native SAM conversion.
core/src/main/scala/com/avsystem/commons/jiop/JBasicUtils.scala Replaces Sam-based helpers with native SAM lambdas for Runnable/Callable/Comparator.
core/jvm/src/main/scala/com/avsystem/commons/jiop/JFunctionUtils.scala Replaces Sam-based conversions with explicit lambdas for java.util.function interfaces.
core/jvm/src/main/scala/com/avsystem/commons/jiop/GuavaInterop.scala Replaces Sam usage with native SAM lambdas for Guava functional interfaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/scala/com/avsystem/commons/misc/Sam.scala
Comment thread core/src/main/scala/com/avsystem/commons/jiop/JBasicUtils.scala
@halotukozak halotukozak merged commit ff1da17 into master Apr 17, 2026
9 checks passed
@halotukozak halotukozak deleted the deprecate-sam-conversions branch April 17, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants