# HG changeset patch # User redestad # Date 1521623594 -3600 # Node ID e137b71166c4587e8ddce01d695b8f7bb1b97fcd # Parent 7b35d2a59fb3b2f1b01b6fdf692a5ae774c1fc05 8199865: Avoid initializing ShortCache in ProxyGenerator Reviewed-by: mchung diff -r 7b35d2a59fb3 -r e137b71166c4 src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java --- a/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java Wed Mar 21 09:06:45 2018 +0000 +++ b/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java Wed Mar 21 10:13:14 2018 +0100 @@ -1726,7 +1726,7 @@ * This map is used to look up the index of an existing entry for * values of all types. */ - private Map map = new HashMap<>(16); + private Map map = new HashMap<>(16); /** true if no new constant pool entries may be added */ private boolean readOnly = false; @@ -1878,7 +1878,7 @@ * java.lang.Double CONSTANT_DOUBLE */ private short getValue(Object key) { - Short index = map.get(key); + Integer index = map.get(key); if (index != null) { return index.shortValue(); } else { @@ -1887,7 +1887,7 @@ "late constant pool addition: " + key); } short i = addEntry(new ValueEntry(key)); - map.put(key, i); + map.put(key, (int)i); return i; } } @@ -1897,7 +1897,7 @@ * references to other constant pool entries. */ private short getIndirect(IndirectEntry e) { - Short index = map.get(e); + Integer index = map.get(e); if (index != null) { return index.shortValue(); } else { @@ -1905,7 +1905,7 @@ throw new InternalError("late constant pool addition"); } short i = addEntry(e); - map.put(e, i); + map.put(e, (int)i); return i; } }