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

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

@@ -840,11 +840,11 @@
     }
 
     private class EntryIterator
         extends IdentityHashMapIterator<Map.Entry<K,V>>
     {
-        private Entry lastReturnedEntry = null;
+        private Entry lastReturnedEntry;
 
         public Map.Entry<K,V> next() {
             lastReturnedEntry = new Entry(nextIndex());
             return lastReturnedEntry;
         }

@@ -926,11 +926,11 @@
     /**
      * This field is initialized to contain an instance of the entry set
      * view the first time this view is requested.  The view is stateless,
      * so there's no reason to create more than one.
      */
-    private transient Set<Map.Entry<K,V>> entrySet = null;
+    private transient Set<Map.Entry<K,V>> entrySet;
 
     /**
      * Returns an identity-based 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 while an iteration