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

WeakHashMap documentation does not specify the maximum value for initialCapacity

    Details

    • Type: Enhancement
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      ADDITIONAL SYSTEM INFORMATION :
      https://docs.oracle.com/javase/8/docs/api/java/util/WeakHashMap.html

      A DESCRIPTION OF THE PROBLEM :
      Documentation should specify a maximum value for initialCapacity parameter. WeakHashMap constructor can throw OutOfMemoryError when executing the following program in other JVMs (e.g. Eclipse OpenJ9):

      import java.util.WeakHashMap;
      public class A {
          public static void main(String[] args) {
              new WeakHashMap(Integer.MAX_VALUE, 1.0f);
          }
      }


        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: