JDK 8 code review request for 8005298 Add FunctionalInterface type to the core libraries
fweimer at redhat.com
Wed Jan 16 16:32:42 UTC 2013
On 01/16/2013 05:27 PM, Brian Goetz wrote:
> The primary purpose of this annotation is to *capture design intent*. It is not required. The compiler will help you enforce the design intent if you provide it. The compiler will not synthesize this annotation, since that would be guessing at the design intent. It is possible to create classfiles that subvert the design intent.
> The point about other languages was simply to point out that the universe of tools that might usefully use this design intent is bigger than sometimes assumed.
I don't think run-time behavior should depend on optional annotations
documenting design intent (like @Override).
Supporting the discovery of functional interfaces is a good idea. But a
method like Class#isFunctionalInterface() would sever this purpose
better than an entirely optional annotation.
Florian Weimer / Red Hat Product Security Team
More information about the core-libs-dev