7069870: Parts of the JDK erroneously rely on generic array initializers with diamond
Reviewed-by: ksrini, mcimadamore
Contributed-by: alexandre.boulgakov@oracle.com
diff --git a/make/tools/src/build/tools/jarsplit/JarSplit.java b/make/tools/src/build/tools/jarsplit/JarSplit.java
index a0999de..4b3ece7 100644
--- a/make/tools/src/build/tools/jarsplit/JarSplit.java
+++ b/make/tools/src/build/tools/jarsplit/JarSplit.java
@@ -43,8 +43,8 @@
/* 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];
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
index 16824ad..0f7f51a 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
@@ -780,9 +780,9 @@
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.