Commits

Anonymous committed 3f81fef Merge

Merge "Switch Provider changedProperties to LinkedHashMap"

Comments (0)

Files changed (2)

luni/src/main/java/java/security/Provider.java

 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
     private transient LinkedHashMap<String, Service> propertyAliasTable;
 
     // The properties changed via put()
-    private transient Properties changedProperties;
+    private transient LinkedHashMap<Object, Object> changedProperties;
 
     // For getService(String type, String algorithm) optimization:
     // previous result
 
     private void myPutAll(Map<?,?> t) {
         if (changedProperties == null) {
-            changedProperties = new Properties();
+            changedProperties = new LinkedHashMap<Object, Object>();
         }
         Iterator<? extends Map.Entry<?, ?>> it = t.entrySet().iterator();
         Object key;
             removeFromPropertyServiceTable(key);
         }
         if (changedProperties == null) {
-            changedProperties = new Properties();
+            changedProperties = new LinkedHashMap<Object, Object>();
         }
         changedProperties.put(key, value);
         return super.put(key, value);

luni/src/test/java/libcore/java/security/ProviderTest.java

             assertEquals(1, position);
             SecureRandom sr = new SecureRandom();
             if (!sr.getAlgorithm().equals("SecureRandom1")) {
-                throw new IllegalStateException("Expected SecureRandom1");
+                throw new IllegalStateException("Expected SecureRandom1 was " + sr.getAlgorithm());
             }
         } finally {
             Security.removeProvider(srp.getName());