Javadoc in 9 seems to treat all interfaces with only one method as functional interfaces (original) (raw)

Paul Benedict pbenedict at apache.org
Thu Mar 20 20:34:03 UTC 2014


It's about design intent. The annotation conveys the intent and the compiler enforces it by ensuring one abstract method exists.

As you noted, there are such things as "implicit functional interfaces", but use them at your own risk. In theory, an interface not annotated with @FI can gain additional methods in the future, which would then break any implicit use you relied on.

Paul

On Thu, Mar 20, 2014 at 3:30 PM, Florian Weimer <fw at deneb.enyo.de> wrote:

* Paul Benedict:

> It's a bug because it was an early decision in JDK 8 that got changed: > http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-November/002379.html > > And then the change: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-January/024165.html So it's a functional interface, but the documentation doesn't say so because we don't want it to be a functional interface? That's rather odd and suggests that something went wrong with the design. :-)

-- Cheers, Paul



More information about the core-libs-dev mailing list