src/share/classes/sun/security/provider/certpath/ForwardState.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -240,12 +240,11 @@
     public Object clone() {
         try {
             ForwardState clonedState = (ForwardState) super.clone();
 
             /* clone checkers, if cloneable */
-            clonedState.forwardCheckers = (ArrayList<PKIXCertPathChecker>)
-                                                forwardCheckers.clone();
+            clonedState.forwardCheckers = forwardCheckers.clone();
             ListIterator<PKIXCertPathChecker> li =
                                 clonedState.forwardCheckers.listIterator();
             while (li.hasNext()) {
                 PKIXCertPathChecker checker = li.next();
                 if (checker instanceof Cloneable) {

@@ -256,12 +255,11 @@
             /*
              * Shallow copy traversed names. There is no need to
              * deep copy contents, since the elements of the Set
              * are never modified by subsequent calls to updateState().
              */
-            clonedState.subjectNamesTraversed
-                = (HashSet<GeneralNameInterface>)subjectNamesTraversed.clone();
+            clonedState.subjectNamesTraversed = subjectNamesTraversed.clone();
             return clonedState;
         } catch (CloneNotSupportedException e) {
             throw new InternalError(e.toString(), e);
         }
     }