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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2011, 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 --- 1,7 ---- /* ! * 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,61 **** // 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(); return attr; } /** * Adds a new value to this attribute. --- 48,60 ---- // these two are used to reconstruct the baseCtx if this attribute has // been serialized ( private String baseCtxURL; private Hashtable<String, ? super String> baseCtxEnv; public Object clone() { LdapAttribute attr = new LdapAttribute(this.attrID, baseCtx, rdn); ! attr.values = values.clone(); return attr; } /** * Adds a new value to this attribute.
*** 161,171 **** //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.remove(key); } } } --- 160,170 ---- //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 = realEnv.clone(); } secureEnv.remove(key); } } }