src/share/classes/com/sun/jndi/ldap/LdapAttribute.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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

@@ -48,14 +48,13 @@
     // these two are used to reconstruct the baseCtx if this attribute has
     // been serialized (
     private String baseCtxURL;
     private Hashtable<String, ? super String> baseCtxEnv;
 
-    @SuppressWarnings("unchecked") // clone()
     public Object clone() {
         LdapAttribute attr = new LdapAttribute(this.attrID, baseCtx, rdn);
-        attr.values = (Vector<Object>)values.clone();
+        attr.values = values.clone();
         return attr;
     }
 
     /**
       * Adds a new value to this attribute.

@@ -161,11 +160,11 @@
 
                     //if we need to remove props, we must do it to a clone
                     //of the environment. cloning is expensive, so we only do
                     //it if we have to.
                     if(secureEnv == null) {
-                        secureEnv = (Hashtable<String, Object>)realEnv.clone();
+                        secureEnv = realEnv.clone();
                     }
                     secureEnv.remove(key);
                 }
             }
         }