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

Brian Goetz brian.goetz at oracle.com
Tue Feb 5 22:40:14 UTC 2013


A significant fraction of the lambda candidates in the JDK are converted 
to some form of PrivilegedAction.  However, at least until there is a 
significant performance advantage of lambda over inner classes, I think 
it is probably not worth trying to convert these -- I think the 
explicitness of "new PrivilegedAction" is pretty valuable.

As a result, I am not sure whether it is a good idea to blanketly mark 
these as @FunctionalInterface, even though they are technically.

On 2/5/2013 5: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