src/share/classes/java/util/Hashtable.java

Print this page
rev 9708 : 8035284: Remove redundant null initialization
Reviwed-by: duke

*** 615,627 **** /** * Each of these fields are initialized to contain an instance of the * appropriate view the first time this view is requested. The views are * stateless, so there's no reason to create more than one of each. */ ! private transient volatile Set<K> keySet = null; ! private transient volatile Set<Map.Entry<K,V>> entrySet = null; ! private transient volatile Collection<V> values = null; /** * Returns a {@link Set} view of the keys contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified --- 615,627 ---- /** * Each of these fields are initialized to contain an instance of the * appropriate view the first time this view is requested. The views are * stateless, so there's no reason to create more than one of each. */ ! private transient volatile Set<K> keySet; ! private transient volatile Set<Map.Entry<K,V>> entrySet; ! private transient volatile Collection<V> values; /** * Returns a {@link Set} view of the keys contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified
*** 1298,1309 **** * by passing an Enumeration. */ private class Enumerator<T> implements Enumeration<T>, Iterator<T> { Entry<?,?>[] table = Hashtable.this.table; int index = table.length; ! Entry<?,?> entry = null; ! Entry<?,?> lastReturned = null; int type; /** * Indicates whether this Enumerator is serving as an Iterator * or an Enumeration. (true -> Iterator). --- 1298,1309 ---- * by passing an Enumeration. */ private class Enumerator<T> implements Enumeration<T>, Iterator<T> { Entry<?,?>[] table = Hashtable.this.table; int index = table.length; ! Entry<?,?> entry; ! Entry<?,?> lastReturned; int type; /** * Indicates whether this Enumerator is serving as an Iterator * or an Enumeration. (true -> Iterator).