7069870: Parts of the JDK erroneously rely on generic array initializers with diamond

Reviewed-by: ksrini, mcimadamore
This commit is contained in:
Alexandre Boulgakov 2011-07-25 16:20:39 -07:00 committed by Jonathan Gibbons
parent 05387aad77
commit 545b41c9ab
2 changed files with 4 additions and 4 deletions

View File

@ -43,8 +43,8 @@ public class JarSplit {
/* classlist[0] contains class file list
* classlist[1] contains non-class file list
*/
@SuppressWarnings("unchecked")
private static Vector<String>[] classlist = new Vector<>[2];
@SuppressWarnings({ "unchecked", "rawtypes" })
private static Vector<String>[] classlist = new Vector[2];
/* The 2 class list name passed as arguments. */
private static String[] fileNamelist = new String[2];

View File

@ -780,9 +780,9 @@ class PackageWriter extends BandStructure {
avHiBits &= (1L<<attrIndexLimit[i])-1;
int nextLoBit = 0;
Map<Attribute.Layout, int[]> defMap = allLayouts.get(i);
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
Map.Entry<Attribute.Layout, int[]>[] layoutsAndCounts =
new Map.Entry<>[defMap.size()];
new Map.Entry[defMap.size()];
defMap.entrySet().toArray(layoutsAndCounts);
// Sort by count, most frequent first.
// Predefs. participate in this sort, though it does not matter.