JDK-8219145 : Add @FunctionalInterface annotation to PrivilegedAction and PrivilegedExceptionAction
  • Type: CSR
  • Component: security-libs
  • Sub-Component: java.security
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-02-15
  • Updated: 2019-02-22
  • Resolved: 2019-02-22
Related Reports
CSR :  
Description
Summary
-------

Add the @FunctionalInterface annotation to the java.security.PrivilegedAction and java.security.PrivilegedExceptionAction interfaces.

Problem
-------

These interfaces meet the definition of a FunctionalInterface and should be marked accordingly.

Solution
--------

Add @FunctionalInterface to the interfaces.

Specification
-------------
```
diff -r bc8fb1fa55b5 src/java.base/share/classes/java/security/PrivilegedAction.java
--- a/src/java.base/share/classes/java/security/PrivilegedAction.java   Thu Feb 14 07:41:54 2019 -0800
+++ b/src/java.base/share/classes/java/security/PrivilegedAction.java   Fri Feb 15 16:57:49 2019 -0500
@@ -39,7 +39,7 @@
  * @see AccessController#doPrivileged(PrivilegedAction)
  * @see PrivilegedExceptionAction
  */
-
+@FunctionalInterface
 public interface PrivilegedAction<T> {
     /**
      * Performs the computation.  This method will be called by
diff -r bc8fb1fa55b5 src/java.base/share/classes/java/security/PrivilegedExceptionAction.java
--- a/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java  Thu Feb 14 07:41:54 2019 -0800
+++ b/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java  Fri Feb 15 16:57:49 2019 -0500
@@ -42,7 +42,7 @@
  *                                              AccessControlContext)
  * @see PrivilegedAction
  */
-
+@FunctionalInterface
 public interface PrivilegedExceptionAction<T> {
     /**
      * Performs the computation.  This method will be called by
```
Comments
Moving to Approved.
22-02-2019