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

Add FunctionalInterface Annotation to most of the interfaces primarily used by Lambdas #19234

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Tombert
Copy link

@Tombert Tombert commented Mar 19, 2025

A lot of the Kafka Stream documentation makes liberal use of Java lambdas, which is fine. The FunctionalInterface annotation isn't strictly required for Java to do this, as Java will automatically coerce, however this breaks the lambda syntax in Clojure 1.12, as it needs the FunctionalInterface in order to coerce a Clojure function into a Java lambda.

As far as I can tell, there's no reason not to have the FunctionalInterface annotation in all the places that regularly use the lambda syntax, and this annotation would make it more clear, as well as make it easier to user in other JVM languages.

…y used for lambdas

A lot of the Kafka Stream documentation makes liberal use of Java
lambdas, which is fine. The FunctionalInterface annotation isn't
strictly required for Java to do this, as Java will automatically
coerce, however this breaks the lambda syntax in Clojure 1.12, as it
needs  the FunctionalInterface in order to coerce a Clojure function
into a Java lambda.

As far as I can tell, there's no reason *not* to have the
FunctionalInterface annotation in all the places that regularly use the
lambda syntax, and this annotation would make it more clear.
@github-actions github-actions bot added triage PRs from the community streams small Small PRs labels Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Small PRs streams triage PRs from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant