Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8219145

Add @FunctionalInterface annotation to PrivilegedAction and PrivilegedExceptionAction

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: security-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      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
      <h2>  */</h2>
      
      +@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
      <h2>  */</h2>
      
      +@FunctionalInterface
       public interface PrivilegedExceptionAction<T> {
           /**
            * Performs the computation.  This method will be called by

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mullan Sean Mullan
                Reporter:
                wetmore Bradford Wetmore
                Reviewed By:
                Christoph Langer
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: