Security-related types that are candidates to be FunctionalInterfaces in JDK 8

Joe Darcy joe.darcy at oracle.com
Wed Feb 6 19:43:07 UTC 2013


Hi Sean,

Apart from the performance concern Brian has already raised, I think the 
basic question to provide guidance on whether or not 
@FunctionalInterfaces should be applied to existing types is: do people 
routinely use anonymous inner classes to create instances of these types 
today?  If so, the @FunctionalInterface annotation should be added to 
indicate the type is meant to be used for lambda expressions too.

The JSR for lambda has some specification material and there is a lambda 
faq in progress (http://www.lambdafaq.org/),  but I'm not aware of any 
existing discussion of the use of @FunctionalInterface since it is a 
relatively new addition to JDK 8 builds.

HTH,

-Joe

On 2/6/2013 11:34 AM, Sean Mullan wrote:
> I need to come up to speed on lambda in order to properly review this. 
> What's the best place to learn more about lambda and 
> FunctionalInterfaces?
>
> Thanks,
> Sean
>
> On 02/05/2013 05:35 PM, Joe Darcy wrote:
>> Hello,
>>
>> As part of Project Lambda, a FunctionalInterface annotation type was
>> added to the platform to mark interfaces that are intended to be used in
>> lambda expressions.  I've sent out a code review request to add this
>> annotation to types in the core-libs area [1].
>>
>> To assist the security team in adding analogous annotations to your
>> types, the list of candidate types in for security-related classes in
>> java.* and javax.* is given below.  I recommend sub-tasks of JDK-8005297
>> "Add FunctionalInterface support to the platform" be used to track the
>> work of adding @FunctionalInterface annotations to security types.
>>
>> Thanks,
>>
>> -Joe
>>
>> [1]
>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-February/014292.html 
>>
>>
>>
>> jdk/src/share/classes/java/security/DomainCombiner.java:81: Note:
>> Candidate functional interface
>> public interface DomainCombiner {
>>         ^
>> jdk/src/share/classes/java/security/KeyStore.java:212: Note: Candidate
>> functional interface
>>      public static interface LoadStoreParameter {
>>                    ^
>> jdk/src/share/classes/java/security/cert/CertPathParameters.java:40:
>> Note: Candidate functional interface
>> public interface CertPathParameters extends Cloneable {
>>         ^
>> jdk/src/share/classes/java/security/cert/CertPathValidatorResult.java:41: 
>> Note:
>> Candidate functional interface
>> public interface CertPathValidatorResult extends Cloneable {
>>         ^
>> jdk/src/share/classes/java/security/cert/CertStoreParameters.java:49:
>> Note: Candidate functional interface
>> public interface CertStoreParameters extends Cloneable {
>>         ^
>> jdk/src/share/classes/java/security/interfaces/ECKey.java:36: Note:
>> Candidate functional interface
>> public interface ECKey {
>>         ^
>> jdk/src/share/classes/java/security/interfaces/DSAKey.java:39: Note:
>> Candidate functional interface
>> public interface DSAKey {
>>         ^
>> jdk/src/share/classes/java/security/interfaces/RSAKey.java:41: Note:
>> Candidate functional interface
>> public interface RSAKey {
>>         ^
>> jdk/src/share/classes/java/security/PrivilegedAction.java:42: Note:
>> Candidate functional interface
>> public interface PrivilegedAction<T> {
>>         ^
>> jdk/src/share/classes/java/security/Guard.java:43: Note: Candidate
>> functional interface
>> public interface Guard {
>>         ^
>> jdk/src/share/classes/java/security/PrivilegedExceptionAction.java:45:
>> Note: Candidate functional interface
>> public interface PrivilegedExceptionAction<T> {
>>         ^
>> jdk/src/share/classes/java/security/Principal.java:39: Note: Candidate
>> functional interface
>> public interface Principal {
>>         ^
>> jdk/src/share/classes/java/security/spec/ECField.java:41: Note:
>> Candidate functional interface
>> public interface ECField {
>>         ^
>> jdk/src/share/classes/javax/crypto/interfaces/DHKey.java:40: Note:
>> Candidate functional interface
>> public interface DHKey {
>>         ^
>>
>> jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java:68: 
>>
>> Note: Candidate functional interface
>> public interface CallbackHandler {
>>         ^
>>
>




More information about the security-dev mailing list