src/share/classes/java/util/Calendar.java

Print this page
rev 4788 : Fix bunch of generics warnings

@@ -838,11 +838,11 @@
     /**
      * Cache to hold the firstDayOfWeek and minimalDaysInFirstWeek
      * of a Locale.
      */
     private static final ConcurrentMap<Locale, int[]> cachedLocaleData
-        = new ConcurrentHashMap<Locale, int[]>(3);
+        = new ConcurrentHashMap<>(3);
 
     // Special values of stamp[]
     /**
      * The corresponding fields[] has no value.
      */

@@ -1497,11 +1497,11 @@
 
     private Map<String,Integer> getDisplayNamesImpl(int field, int style, Locale locale) {
         DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
         String[] strings = getFieldStrings(field, style, symbols);
         if (strings != null) {
-            Map<String,Integer> names = new HashMap<String,Integer>();
+            Map<String,Integer> names = new HashMap<>();
             for (int i = 0; i < strings.length; i++) {
                 if (strings[i].length() == 0) {
                     continue;
                 }
                 names.put(strings[i], i);