Javadoc (b116) lacks @FunctionalInterface on Observer signature

Joe Darcy joe.darcy at oracle.com
Thu Nov 21 19:43:16 PST 2013


On 11/21/2013 07:40 PM, Paul Benedict wrote:
> Look at, Closeable, as an example. You removed the 
> @FunctionalInterface annotation but the javadocs still report it as a 
> functional interface in the class description.
>
> http://download.java.net/jdk8/docs/api/java/io/Closeable.html

Yes, that is the correct and expected outcome.

The type java.io.Closeable meets the JLS definition of a functional 
interface and gets reported accordingly by javac. However, it is not 
morally a functional interface so it no longer has the 
@FunctionalInterface annotation, an annotation which indicates 
intentions towards usage and interface evolution.

-Joe


More information about the lambda-dev mailing list