Skip to content

API compatibility with lambda expressions [SPR-9640] #14274

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

Closed
spring-projects-issues opened this issue Jul 26, 2012 · 1 comment
Closed

API compatibility with lambda expressions [SPR-9640] #14274

spring-projects-issues opened this issue Jul 26, 2012 · 1 comment
Assignees
Labels
type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 26, 2012

Juergen Hoeller opened SPR-9640 and commented

http://openjdk.java.net/jeps/126

Consider marking all applicable Spring callback interfaces with Java 8's @FunctionalInterface. Even if that marker basically just works as a compiler assertion along the lines of @Override, it might still be worth using it consistently as a formal documentation measure. Applicable Spring interfaces can then by found by that marker and will be documented as such in javadoc.


This issue is a sub-task of #14273

0 votes, 6 watchers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

We're not adding @FunctionalInterface for the time being, since it would only buy us a documentation effect but introduces a risk for potential class loading issues on older JVMs. Even if, technically, a JVM should ignore a declared annotation if it cannot find the annotation type in the classpath, there may be unpleasant warnings or the like displayed on non-Sun/Oracle JVMs.

In all other respects, the obvious candidate interfaces in the core codebase are all naturally compliant with Java 8's rules. There are a few niche interfaces that declare more than one method (e.g. BatchPreparedStatementSetter) and a few base implementations of callback interfaces that declare a different abstract template method (e.g. AbstractLobStreamingResultSetExtractor); however, we're not considering those as important enough to split them into their own functional interface variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants