src/share/classes/java/util/IdentityHashMap.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 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) 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
*** 694,705 **** * Returns a shallow copy of this identity hash map: the keys and values * themselves are not cloned. * * @return a shallow copy of this map */ ! public Object clone() { try { IdentityHashMap<K,V> m = (IdentityHashMap<K,V>) super.clone(); m.entrySet = null; m.table = table.clone(); return m; } catch (CloneNotSupportedException e) { --- 694,707 ---- * Returns a shallow copy of this identity hash map: the keys and values * themselves are not cloned. * * @return a shallow copy of this map */ ! @Override ! public IdentityHashMap<K,V> clone() { try { + @SuppressWarnings("unchecked") IdentityHashMap<K,V> m = (IdentityHashMap<K,V>) super.clone(); m.entrySet = null; m.table = table.clone(); return m; } catch (CloneNotSupportedException e) {