< prev index next >

src/java.base/share/classes/com/sun/java/util/jar/pack/PackageWriter.java

Print this page

        

@@ -827,11 +827,11 @@
 
     void collectAttributeLayouts() {
         maxFlags = new int[ATTR_CONTEXT_LIMIT];
         allLayouts = new FixedList<>(ATTR_CONTEXT_LIMIT);
         for (int i = 0; i < ATTR_CONTEXT_LIMIT; i++) {
-            allLayouts.set(i, new HashMap<Attribute.Layout, int[]>());
+            allLayouts.set(i, new HashMap<>());
         }
         // Collect maxFlags and allLayouts.
         for (Class cls : pkg.classes) {
             visitAttributeLayoutsIn(ATTR_CONTEXT_CLASS, cls);
             for (Class.Field f : cls.getFields()) {

@@ -890,11 +890,11 @@
                     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.
             Arrays.sort(layoutsAndCounts,
-                        new Comparator<Map.Entry<Attribute.Layout, int[]>>() {
+                        new Comparator<>() {
                 public int compare(Map.Entry<Attribute.Layout, int[]> e0,
                                    Map.Entry<Attribute.Layout, int[]> e1) {
                     // Primary sort key is count, reversed.
                     int r = -(e0.getValue()[0] - e1.getValue()[0]);
                     if (r != 0)  return r;

@@ -1008,11 +1008,11 @@
         }
         // Sort the new attr defs into some "natural" order.
         int numAttrDefs = defList.size();
         Object[][] defs = new Object[numAttrDefs][];
         defList.toArray(defs);
-        Arrays.sort(defs, new Comparator<Object[]>() {
+        Arrays.sort(defs, new Comparator<>() {
             public int compare(Object[] a0, Object[] a1) {
                 // Primary sort key is attr def header.
                 @SuppressWarnings("unchecked")
                 int r = ((Comparable)a0[0]).compareTo(a1[0]);
                 if (r != 0)  return r;
< prev index next >