Merge JDK 1.4 java.security changes from classpath.
* java/security/AccessControlException.java: Merge from Classpath. * java/security/AccessController.java: Likewise. * java/security/AllPermission.java: Likewise. * java/security/BasicPermission.java: Likewise. * java/security/Certificate.java: Likewise. * java/security/CodeSource.java: Likewise. * java/security/DigestException.java: Likewise. * java/security/DigestOutputStream.java: Likewise. * java/security/DomainCombiner.java: Likewise. * java/security/GeneralSecurityException.java: Likewise. * java/security/Guard.java: Likewise. * java/security/GuardedObject.java: Likewise. * java/security/InvalidAlgorithmParameterException.java: Likewise. * java/security/InvalidKeyException.java: Likewise. * java/security/InvalidParameterException.java: Likewise. * java/security/Key.java: Likewise. * java/security/KeyException.java: Likewise. * java/security/KeyManagementException.java: Likewise. * java/security/KeyStoreException.java: Likewise. * java/security/MessageDigest.java: Likewise. * java/security/NoSuchAlgorithmException.java: Likewise. * java/security/NoSuchProviderException.java: Likewise. * java/security/Permission.java: Likewise. * java/security/PermissionCollection.java: Likewise. * java/security/Permissions.java: Likewise. * java/security/Policy.java: Likewise. * java/security/Principal.java: Likewise. * java/security/PrivateKey.java: Likewise. * java/security/PrivilegedAction.java: Likewise. * java/security/PrivilegedActionException.java: Likewise. * java/security/PrivilegedExceptionAction.java: Likewise. * java/security/ProtectionDomain.java: Likewise. * java/security/ProviderException.java: Likewise. * java/security/PublicKey.java: Likewise. * java/security/SecureClassLoader.java: Likewise. * java/security/SecurityPermission.java: Likewise. * java/security/SignatureException.java: Likewise. * java/security/UnrecoverableKeyException.java: Likewise. * java/security/UnresolvedPermission.java: Likewise. * java/security/acl/AclNotFoundException.java: Likewise. * java/security/acl/LastOwnerException.java: Likewise. * java/security/acl/NotOwnerException.java: Likewise. * java/security/cert/CRLException.java: Likewise. * java/security/cert/CertificateEncodingException.java: Likewise. * java/security/cert/CertificateException.java: Likewise. * java/security/cert/CertificateExpiredException.java: Likewise. * java/security/cert/CertificateFactory.java: Likewise. * java/security/cert/CertificateNotYetValidException.java: Likewise. * java/security/cert/CertificateParsingException.java: Likewise. * java/security/spec/InvalidKeySpecException.java: Likewise. * java/security/spec/InvalidParameterSpecException.java: Likewise. * java/security/cert/CertPath.java: New file. * java/security/cert/CertPathBuilderException.java: New file. * java/security/cert/CertPathValidatorException.java: New file. * java/security/cert/CertStoreException.java: New file. * Makefile.am: Add new CertPath classes. * Makefile.in: Rebuilt. * gnu/java/util/EmptyEnumeration: New file from classpath. From-SVN: r53837
This commit is contained in:
parent
4fbecd2944
commit
d2f108e266
59 changed files with 2816 additions and 1371 deletions
|
@ -1,6 +1,5 @@
|
|||
/* PrivilegedActionException.java -- An exception occurred in a
|
||||
privileged action.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
/* PrivilegedActionException.java -- wrap an exception in a privileged action
|
||||
Copyright (C) 1998, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -38,76 +37,73 @@ exception statement from your version. */
|
|||
|
||||
package java.security;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* This exception is thrown when an exception is thrown during a
|
||||
* privileged action being performed with the
|
||||
* <code>AccessController.doPrivileged()</code> method. It wrappers the
|
||||
* privileged action being performed with the
|
||||
* <code>AccessController.doPrivileged()</code> method. It wraps the
|
||||
* actual exception thrown in the privileged code.
|
||||
*
|
||||
* @version 0.0
|
||||
*
|
||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||
* @author Aaron M. Renn <arenn@urbanophile.com>
|
||||
* @author Eric Blake <ebb9@email.byu.edu>
|
||||
* @see PrivilegedExceptionAction
|
||||
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
|
||||
* @see AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext)
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
public class PrivilegedActionException extends Exception
|
||||
{
|
||||
|
||||
/**
|
||||
* This is the actual exception that occurred
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private Exception e;
|
||||
private static final long serialVersionUID = 4724086851538908602L;
|
||||
|
||||
/**
|
||||
* This method initializes a new instance of <code>PrivilegedActionException</code>
|
||||
* that wrappers the specified <code>Exception</code>.
|
||||
* This is the actual exception that occurred.
|
||||
*
|
||||
* @param e The <code>Exception</code> to wrapper
|
||||
* @serial the wrapped exception
|
||||
*/
|
||||
private Exception exception;
|
||||
|
||||
/**
|
||||
* Create a new instance that wraps the specified <code>Exception</code>.
|
||||
*
|
||||
* @param e the <code>Exception</code> to wrap
|
||||
*/
|
||||
public PrivilegedActionException(Exception e)
|
||||
{
|
||||
this.e = e;
|
||||
super(e);
|
||||
exception = e;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the underlying <code>Exception</code> that caused
|
||||
* this exception to be raised.
|
||||
* Get the underlying <code>Exception</code> that caused this one. This
|
||||
* is a legacy method, the preferred way is {@link #getCause()}.
|
||||
*
|
||||
* @return The wrappered <code>Exception</code>.
|
||||
* @return the cause
|
||||
*/
|
||||
public Exception getException()
|
||||
{
|
||||
return (e);
|
||||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prints the stack trace of the wrappered exception.
|
||||
*/
|
||||
public void printStackTrace()
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prints the stack trace of the wrappered exception to the
|
||||
* specified <code>PrintStream</code>.
|
||||
* Gets the cause of this exception.
|
||||
*
|
||||
* @param ps The <code>PrintStream</code> to print the stack trace to.
|
||||
* @return the cause
|
||||
* @since 1.4
|
||||
*/
|
||||
public void printStackTrace(PrintStream ps)
|
||||
public Throwable getCause()
|
||||
{
|
||||
e.printStackTrace(ps);
|
||||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prints the stack trace of the wrappered exception to the
|
||||
* specified <code>PrintWriter</code>.
|
||||
* Convert this to a String.
|
||||
*
|
||||
* @param pw The <code>PrintWriter</code> to print the stack trace to.
|
||||
* @return the string representation
|
||||
*/
|
||||
public void printStackTrace(PrintWriter pw)
|
||||
public String toString()
|
||||
{
|
||||
e.printStackTrace(pw);
|
||||
return super.toString();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue