src/java.base/share/classes/java/lang/Class.java
changeset 49521 755e1b55a4df
parent 48044 2919fa8f237c
child 49981 bd0a95bec96b
--- a/src/java.base/share/classes/java/lang/Class.java	Wed Apr 04 11:26:10 2018 -0400
+++ b/src/java.base/share/classes/java/lang/Class.java	Wed Apr 04 14:09:31 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3529,7 +3529,7 @@
             if (universe == null)
                 throw new IllegalArgumentException(
                     getName() + " is not an enum type");
-            directory = new HashMap<>(2 * universe.length);
+            directory = new HashMap<>((int)(universe.length / 0.75f) + 1);
             for (T constant : universe) {
                 directory.put(((Enum<?>)constant).name(), constant);
             }