changeset 8474:048f6b9603cf

7081817: test/sun/security/provider/certpath/X509CertPath/IllegalCertiticates.java failing Reviewed-by: alanb, weijun
author xuelei
date Mon, 22 Aug 2011 18:21:43 -0700
parents 802c570861cb
children c2ba29a6b98f
files src/share/classes/sun/security/provider/certpath/X509CertPath.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/provider/certpath/X509CertPath.java	Wed Jul 20 04:05:10 2016 +0100
+++ b/src/share/classes/sun/security/provider/certpath/X509CertPath.java	Mon Aug 22 18:21:43 2011 -0700
@@ -105,7 +105,13 @@
         super("X.509");
 
         // Ensure that the List contains only X509Certificates
-        for (Certificate obj : certs) {
+        //
+        // Note; The certs parameter is not necessarily to be of Certificate
+        // for some old code. For compatibility, to make sure the exception
+        // is CertificateException, rather than ClassCastException, please
+        // don't use
+        //     for (Certificate obj : certs)
+        for (Object obj : certs) {
             if (obj instanceof X509Certificate == false) {
                 throw new CertificateException
                     ("List is not all X509Certificates: "