< prev index next >

src/java.base/share/classes/java/security/Provider.java

Print this page

        

@@ -709,11 +709,11 @@
             return false;
         }
 
         legacyChanged = true;
         if (legacyStrings == null) {
-            legacyStrings = new LinkedHashMap<String,String>();
+            legacyStrings = new LinkedHashMap<>();
         }
         return true;
     }
 
     /**

@@ -771,11 +771,11 @@
 
     @SuppressWarnings("unchecked") // Function must actually operate over strings
     private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
         legacyChanged = true;
         if (legacyStrings == null) {
-            legacyStrings = new LinkedHashMap<String,String>();
+            legacyStrings = new LinkedHashMap<>();
         } else {
             legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
         }
         super.replaceAll(function);
     }

@@ -903,11 +903,11 @@
         if ((legacyChanged == false) || (legacyStrings == null)) {
             return;
         }
         serviceSet = null;
         if (legacyMap == null) {
-            legacyMap = new LinkedHashMap<ServiceKey,Service>();
+            legacyMap = new LinkedHashMap<>();
         } else {
             legacyMap.clear();
         }
         for (Map.Entry<String,String> entry : legacyStrings.entrySet()) {
             parseLegacyPut(entry.getKey(), entry.getValue());

@@ -1131,11 +1131,11 @@
         if (s.getProvider() != this) {
             throw new IllegalArgumentException
                     ("service.getProvider() must match this Provider object");
         }
         if (serviceMap == null) {
-            serviceMap = new LinkedHashMap<ServiceKey,Service>();
+            serviceMap = new LinkedHashMap<>();
         }
         servicesChanged = true;
         String type = s.getType();
         String algorithm = s.getAlgorithm();
         ServiceKey key = new ServiceKey(type, algorithm, true);

@@ -1303,11 +1303,11 @@
         knownEngines.put(name.toLowerCase(ENGLISH), ed);
         knownEngines.put(name, ed);
     }
 
     static {
-        knownEngines = new HashMap<String,EngineDescription>();
+        knownEngines = new HashMap<>();
         // JCA
         addEngine("AlgorithmParameterGenerator",        false, null);
         addEngine("AlgorithmParameters",                false, null);
         addEngine("KeyFactory",                         false, null);
         addEngine("KeyPairGenerator",                   false, null);

@@ -1429,18 +1429,18 @@
             return (type != null) && (algorithm != null) && (className != null);
         }
 
         private void addAlias(String alias) {
             if (aliases.isEmpty()) {
-                aliases = new ArrayList<String>(2);
+                aliases = new ArrayList<>(2);
             }
             aliases.add(alias);
         }
 
         void addAttribute(String type, String value) {
             if (attributes.isEmpty()) {
-                attributes = new HashMap<UString,String>(8);
+                attributes = new HashMap<>(8);
             }
             attributes.put(new UString(type), value);
         }
 
         /**

@@ -1469,16 +1469,16 @@
             this.algorithm = algorithm;
             this.className = className;
             if (aliases == null) {
                 this.aliases = Collections.<String>emptyList();
             } else {
-                this.aliases = new ArrayList<String>(aliases);
+                this.aliases = new ArrayList<>(aliases);
             }
             if (attributes == null) {
                 this.attributes = Collections.<UString,String>emptyMap();
             } else {
-                this.attributes = new HashMap<UString,String>();
+                this.attributes = new HashMap<>();
                 for (Map.Entry<String,String> entry : attributes.entrySet()) {
                     this.attributes.put(new UString(entry.getKey()), entry.getValue());
                 }
             }
         }

@@ -1642,11 +1642,11 @@
                     if (!Modifier.isPublic(clazz.getModifiers())) {
                         throw new NoSuchAlgorithmException
                             ("class configured for " + type + " (provider: " +
                             provider.getName() + ") is not public.");
                     }
-                    classRef = new WeakReference<Class<?>>(clazz);
+                    classRef = new WeakReference<>(clazz);
                 }
                 return clazz;
             } catch (ClassNotFoundException e) {
                 throw new NoSuchAlgorithmException
                     ("class configured for " + type + " (provider: " +
< prev index next >