< prev index next >

src/java.base/share/classes/java/util/Map.java

Print this page
rev 47862 : imported patch immu0

@@ -1284,11 +1284,11 @@
      * @return an empty {@code Map}
      *
      * @since 9
      */
     static <K, V> Map<K, V> of() {
-        return ImmutableCollections.Map0.instance();
+        return ImmutableCollections.emptyMap();
     }
 
     /**
      * Returns an immutable map containing a single mapping.
      * See <a href="#immutable">Immutable Map Static Factory Methods</a> for details.

@@ -1601,11 +1601,11 @@
      */
     @SafeVarargs
     @SuppressWarnings("varargs")
     static <K, V> Map<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
         if (entries.length == 0) { // implicit null check of entries
-            return ImmutableCollections.Map0.instance();
+            return ImmutableCollections.emptyMap();
         } else if (entries.length == 1) {
             return new ImmutableCollections.Map1<>(entries[0].getKey(),
                                                    entries[0].getValue());
         } else {
             Object[] kva = new Object[entries.length << 1];
< prev index next >