Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4503146

REGRESSION: IllegalArgumentException for zero-capacity WeakHashMap

XMLWordPrintable

    • beta3
    • sparc
    • solaris_2.6
    • Verified



      Name: rmT116609 Date: 09/14/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

       import java.util.*;

       public class HM
       {
          public static void main(String[] argv)
          {
              Map map = new WeakHashMap(0);
              map.put("a","b");
          }
       }

       This runs fine in java 1.3, but throws an illegalArgumentException on the
       constructor in 1.4. This is undocumented, inconsistent with HashMap and
       probably erroneous.
      (Review ID: 131366)
      ======================================================================

            jjb Josh Bloch (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: