Program: 36564
Project: 36564
Buggy source:
/** 
 * Performs the specified   {@code PrivilegedExceptionAction} withprivileges enabled and restricted by the specified {@code AccessControlContext} and with a privilege scope limited byspecified  {@code Permission} arguments.The action is performed with the intersection of the permissions possessed by the caller's protection domain, and those possessed by the domains represented by the specified {@code AccessControlContext}. <p> If the action's   {@code run} method throws an (unchecked) exception,it will propagate through this method.
 * @param action the action to be performed.
 * @param context an <i>access control context</i>representing the restriction to be applied to the caller's domain's privileges before performing the specified action.  If the context is {@code null}, then no additional restriction is applied.
 * @param perms the {@code Permission} arguments which limit thescope of the caller's privileges. The number of arguments is variable.
 * @return the value returned by the action's {@code run} method.
 * @throws PrivilegedActionException if the specified action's{@code run} method threw a <i>checked</i> exception
 * @throws NullPointerException if action or perms or any element ofperms is  {@code null}
 * @see #doPrivileged(PrivilegedAction)
 * @see #doPrivileged(PrivilegedAction,AccessControlContext)
 * @since 1.8
 */
@CallerSensitive public static <T>T doPrivileged(PrivilegedExceptionAction<T> action,AccessControlContext context,Permission... perms) throws PrivilegedActionException {
  AccessControlContext parent=getContext();
  if (perms == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Class<?> caller=Reflection.getCallerClass();
  return AccessController.doPrivileged(action,createWrapper(null,caller,parent,context,perms));
}

Fixed version (ground truth):
/** 
 * Performs the specified   {@code PrivilegedExceptionAction} withprivileges enabled and restricted by the specified {@code AccessControlContext} and with a privilege scope limited byspecified  {@code Permission} arguments.The action is performed with the intersection of the permissions possessed by the caller's protection domain, and those possessed by the domains represented by the specified {@code AccessControlContext}. <p> If the action's   {@code run} method throws an (unchecked) exception,it will propagate through this method.
 * @param < T > the type of the value returned by thePrivilegedExceptionAction's  {@code run} method.
 * @param action the action to be performed.
 * @param context an <i>access control context</i>representing the restriction to be applied to the caller's domain's privileges before performing the specified action.  If the context is {@code null}, then no additional restriction is applied.
 * @param perms the {@code Permission} arguments which limit thescope of the caller's privileges. The number of arguments is variable.
 * @return the value returned by the action's {@code run} method.
 * @throws PrivilegedActionException if the specified action's{@code run} method threw a <i>checked</i> exception
 * @throws NullPointerException if action or perms or any element ofperms is  {@code null}
 * @see #doPrivileged(PrivilegedAction)
 * @see #doPrivileged(PrivilegedAction,AccessControlContext)
 * @since 1.8
 */
@CallerSensitive public static <T>T doPrivileged(PrivilegedExceptionAction<T> action,AccessControlContext context,Permission... perms) throws PrivilegedActionException {
  AccessControlContext parent=getContext();
  if (perms == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Class<?> caller=Reflection.getCallerClass();
  return AccessController.doPrivileged(action,createWrapper(null,caller,parent,context,perms));
}